Babbage problem: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 613: | Line 613: | ||
Now my question for you, Sir, is how did you know that the square of ANY number would end in 269696?? |
Now my question for you, Sir, is how did you know that the square of ANY number would end in 269696?? |
||
Oh, and by the way, 99,736 is an answer too. |
Oh, and by the way, 99,736 is an answer too. |
||
=={{header|OCaml}}== |
|||
<lang OCaml> |
|||
let rec f a= |
|||
if (a*a) mod 1000000 != 269696 |
|||
then f(a+1) |
|||
else a |
|||
in |
|||
let a= f 1 in |
|||
Printf.printf "smallest positive integer whose square ends in the digits 269696 is %d\n" a |
|||
</lang> |
|||
=={{header|PARI/GP}}== |
=={{header|PARI/GP}}== |