lambdaway
::
babbage
6
|
list
|
login
|
load
|
|
_h1 Charles Babbage _ul [[http://rosettacode.org/wiki/Babbage_problem| http://rosettacode.org/wiki/Babbage_problem]] _p What is the smallest positive integer whose square ends in the digits 269,696? Babbage thought the answer might be 99,736, whose square is 9,947,269,696; but he couldn't be certain. This is a brute force but simple approach to get the two first ones: {prewrap '{S.map {lambda {:n} {if {= {% {* :n :n} 1000000} 269696} then :n{sup 2} = {* :n :n} else}} {S.serie {- {round {sqrt 269696}} 1} 100000 2}} -> {S.map {lambda {:n} {if {= {% {* :n :n} 1000000} 269696} then :n{sup 2} = {* :n :n} else}} {S.serie {- {round {sqrt 269696}} 1} 100000 2}} {round {sqrt 269696}} 25264^2 -> 638269696 99736^2 -> 9947269696 150264^2 -> 22579269696 224736^2 -> 50506269696 275264^2 -> 75770269696 349736^2 -> 122315269696 400264^2 -> 160211269696 474736^2 -> 225374269696 525264^2 -> 275902269696 599736^2 -> 359683269696 }
lambdaway v.20211111