OFFSET
1,3
COMMENTS
a(14), if it exists, is > 10^34. - Lars Blomberg, Nov 25 2016
Is it true that all terms are palindromes? - Chai Wah Wu, Apr 06 2018
FORMULA
a(n) = A048412(n)^2.
MATHEMATICA
Select[Range[0, 10^7]^2, Or[# == 0, IntegerLength@ # == 1, Union@ Abs@ Differences@ IntegerDigits@ # == {1}] &] (* Michael De Vlieger, Nov 25 2016 *)
PROG
(Haskell)
a048411 n = a048411_list !! (n-1)
a048411_list = filter ((== 1) . a010052) a033075_list
-- Reinhard Zumkeller, Feb 21 2012
(Python)
from sympy.ntheory.primetest import is_square
def gen(d, s=None):
if d == 0: yield tuple(); return
if s == None:
yield from [(i, ) + g for i in range(1, 10) for g in gen(d-1, s=i)]
else:
if s > 0: yield from [(s-1, ) + g for g in gen(d-1, s=s-1)]
if s < 9: yield from [(s+1, ) + g for g in gen(d-1, s=s+1)]
def afind(maxdigits):
print(0, end=", ")
for d in range(1, maxdigits+1):
for g in gen(d, s=None):
t = int("".join(map(str, g)))
if is_square(t): print(t, end=", ")
afind(17) # Michael S. Branicky, Sep 26 2021
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Patrick De Geest, Apr 15 1999
STATUS
approved