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...).

This page as a plain text file.
%I A344888 #18 Jun 02 2021 16:17:47
%S A344888 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,
%T A344888 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,
%U A344888 4,9,3,7,5,8,6,9,9,9,5,9,3,8,9,5,10,2,6
%N A344888 a(n) is the least base k >= 2 where n is an undulating number (i.e., with digits of the form abababab...).
%H A344888 Rémy Sigrist, <a href="/A344888/b344888.txt">Table of n, a(n) for n = 0..10000</a>
%F A344888 a(n) <= A000196(n) + 1 for any n > 0.
%F A344888 a(n) <= 10 for any n in A033619.
%F A344888 a(n) = 2 iff n belongs to A000225 or to A000975.
%e A344888 For n = 49:
%e A344888 - we have:
%e A344888      b  49 in base b  Undulating?
%e A344888      -  ------------  -----------
%e A344888      2        110001  No
%e A344888      3          1211  No
%e A344888      4           301  No
%e A344888      5           144  No
%e A344888      6           121  Yes
%e A344888 - so a(49) = 6.
%o A344888 (PARI) is(n, base=10) = my (d=digits(n, base)); #d<=2 || d[1..#d-2]==d[3..#d]
%o A344888 a(n) = for (b=2, oo, if (is(n, b), return (b)))
%o A344888 (Python)
%o A344888 def A344888(n):
%o A344888     b, m = 2, n
%o A344888     while True:
%o A344888         m, x = divmod(m, b)
%o A344888         m, y = divmod(m, b)
%o A344888         while m > 0:
%o A344888             m, z = divmod(m,b)
%o A344888             if z != x:
%o A344888                 break
%o A344888             if m > 0:
%o A344888                 m, z = divmod(m,b)
%o A344888                 if z != y:
%o A344888                     break
%o A344888             else:
%o A344888                 return b
%o A344888         else:
%o A344888             return b
%o A344888         b += 1
%o A344888         m = n # _Chai Wah Wu_, Jun 02 2021
%Y A344888 Cf. A000196, A000225, A000975, A033619.
%K A344888 nonn,look,base
%O A344888 0,1
%A A344888 _Rémy Sigrist_, Jun 01 2021