A065531 Number of palindromes in all base b representations for n, for 2<=b<=n.
1, 0, 1, 1, 2, 1, 2, 2, 2, 3, 1, 2, 2, 2, 3, 3, 3, 3, 1, 3, 4, 2, 2, 4, 2, 4, 3, 4, 2, 3, 3, 3, 3, 3, 2, 5, 2, 3, 2, 5, 2, 4, 2, 3, 4, 4, 1, 5, 2, 4, 4, 5, 1, 4, 4, 4, 4, 2, 2, 6, 2, 3, 5, 4, 5, 4, 3, 4, 2, 4, 2, 6, 3, 3, 3, 3, 2, 6, 1, 7, 3, 4, 2, 6, 5, 3, 2, 5, 2, 5, 4, 5, 4, 2, 2, 6, 2, 5, 4, 7, 2, 4, 1, 6, 6
Offset: 1
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
f = Compile[{{n, Integer}}, Module[{b = 2, c = Floor@ If[ IntegerQ@ Sqrt[n + 1], -1, 0], idn, s = Floor@ Sqrt[n + 1] - 1}, c = c + Count[ Mod[n, Range@ s], 0]; s = s + 2; While[b < s, If[ Reverse[idn = IntegerDigits[n, b]] == idn, c++]; b++]; c]]; f[1] = 1; Array[f, 105] (* _Robert G. Wilson v, May 05 2025 *)
Comments