[go: up one dir, main page]

login
A353339
Number of integers b with n > b > 1 such that the base-b representation of n is periodic.
1
0, 0, 1, 1, 2, 1, 2, 2, 2, 4, 1, 2, 2, 2, 3, 2, 3, 4, 1, 3, 4, 2, 1, 4, 1, 4, 3, 4, 1, 4, 3, 3, 3, 4, 2, 5, 2, 2, 2, 5, 1, 5, 2, 3, 4, 2, 1, 5, 1, 5, 4, 4, 1, 5, 2, 4, 3, 2, 1, 7, 1, 3, 5, 3, 5, 5, 1, 5, 2, 5, 1, 5, 3, 3, 3, 3, 2, 5, 1, 6, 2, 4, 1, 7, 4, 3, 2
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