A088323 Number of numbers b>1 such that n is a repunit in base b representation.
0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 2
Examples
a(31)=3: 31 = 2^4+2^3+2^2+2^1+2^0 = 5^2+5^1+5^0 = 30^1+30^0.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 2..10000
- Eric Weisstein's World of Mathematics, Repunit
Programs
-
Haskell
a088323 n = sum $ map (f n) [2 .. n-1] where f x b = if x == 0 then 1 else if d /= 1 then 0 else f x' b where (x',d) = divMod x b -- Reinhard Zumkeller, Jan 22 2014
Extensions
Example corrected by Reinhard Zumkeller, Jan 22 2014
Comments