login
A174245
a(n) is the smallest number m such that the sum of the first m squares ends in n '0's.
1
4, 24, 624, 5312, 45312, 445312, 6445312, 12890624, 212890624, 893554687, 40893554687, 40893554687, 81787109375, 59918212890624, 129959106445312, 3740081787109375, 56259918212890624, 128129959106445312, 3871870040893554687, 7743740081787109375, 607743740081787109375
OFFSET
1,1
LINKS
EXAMPLE
The smallest sum of squares ending in a zero is 1^2 + 2^2 + 3^2 + 4^2 = 30, so a(1)=4. Likewise, 1^2 + ... + 24^2 = 4900, so a(2)=24.
MAPLE
f:= n -> min(map(rhs@op, {msolve(k*(k+1)*(2*k+1), 6*10^n)}) minus {0}):
map(f, [$1..30]); # Robert Israel, Mar 13 2025
PROG
(PARI) sos(x) = x*(x+1)*(2*x+1)/6;
a(n)={ local(s5=polrootspadic(sos(x), 5, n), s2=polrootspadic(sos(x), 2, n), ss10=Set()); for(i2=1, length(s2), v2=lift(s2[i2]); if(denominator(v2)==1, m2=Mod(v2, 2^n); for(i5=1, length(s5), s10=lift(chinese(m2, Mod(s5[i5], 5^n))); if(s10!=0&&sos(s10)%(10^n)==0, ss10=setunion(ss10, Set(s10))) ) ) ); ss10[1] }
CROSSREFS
Cf. A000330.
Sequence in context: A249028 A394097 A216092 * A228191 A012989 A347480
KEYWORD
nonn,base
AUTHOR
Phil Carmody, Mar 13 2010
EXTENSIONS
Typo in definition corrected by Zak Seidov, Mar 16 2010
a(10) corrected by and more terms from Jinyuan Wang, Aug 23 2021
STATUS
approved