Brainsteem Compute #4 Prize Computational Maths Puzzle [Win 40% and 10% in SBD]

in #math7 years ago (edited)


The Background

A palindromic number is one that reads the same in both directions. These include 1331, 10901 and 77777.

The largest palindrome made from the product of two 2-digit numbers is 99 x 91 = 9009.

The Question

Find the largest palindrome made from the product of two 5-digit numbers.

For the First Prize, please include a valid method, algorithm or post the code and output.

Remember that even if you are not the first to post, there is the random prize, and this remains a learning experience that can help in future Brainsteem challenges.


Prizes

To qualify you must upvote this post and write the answer in a comment.

To win First Prize you must include the answer and a valid method.

The First Prize will be 40% of the earnings generated by this post, paid in SBD.

The Second Prize will be 10% of the earnings generated by this post, awarded to any other correct answer in the comments section, chosen at random and paid in SBD.

Also remember that your upvote generates curation rewards for you and that 25% of all earnings are given to upvoters.

Prizes will be awarded after the 7 days have expired. Winners will be announced in the comments below after the draw.

The Prizes will increase with more participation and as the earnings increase.

The main thing is to enjoy the challenge and maybe learn something new.


Come and check out other challenges currently live!

Brainsteem Compute #3 Prize Computational Maths Puzzle [Win 40% and 10% in SBD]

Brainsteem Mathematics Challenges - Digital Sum

Brainsteem Mathematics Challenges - Upside Down Number

Brainsteem Quickfire Q5 [Win 40% and 10% in SBD]

Brainsteem #9 Prize Maths Puzzle [Win 40% and 10% in SBD]

Brainsteem Compute #2 Prize Computational Maths Puzzle [Win 40% and 10% in SBD]

Brainsteem Quickfire Q4 [Win 40% and 10% in SBD]


Please upvote, resteem and follow @rycharde for more Brainsteems!
I am experimenting with tags, so the easiest way to see all Brainsteems is to follow me. Thanks.

And don't forget to upvote each other's comments to bring cheer to the whole community!

Sort:  

Could either of you - @whd or @doughtaker - enlighten us as to what was the step that made one algorithm stop early?
Might be useful to others, and possibly for the future as these questions get harder.

Sure thing. The issue is the type of variable used. An ordinary integer (int) is a 32-bit variable, and thus its maximum value is 2,147,483,647 (231 - 1). To get beyond that you need to use a long integer (long), which is a 64-bit variable and can go up to 9,223,372,036,854,775,807 (263 - 1).

Loading...

2147447412 source

Simply iteration in 2 for loops

for i=10000;i<=99999;i++
for ii=10000;i<=99999;ii++
if(isPalindrome(i*ii)
if(largest<i*ii)
largest = i*ii
end
end
return largest

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 64269.87
ETH 3393.79
USDT 1.00
SBD 2.48