A352671 a(n) is the number of nonnegative numbers k < n such that for any base b >= 2, the sum of digits of n and k in base b are different.
1, 1, 2, 2, 2, 1, 3, 3, 3, 2, 5, 2, 2, 3, 4, 3, 4, 3, 4, 2, 2, 1, 7, 2, 2, 3, 6, 3, 5, 1, 4, 4, 3, 3, 7, 3, 3, 3, 7, 3, 4, 1, 4, 4, 2, 2, 8, 3, 4, 4, 3, 4, 6, 4, 7, 3, 2, 1, 9, 2, 2, 3, 7, 5, 8, 3, 4, 3, 5, 2, 7, 4, 4, 3, 5, 4, 4, 1, 8, 4, 4, 3, 7, 3, 2, 2, 6
Offset: 1
Examples
The first terms, alongside the corresponding k's, are: n a(n) k's -- ---- -------------- 1 1 0 2 1 0 3 2 0, 2 4 2 0, 3 5 2 0, 4 6 1 0 7 3 0, 4, 6 8 3 0, 6, 7 9 3 0, 7, 8 10 2 0, 8 11 5 0, 6, 8, 9, 10 12 2 0, 11
Links
Programs
-
PARI
a(n) = { my (v=0); for (k=0, n-1, my (ok=1); for (b=2, max(2, n+1), if (sumdigits(n,b)==sumdigits(k,b), ok=0; break)); v+=ok); v }
Comments