login
A398006
a(n) is the sum of digits in the canonical snowball representation of n.
2
0, 1, 1, 2, 1, 3, 2, 2, 1, 3, 3, 4, 2, 2, 2, 4, 1, 5, 3, 3, 3, 3, 4, 6, 2, 2, 2, 4, 2, 4, 4, 4, 1, 5, 5, 5, 3, 3, 3, 3, 3, 6, 3, 3, 4, 5, 6, 7, 2, 2, 2, 6, 2, 4, 4, 4, 2, 4, 4, 6, 4, 4, 4, 4, 1, 7, 5, 5, 5, 7, 5, 8, 3, 3, 3, 3, 3, 5, 3, 3, 3, 5, 6, 5, 3, 3, 3
OFFSET
0,4
COMMENTS
See A397794 for the definition of the canonical snowball representation of a number.
LINKS
FORMULA
a(2*n) = a(n).
a(n) = 1 iff n is a power of 2.
a(A200748(n)) = n (and this is the first occurrence of n in the sequence).
EXAMPLE
The first terms are:
n a(n) snowball(n)
-- ---- -----------
0 0 0
1 1 1
2 1 10
3 2 11
4 1 100
5 3 21
6 2 110
7 2 101
8 1 1000
9 3 111
10 3 210
11 4 121
12 2 1100
13 2 1001
14 2 1010
15 4 211
16 1 10000
PROG
(PARI) a(n) = { my (b = 2, s = 0, d); while (n, d = n % b; n \= b; s += d; b = 2+d; ); return (s); }
CROSSREFS
KEYWORD
nonn,base,new
AUTHOR
Rémy Sigrist, Jul 17 2026
STATUS
approved