login
Number of integers b with n > b > 1 such that the base-b representation of n is periodic.
1

%I #5 Apr 14 2022 15:03:14

%S 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,

%T 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,

%U 2,5,1,5,3,3,3,3,2,5,1,6,2,4,1,7,4,3,2

%N Number of integers b with n > b > 1 such that the base-b representation of n is periodic.

%e 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.

%o (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

%o a(n) = my(i=0); for(b=2, n-1, if(is(n, b), i++)); i

%Y Cf. A121016, A242138, A242139, A321513.

%K nonn,base

%O 1,5

%A _Felix Fröhlich_, Apr 14 2022