OFFSET
1,5
EXAMPLE
For n = 10: The base-2, base-3, base-4 and base-9 representations of 10 are 1010, 0101, 22 and 11, respectively, and these are the only representations that are periodic, so a(10) = 4.
PROG
(PARI) is(n, b) = for (w=1, oo, my (d=digits(n, b^w)); if (#d<=1, return (0), #Set(d)==1, return (1))) \\ after Rémy Sigrist in A321513
a(n) = my(i=0); for(b=2, n-1, if(is(n, b), i++)); i
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Felix Fröhlich, Apr 14 2022
STATUS
approved