OFFSET
0,1
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
FORMULA
EXAMPLE
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.
PROG
(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
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Jun 01 2021
STATUS
approved