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-6 of 6 results.

A345113 a(n) is the palindrome reached after A345112(n) steps under repeated applications of the map x -> A345111(x), starting with n, or 0 if no palindrome is ever reached.

Original entry on oeis.org

2, 4, 6, 8, 11, 33, 55, 77, 99, 11, 22, 33, 44, 55, 66, 77, 88, 99, 323, 22, 33, 44, 55, 66, 77, 88, 99, 323, 121, 33, 44, 55, 66, 77, 88, 99, 323, 121, 683737386, 44, 55, 66, 77, 88, 99, 323, 121, 683737386
Offset: 1

Views

Author

Felix Fröhlich, Jun 09 2021

Keywords

Comments

First differs from A061563 at n = 19.

Examples

			For n = 19: 19 + 91 = 110, 110 + 101 = 211, 211 + 112 = 323 and 323 is a palindrome, so a(19) = 323.
		

Crossrefs

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
    a(n) = my(x=n); while(1, x=x+eva(rot(digits(x))); if(digits(x)==Vecrev(digits(x)), return(x)))
    
  • Python
    def pal(s): return s == s[::-1]
    def rotl(s): return s[1:] + s[0]
    def A345111(n): return n + int(rotl(str(n)))
    def a(n):
        i, iter, seen = 0, n, set()
        while not (iter > n and pal(str(iter))) and iter not in seen:
            seen.add(iter)
            i, iter = i+1, A345111(iter)
        return iter if iter > n and pal(str(iter)) else 0
    print([a(n) for n in range(1, 49)]) # Michael S. Branicky, Jun 09 2021

A357361 Smallest number k such that A345112(k) = n.

Original entry on oeis.org

1, 5, 19, 118, 89, 123, 102, 145, 104, 777, 1133, 1012, 858, 942, 651, 150, 453, 132, 39, 112551, 39782, 23244, 81914, 43810, 40346
Offset: 1

Views

Author

Felix Fröhlich, Sep 25 2022

Keywords

Crossrefs

Cf. A345112.

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
    a345112(n, bound) = my(x=n, i=0); while(1, x=x+eva(rot(digits(x))); i++; if(i > bound, return(-1), if(digits(x)==Vecrev(digits(x)), break))); i
    a(n) = if(n==0, return(0)); for(k=1, oo, if(a345112(k, n)==n, return(k)))

A345110 a(n) is n rotated one place to the left or, equivalently, n with the most significant digit moved to the least significant place, omitting leading zeros.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 21, 31, 41, 51, 61, 71, 81, 91, 2, 12, 22, 32, 42, 52, 62, 72, 82, 92, 3, 13, 23, 33, 43, 53, 63, 73, 83, 93, 4, 14, 24, 34, 44, 54, 64, 74, 84, 94, 5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 6, 16, 26, 36, 46, 56, 66, 76, 86
Offset: 0

Views

Author

Felix Fröhlich, Jun 09 2021

Keywords

Comments

First differs from A004086 at n = 101, since A004086(101) = 101, but a(101) = 11.

Examples

			For n = 123: When 123 is rotated one place to the left the resulting number is 231, so a(123) = 231.
		

Crossrefs

Programs

  • Mathematica
    Array[FromDigits@*RotateLeft@*IntegerDigits,100,0] (* Giorgos Kalogeropoulos, Jun 09 2021 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
    a(n) = eva(rot(digits(n)))
    
  • Python
    def rotl(s): return s[1:] + s[0]
    def a(n): return int(rotl(str(n)))
    print([a(n) for n in range(69)]) # Michael S. Branicky, Jun 09 2021

A345111 a(n) = n + A345110(n).

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 66, 77, 88
Offset: 0

Views

Author

Felix Fröhlich, Jun 09 2021

Keywords

Comments

First differs from both A052008 and A056964 at n = 101.

Examples

			For n = 101: 101 + A345110(101) = 101 + 11 = 112, so a(101) = 112.
		

Crossrefs

Programs

  • Mathematica
    Array[#+FromDigits@RotateLeft@IntegerDigits@#&,100,0] (* Giorgos Kalogeropoulos, Jun 09 2021 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
    a(n) = n + eva(rot(digits(n)))
    
  • Python
    def rotl(s): return s[1:] + s[0]
    def a(n): return n + int(rotl(str(n)))
    print([a(n) for n in range(63)]) # Michael S. Branicky, Jun 09 2021

A345114 Numbers whose trajectories under the map x -> A345111(x) do not reach a palindrome (conjectured).

Original entry on oeis.org

49, 58, 59, 67, 68, 69, 76, 77, 78, 79, 85, 86, 87, 88, 94, 95, 96, 97, 103, 114, 115, 116, 117, 119, 121, 124, 125, 126, 128, 129, 131, 134, 135, 137, 138, 139, 141, 142, 143, 146, 148, 149, 151, 153, 154, 155, 157, 158, 159, 160, 161, 162, 163, 164, 165, 168
Offset: 1

Views

Author

Felix Fröhlich, Jun 09 2021

Keywords

Comments

The trajectories of the given terms do not reach a palindrome in 10000 (10^4) or fewer steps. The trajectory of 49 does not reach a palindrome in 100000 (10^5) or fewer steps.

Crossrefs

Cf. A023108 (analog for the map x -> A056964(x)), A345110, A345111, A345112, A345113, A345115.

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
    a345112(n, bound) = my(x=n, i=0); while(1, x=x+eva(rot(digits(x))); i++; if(digits(x)==Vecrev(digits(x)), break); if(i > bound, return(-1))); i
    is(n) = a345112(n, 10000)==-1
    
  • Python
    def pal(s): return s == s[::-1]
    def rotl(s): return s[1:] + s[0]
    def A345111(n): return n + int(rotl(str(n)))
    def A345112_bd(n, bd=10000):
        i, iter, seen = 0, n, set()
        while not (iter > n and pal(str(iter))) and iter not in seen and i < bd:
            seen.add(iter)
            i, iter = i+1, A345111(iter)
        return i if iter > n and pal(str(iter)) else 0
    def aupto(lim, bd=10000):
        return [n for n in range(1, lim+1) if A345112_bd(n, bd=bd) == 0]
    print(aupto(168, bd=100)) # Michael S. Branicky, Jun 09 2021

A345115 Trajectory of 49 under the map x -> A345111(x).

Original entry on oeis.org

49, 143, 574, 1319, 4510, 9614, 15763, 73394, 107341, 180752, 988273, 1871012, 10581133, 16392464, 80317105, 83488163, 118369801, 302067812, 322745935, 550205288, 1052258173, 1574839904, 7323238945, 10555628402, 16111912423, 77231036654, 149541403201
Offset: 0

Views

Author

Felix Fröhlich, Jun 09 2021

Keywords

Comments

Does the sequence contain a palindrome?
There is no palindrome among the initial 100000 (10^5) terms.

Examples

			49 + 94 = 143, 143 + 431 = 574, 574 + 745 = 1319, 1319 + 3191 = 4510, 4510 + 5104 = 9614, ...
		

Crossrefs

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
    terms(n) = my(x=49); for(i=1, n, print1(x, ", "); x=x+eva(rot(digits(x))))
    terms(50) \\ Print initial 50 terms
    
  • Python
    def pal(s): return s == s[::-1]
    def rotl(s): return s[1:] + s[0]
    def A345111(n): return n + int(rotl(str(n)))
    def aupto(n):
        alst = [49]
        for i in range(n): alst.append(A345111(alst[-1]))
        return alst
    print(aupto(26)) # Michael S. Branicky, Jun 09 2021
Showing 1-6 of 6 results.