

A209281


Start with first run [0,1] then, for n >= 2, the nth run has length 2^n and is the concatenation of [a(1),a(2),...,a(2^n/2)] and [na(1),na(2),...,na(2^n/2)].


2



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



OFFSET

1,3


LINKS

Table of n, a(n) for n=1..87.


FORMULA

Let T(n)=A010060(n) then for n>=1 a(2n)=a(n)+1T(n1) and a(2n+1)=a(n+1)+T(n).
For n>=2 a(n)=a(ceiling(n/2))+T(n1) hence:
a(n)=sum(k=0..ceiling(log(n1)/log(2)),T(floor((n1)/2^k)))
For k>=0 a(3*2^k+1)=1 (more precisely a(n)=1 iff n is in A103204), a(2^k+1)=k+1, a(5*2^k+1)=2, a(7*2^k+1)=k+2 etc.


EXAMPLE

[0,1] > [0,1] U [20,21] =
[0,1,2,1] > [0,1,2,1] U [30,31,32,31] =
[0,1,2,1,3,2,1,2] etc.


PROG

(PARI)/* compute 2^15 terms */ v=[0, 1]; for(n=2, 15, v=concat(v, vector(2^n/2, i, nv[i])); a(n)=v[n]; )


CROSSREFS

Cf. A010060.
Sequence in context: A261867 A076081 A304089 * A240554 A107338 A118123
Adjacent sequences: A209278 A209279 A209280 * A209282 A209283 A209284


KEYWORD

nonn


AUTHOR

Benoit Cloitre, Jan 16 2013


STATUS

approved



