login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A209281 Start with first run [0,1] then, for n >= 2, the n-th run has length 2^n and is the concatenation of [a(1),a(2),...,a(2^n/2)] and [n-a(1),n-a(2),...,n-a(2^n/2)]. 15
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

COMMENTS

Also the sum of the odd bisection (odd-indexed parts) of the (n-1)-th composition in standard order, where the k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. Note that this sequence counts {} as composition number 1 (instead of the usual 0). For example, composition number 741 in standard order is (2,1,1,3,2,1), with odd bisection (2,1,2), so a(742) = 2 + 1 + 2 = 5. - Gus Wiseman, Aug 24 2021

LINKS

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

FORMULA

Let T(n)=A010060(n) then for n>=1 a(2n)=a(n)+1-T(n-1) and a(2n+1)=a(n+1)+T(n).

For n>=2 a(n) = a(ceiling(n/2))+T(n-1) hence:

a(n) = Sum_{k=0..ceiling(log(n-1)/log(2))} T(floor((n-1)/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.

From Gus Wiseman, Aug 18 2021: (Start)

a(n + 1) = (A029837(n) + A124754(n))/2.

a(n + 1) = A029837(n) - A346633(n).

a(n + 1) = A346633(n) - A124754(n).

a(n + 1) = A029837(A346702(n)).

(End)

EXAMPLE

[0,1] -> [0,1] U [2-0,2-1] =

[0,1,2,1] -> [0,1,2,1] U [3-0,3-1,3-2,3-1] =

[0,1,2,1,3,2,1,2] etc.

From Gus Wiseman, Aug 08 2021: (Start)

As a triangle without the initial 0, row-lengths A000079:

  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

(End)

MATHEMATICA

Table[Total[First/@Partition[Append[Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse, 0], 2]], {n, 0, 100}] (* Gus Wiseman, Aug 08 2021 *)

PROG

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

CROSSREFS

Cf. A010060.

Row sums are A001792.

Positions of 1's are A003945.

Including even-indexed parts gives A029837.

Subtracting the even-indexed version gives A124754.

The even-indexed version is A346633.

A version for prime indices is A346697 (reverse: A346699).

Also the sum of row A346702(n - 1) of A066099.

A000120 and A080791 count binary digits 1 and 0, with difference A145037.

A011782 counts compositions.

A345197 counts compositions by sum, length, and alternating sum.

Cf. A000346, A008549, A025047, A088218, A097805, A131577, A294175, A346705.

Sequence in context: A261867 A076081 A304089 * A240554 A107338 A118123

Adjacent sequences:  A209278 A209279 A209280 * A209282 A209283 A209284

KEYWORD

nonn,tabf

AUTHOR

Benoit Cloitre, Jan 16 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 24 09:10 EDT 2021. Contains 347630 sequences. (Running on oeis4.)