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.

Showing 1-2 of 2 results.

A048411 Squares whose consecutive digits differ by 1.

Original entry on oeis.org

0, 1, 4, 9, 121, 676, 12321, 1234321, 123454321, 12345654321, 1234567654321, 123456787654321, 12345678987654321
Offset: 1

Views

Author

Patrick De Geest, Apr 15 1999

Keywords

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
a(14), if it exists, is > 10^52. - Michael S. Branicky, Apr 22 2025

Crossrefs

Cf. A010052; intersection of A033075 and A000290.

Programs

  • Haskell
    a048411 n = a048411_list !! (n-1)
    a048411_list = filter ((== 1) . a010052) a033075_list
    -- Reinhard Zumkeller, Feb 21 2012
    
  • Mathematica
    Select[Range[0, 10^7]^2, Or[# == 0, IntegerLength@ # == 1, Union@ Abs@ Differences@ IntegerDigits@ # == {1}] &] (* Michael De Vlieger, Nov 25 2016 *)
  • 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

Formula

a(n) = A048412(n)^2.

A284046 Numbers k, not ending in 0, such that the consecutive digits of k^2 differ by 0 or 1.

Original entry on oeis.org

1, 2, 3, 11, 26, 111, 1111, 11111, 105462, 111111, 460688, 753576, 1111111, 2806538, 3513626, 5858612, 11111111, 23335688, 111111111, 674874474, 8226042716, 2131535935501, 81655720279388
Offset: 1

Views

Author

Giovanni Resta, Mar 19 2017

Keywords

Comments

Equivalently, numbers not ending in 0, whose square belong to A032981.
All members k ending in 1 are generators of infinite numbers of the form k*10^e which satisfy the same property. In a sense, here we list only "primitive" terms, not ending in 0.
a(24) > 10^17, if it exists.

Examples

			81655720279388 belongs to this sequence because the consecutive digits of its square, 6667656654345656676777654544, differ by 0 or 1.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6], Mod[#, 10] > 0 && Max@ Abs@ Differences@ IntegerDigits[ #^2] <= 1 &]
Showing 1-2 of 2 results.