

A329320


a(n) = Sum_{k=0..floor(log_2(n))} 1  A035263(1 + floor(n/2^k)).


2



0, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 3, 1, 2, 2, 2, 2, 3, 2, 3, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 3, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 3, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,6


COMMENTS

Sequence which arise from attempts to simplify computing of A329319.
For all positive integers k, the subsequence a(2^k) to a(3*2^(k1)1) is identical to the subsequence a(3*2^(k1)) to a(2^(k+1)1). Also subsequences a(2^k) to a(3*2^(k1)1) and a(0) to a(2^(k1)1) always differ by 1.


LINKS

Mikhail Kurkov, Table of n, a(n) for n = 0..8191


FORMULA

a(n) = a(floor(n/2)) + 1  A035263(n+1) for n>0 with a(0)=0.
a(2^m+k) = a(k mod 2^(m1)) + 1 for 0<=k<2^m, m>0 with a(0)=0, a(1)=1.


PROG

(PARI) a(n) = if (n==0, 0, a(floor(n/2)) + valuation(n+1, 2) % 2); \\ Michel Marcus, Nov 13 2019


CROSSREFS

Cf. A035263, A329319.
Sequence in context: A322867 A163109 A286574 * A316112 A317994 A128428
Adjacent sequences: A329317 A329318 A329319 * A329321 A329322 A329323


KEYWORD

nonn


AUTHOR

Mikhail Kurkov, Nov 10 2019


STATUS

approved



