Talk:Sequence of non-squares: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 39:
[[User:Sgeier|Sgeier]] 21:02, 28 September 2009 (UTC)
 
See GAP implementation for a way to use integers all the way. Of course, it will be best suited to languages with bigints, like python or ocaml, but others will do as long as you don't go past MAXINT/100. You also need to implement integer square root if it's not available in your language (not too difficult). The main idea is Sqrt(100*n) = 10*Sqrt(n) (let's call it x), so you get the first decimal of Sqrt(n) as floor(x) mod 10, or simply x mod 10 if using integer square root.
[[User:Toucan|Toucan]] 08:27, 15 June 2011 (UTC)
 
506

edits