Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A249893
a(n+1) is next smallest square not divisible by 10 beginning with a(n), initial term is 2.
4
2, 25, 256, 256036, 2560361612769, 256036161276932002260000001, 256036161276932002260000001607597862784080913990785121
OFFSET
1,1
COMMENTS
a(12) has 1717 digits. - Michael S. Branicky, Feb 25 2021
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..11 (terms 1..10 from Hiroaki Yamanouchi)
PROG
(PARI) a(n)=k=n; s=1; while(s<5*10^7, if(s%10, if(s^2\(10^(#Str(s^2)-#Str(k)))==k, print1(s^2, ", "); k=s^2)); s++)
a(2)
(Python)
def f(x):
..print(x, end=', ')
..n = x
..s = 1
..while s < 10**7:
....if s % 10:
......S = str(s**2)
......if S.startswith(str(n)):
........print(s**2, end=', ')
........n = s**2
....s += 1
f(2)
(Python)
from math import isqrt
def anext(an):
lo, hi = an*10, an*10 + 9
while True:
found = False
if isqrt(hi)**2 > lo: return (isqrt(lo)+1)**2
lo, hi = lo*10, hi*10 + 9
n, an = 1, 2
for n in range(2, 17):
an = anext(an)
print(n, an) # Michael S. Branicky, Feb 25 2021
CROSSREFS
Sequence in context: A042919 A229975 A174970 * A085830 A270346 A367506
KEYWORD
nonn,base
AUTHOR
Derek Orr, Nov 08 2014
STATUS
approved