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.

A344888 a(n) is the least base k >= 2 where n is an undulating number (i.e., with digits of the form abababab...).

Original entry on oeis.org

2, 2, 2, 2, 3, 2, 3, 2, 3, 4, 2, 4, 4, 3, 4, 2, 3, 4, 5, 5, 3, 2, 5, 3, 5, 4, 3, 6, 6, 4, 3, 2, 6, 6, 4, 6, 5, 6, 4, 7, 3, 5, 2, 6, 7, 7, 4, 7, 7, 6, 3, 4, 5, 8, 8, 4, 8, 5, 8, 4, 3, 6, 5, 2, 7, 8, 9, 5, 4, 9, 3, 7, 5, 8, 6, 9, 9, 9, 5, 9, 3, 8, 9, 5, 10, 2, 6
Offset: 0

Views

Author

Rémy Sigrist, Jun 01 2021

Keywords

Examples

			For n = 49:
- we have:
     b  49 in base b  Undulating?
     -  ------------  -----------
     2        110001  No
     3          1211  No
     4           301  No
     5           144  No
     6           121  Yes
- so a(49) = 6.
		

Crossrefs

Programs

  • PARI
    is(n, base=10) = my (d=digits(n, base)); #d<=2 || d[1..#d-2]==d[3..#d]
    a(n) = for (b=2, oo, if (is(n, b), return (b)))
    
  • Python
    def A344888(n):
        b, m = 2, n
        while True:
            m, x = divmod(m, b)
            m, y = divmod(m, b)
            while m > 0:
                m, z = divmod(m,b)
                if z != x:
                    break
                if m > 0:
                    m, z = divmod(m,b)
                    if z != y:
                        break
                else:
                    return b
            else:
                return b
            b += 1
            m = n # Chai Wah Wu, Jun 02 2021

Formula

a(n) <= A000196(n) + 1 for any n > 0.
a(n) <= 10 for any n in A033619.
a(n) = 2 iff n belongs to A000225 or to A000975.