cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A357621 Half-alternating sum of the n-th composition in standard order.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 1, 4, 4, 4, 2, 4, 2, 0, 0, 5, 5, 5, 3, 5, 3, 1, 1, 5, 3, 1, 1, -1, -1, -1, 1, 6, 6, 6, 4, 6, 4, 2, 2, 6, 4, 2, 2, 0, 0, 0, 2, 6, 4, 2, 2, 0, 0, 0, 2, -2, -2, -2, 0, -2, 0, 2, 2, 7, 7, 7, 5, 7, 5, 3, 3, 7, 5, 3, 3, 1, 1, 1, 3, 7, 5, 3, 3, 1
Offset: 0

Views

Author

Gus Wiseman, Oct 07 2022

Keywords

Comments

We define the half-alternating sum of a sequence (A, B, C, D, E, F, G, ...) to be A + B - C - D + E + F - G - ...
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. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The 358-th composition is (2,1,3,1,2) so a(358) = 2 + 1 - 3 - 1 + 2 = 1.
		

Crossrefs

See link for sequences related to standard compositions.
The reverse version is A357622.
The skew-alternating form is A357623, reverse A357624.
Positions of zeros are A357625, reverse A357626.
The version for prime indices is A357629.
The version for Heinz numbers of partitions is A357633.
A357637 counts partitions by half-alternating sum, skew A357638.
A357641 counts comps w/ half-alt sum 0, partitions A357639, even A357642.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    halfats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[i/2]),{i,Length[f]}];
    Table[halfats[stc[n]],{n,0,100}]

Formula

Positions of first appearances are powers of 2 and even powers of 2 times 7, or A029746 without 7.

A029748 Numbers of the form 2^k times 1, 3 or 7.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 12, 14, 16, 24, 28, 32, 48, 56, 64, 96, 112, 128, 192, 224, 256, 384, 448, 512, 768, 896, 1024, 1536, 1792, 2048, 3072, 3584, 4096, 6144, 7168, 8192, 12288, 14336, 16384, 24576, 28672, 32768, 49152, 57344, 65536, 98304, 114688, 131072
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[-(x^5 + 2 x^4 + 2 x^3 + 3 x^2 + 2 x + 1)/(2 x^3 - 1), {x, 0, 50}], x] (* Vincenzo Librandi, Oct 18 2013 *)
    Sort[Flatten[#{1,3,7}&/@(2^Range[0,20])]] (* Harvey P. Dale, Jan 30 2014 *)

Formula

From Colin Barker, Jul 19 2013: (Start)
a(n) = 2*a(n-3) for n>5.
G.f.: -(x^5+2*x^4+2*x^3+3*x^2+2*x+1) / (2*x^3-1). (End)
Sum_{n>=0} 1/a(n) = 62/21. - Amiram Eldar, Jan 17 2022

Extensions

More terms from Colin Barker, Jul 19 2013

A029749 Numbers of the form 2^k times 1, 5 or 7.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 14, 16, 20, 28, 32, 40, 56, 64, 80, 112, 128, 160, 224, 256, 320, 448, 512, 640, 896, 1024, 1280, 1792, 2048, 2560, 3584, 4096, 5120, 7168, 8192, 10240, 14336, 16384, 20480, 28672, 32768, 40960, 57344, 65536, 81920, 114688, 131072
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[-(3 x^4 + 3 x^3 + 4 x^2 + 2 x + 1) / (2 x^3 - 1), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 20 2013 *)

Formula

From Colin Barker, Jul 19 2013: (Start)
a(n) = 2*a(n-3) for n>4.
G.f.: -(3*x^4 + 3*x^3 + 4*x^2 + 2*x + 1) / (2*x^3 - 1). (End)
Sum_{n>=0} 1/a(n) = 94/35. - Amiram Eldar, Jan 21 2022

Extensions

More terms from Colin Barker, Jul 19 2013
Showing 1-3 of 3 results.