ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 28 Jul 2017 00:37:44 +0200how accelerate this simple programhttps://ask.sagemath.org/question/38420/how-accelerate-this-simple-program/Hello everybody. Here is my question
We seek integers of which the decimal part of their square root begin by 2017.
Sample: sqrt(10858) = 104.**2017**27....
Here is my program:
for n in range (1, 10^5):
if int( N(sqrt(n)).frac() * 10000 ) == 2017:
cpt += 1
the problem is it takes too much time.
For the bound 10^5 it takes about 55 sec on my iMac, for 10^6 it takes 620 sec, for 10^7 it takes almost 6000 sec ...
The question is to obtain the result for the bound 10^10 !wisherFri, 28 Jul 2017 00:37:44 +0200https://ask.sagemath.org/question/38420/