A332677 a(n) is the number of ways n can be obtained by adding some digit of a number k to k.
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 0, 3, 1, 2, 1, 3, 1, 3, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1, 3, 0, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 3, 0, 3, 1, 3, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1, 3, 1, 2, 1, 3, 0
Offset: 0
Examples
a(102) = 4 because 102 can written as 93+9, 96+6, 101+1, and 102+0.
References
- Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014.
Programs
-
Mathematica
a[n_] := Sum[ Boole[ MemberQ[ IntegerDigits[t] + t, n]], {t, Max[0, n-9], n}]; Array[a, 88, 0]
Comments