cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A048411 Squares whose consecutive digits differ by 1.

This page as a plain text file.
%I A048411 #30 Apr 22 2025 16:26:06
%S A048411 0,1,4,9,121,676,12321,1234321,123454321,12345654321,1234567654321,
%T A048411 123456787654321,12345678987654321
%N A048411 Squares whose consecutive digits differ by 1.
%C A048411 a(14), if it exists, is > 10^34. - _Lars Blomberg_, Nov 25 2016
%C A048411 Is it true that all terms are palindromes? - _Chai Wah Wu_, Apr 06 2018
%C A048411 a(14), if it exists, is > 10^52. - _Michael S. Branicky_, Apr 22 2025
%F A048411 a(n) = A048412(n)^2.
%t A048411 Select[Range[0, 10^7]^2, Or[# == 0, IntegerLength@ # == 1, Union@ Abs@ Differences@ IntegerDigits@ # == {1}] &] (* _Michael De Vlieger_, Nov 25 2016 *)
%o A048411 (Haskell)
%o A048411 a048411 n = a048411_list !! (n-1)
%o A048411 a048411_list = filter ((== 1) . a010052) a033075_list
%o A048411 -- _Reinhard Zumkeller_, Feb 21 2012
%o A048411 (Python)
%o A048411 from sympy.ntheory.primetest import is_square
%o A048411 def gen(d, s=None):
%o A048411     if d == 0: yield tuple(); return
%o A048411     if s == None:
%o A048411         yield from [(i, ) + g for i in range(1, 10) for g in gen(d-1, s=i)]
%o A048411     else:
%o A048411         if s > 0: yield from [(s-1, ) + g for g in gen(d-1, s=s-1)]
%o A048411         if s < 9: yield from [(s+1, ) + g for g in gen(d-1, s=s+1)]
%o A048411 def afind(maxdigits):
%o A048411     print(0, end=", ")
%o A048411     for d in range(1, maxdigits+1):
%o A048411         for g in gen(d, s=None):
%o A048411             t = int("".join(map(str, g)))
%o A048411             if is_square(t): print(t, end=", ")
%o A048411 afind(17) # _Michael S. Branicky_, Sep 26 2021
%Y A048411 Cf. A002477, A048412.
%Y A048411 Cf. A010052; intersection of A033075 and A000290.
%K A048411 nonn,base,more
%O A048411 1,3
%A A048411 _Patrick De Geest_, Apr 15 1999