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.

Previous Showing 11-20 of 26 results. Next

A357183 Number of integer compositions with the same length as the absolute value of their alternating sum.

Original entry on oeis.org

1, 1, 0, 0, 2, 3, 2, 5, 12, 22, 26, 58, 100, 203, 282, 616, 962, 2045, 2982, 6518, 9858, 21416, 31680, 69623, 104158, 228930, 339978, 751430, 1119668, 2478787, 3684082, 8182469, 12171900, 27082870, 40247978, 89748642, 133394708, 297933185, 442628598, 990210110
Offset: 0

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The a(1) = 1 through a(8) = 12 compositions:
  (1)  (13)  (113)  (24)  (124)  (35)
       (31)  (212)  (42)  (151)  (53)
             (311)        (223)  (1115)
                          (322)  (1151)
                          (421)  (1214)
                                 (1313)
                                 (1412)
                                 (1511)
                                 (2141)
                                 (3131)
                                 (4121)
                                 (5111)
		

Crossrefs

For product instead of length we have A114220.
For sum equal to twice alternating sum we have A262977, ranked by A348614.
For product equal to sum we have A335405, ranked by A335404.
This is the absolute value version of A357182.
These compositions are ranked by A357185.
The case of partitions is A357189.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
A261983 counts non-anti-run compositions.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[#]==Abs[ats[#]]&]],{n,0,15}]

Extensions

a(21)-a(39) from Alois P. Heinz, Sep 29 2022

A357485 Heinz numbers of integer partitions with the same length as reverse-alternating sum.

Original entry on oeis.org

1, 2, 20, 42, 45, 105, 110, 125, 176, 182, 231, 245, 312, 374, 396, 429, 494, 605, 663, 680, 702, 780, 782, 845, 891, 969, 1064, 1088, 1100, 1102, 1311, 1426, 1428, 1445, 1530, 1755, 1805, 1820, 1824, 1950, 2001, 2024, 2146, 2156, 2394, 2448, 2475, 2508, 2542
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2022

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
The reverse-alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^i y_i.

Examples

			The terms together with their prime indices begin:
     1: {}
     2: {1}
    20: {1,1,3}
    42: {1,2,4}
    45: {2,2,3}
   105: {2,3,4}
   110: {1,3,5}
   125: {3,3,3}
   176: {1,1,1,1,5}
   182: {1,4,6}
   231: {2,4,5}
   245: {3,4,4}
   312: {1,1,1,2,6}
   374: {1,5,7}
   396: {1,1,2,2,5}
		

Crossrefs

The version for compositions is A357184, counted by A357182.
These partitions are counted by A357189.
For absolute value we have A357486, counted by A357487.
A000041 counts partitions, strict A000009.
A000712 up to 0's counts partitions w sum = twice alt sum, ranked A349159.
A001055 counts partitions with product equal to sum, ranked by A301987.
A006330 up to 0's counts partitions w sum = twice rev-alt sum, rank A349160.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Select[Range[100],PrimeOmega[#]==ats[primeMS[#]]&]

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

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 08 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 357-th composition is (2,1,3,2,1) so a(357) = 1 + 2 - 3 - 1 + 2 = 1.
		

Crossrefs

See link for sequences related to standard compositions.
This is the reverse version of A357621.
The skew-alternating form is A357624, non-reverse A357623.
Positions of zeros are A357626, reverse A357625.
The version for prime indices is A357629.
The version for Heinz numbers of partitions is A357633.
A124754 gives alternating sum of standard compositions, reverse A344618.
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[Reverse[stc[n]]],{n,0,100}]

A357627 Numbers k such that the k-th composition in standard order has skew-alternating sum 0.

Original entry on oeis.org

0, 3, 10, 11, 15, 36, 37, 38, 43, 45, 54, 55, 58, 59, 63, 136, 137, 138, 140, 147, 149, 153, 166, 167, 170, 171, 175, 178, 179, 183, 190, 191, 204, 205, 206, 212, 213, 214, 219, 221, 228, 229, 230, 235, 237, 246, 247, 250, 251, 255, 528, 529, 530, 532, 536
Offset: 1

Views

Author

Gus Wiseman, Oct 08 2022

Keywords

Comments

We define the skew-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 sequence together with the corresponding compositions begins:
    0: ()
    3: (1,1)
   10: (2,2)
   11: (2,1,1)
   15: (1,1,1,1)
   36: (3,3)
   37: (3,2,1)
   38: (3,1,2)
   43: (2,2,1,1)
   45: (2,1,2,1)
   54: (1,2,1,2)
   55: (1,2,1,1,1)
   58: (1,1,2,2)
   59: (1,1,2,1,1)
   63: (1,1,1,1,1,1)
		

Crossrefs

See link for sequences related to standard compositions.
The alternating form is A344619.
Positions of zeros in A357623.
The half-alternating form is A357625, reverse A357626.
The reverse version is A357628.
The version for prime indices is A357632.
The version for Heinz numbers of partitions is A357636.
A124754 gives alternating sum of standard compositions, reverse A344618.
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;
    skats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[(i+1)/2]),{i,Length[f]}];
    Select[Range[0,100],skats[stc[#]]==0&]

A357628 Numbers k such that the reversed k-th composition in standard order has skew-alternating sum 0.

Original entry on oeis.org

0, 3, 10, 14, 15, 36, 43, 44, 45, 52, 54, 58, 59, 61, 63, 136, 147, 149, 152, 153, 166, 168, 170, 175, 178, 179, 181, 183, 185, 190, 200, 204, 211, 212, 213, 217, 219, 221, 228, 230, 234, 235, 237, 239, 242, 246, 247, 250, 254, 255, 528, 547, 549, 553, 560
Offset: 1

Views

Author

Gus Wiseman, Oct 08 2022

Keywords

Comments

We define the skew-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 sequence together with the corresponding compositions begins:
    0: ()
    3: (1,1)
   10: (2,2)
   14: (1,1,2)
   15: (1,1,1,1)
   36: (3,3)
   43: (2,2,1,1)
   44: (2,1,3)
   45: (2,1,2,1)
   52: (1,2,3)
   54: (1,2,1,2)
   58: (1,1,2,2)
   59: (1,1,2,1,1)
   61: (1,1,1,2,1)
   63: (1,1,1,1,1,1)
		

Crossrefs

See link for sequences related to standard compositions.
The alternating form is A344619.
Positions of zeros are A357624, non-reverse A357623.
The half-alternating form is A357626, non-reverse A357625.
The non-reverse version is A357627.
The version for prime indices is A357632.
The version for Heinz numbers of partitions is A357636.
A124754 gives alternating sum of standard compositions, reverse A344618.
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;
    skats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[(i+1)/2]),{i,Length[f]}];
    Select[Range[0,100],skats[Reverse[stc[#]]]==0&]

A357624 Skew-alternating sum of the reversed n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 08 2022

Keywords

Comments

We define the skew-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 357-th composition is (2,1,3,2,1) so a(357) = 1 - 2 - 3 + 2 + 1 = -1.
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 half-alternating form is A357622, non-reverse A357621.
The reverse version is A357623.
Positions of zeros are A357628, non-reverse A357627.
The version for prime indices is A357630.
The version for Heinz numbers of partitions is A357634.
A124754 gives alternating sum of standard compositions, reverse A344618.
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;
    skats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[(i+1)/2]),{i,Length[f]}];
    Table[skats[Reverse[stc[n]]],{n,0,100}]

A357487 Number of integer partitions of n with the same length as reverse-alternating sum.

Original entry on oeis.org

1, 1, 0, 0, 0, 1, 0, 2, 0, 4, 0, 5, 0, 9, 0, 13, 0, 23, 0, 34, 0, 54, 0, 78, 0, 120, 0, 170, 0, 252, 0, 358, 0, 517, 0, 725, 0, 1030, 0, 1427, 0, 1992, 0, 2733, 0, 3759, 0, 5106, 0, 6946, 0, 9345, 0, 12577, 0, 16788, 0, 22384, 0, 29641, 0
Offset: 0

Views

Author

Gus Wiseman, Oct 01 2022

Keywords

Comments

A partition of n is a weakly decreasing sequence of positive integers summing to n.
The reverse-alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^i y_i.

Examples

			The a(1) = 1 through a(13) = 9 partitions:
  1   .  .  .  311   .  322   .  333     .  443     .  553
                        421      432        542        652
                                 531        641        751
                                 51111      52211      52222
                                            62111      53311
                                                       62221
                                                       63211
                                                       73111
                                                       7111111
		

Crossrefs

For product equal to sum we have A001055, compositions A335405.
The version for compositions is A357182, reverse ranked by A357184.
The reverse version is A357189, ranked by A357486.
These partitions are ranked by A357485.
Removing zeros gives A357488.
A000041 counts partitions, strict A000009.
A025047 counts alternating compositions.
A103919 counts partitions by alternating sum, full triangle A344651.
A357136 counts compositions by alternating sum, full triangle A097805.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[IntegerPartitions[n],Length[#]==ats[Reverse[#]]&]],{n,0,30}]

A357486 Heinz numbers of integer partitions with the same length as alternating sum.

Original entry on oeis.org

1, 2, 10, 20, 21, 42, 45, 55, 88, 91, 105, 110, 125, 156, 176, 182, 187, 198, 231, 245, 247, 312, 340, 351, 374, 390, 391, 396, 429, 494, 532, 544, 550, 551, 605, 663, 680, 702, 713, 714, 765, 780, 782, 845, 891, 910, 912, 969, 975, 1012, 1064, 1073, 1078
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2022

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The terms together with their prime indices begin:
     1: {}
     2: {1}
    10: {1,3}
    20: {1,1,3}
    21: {2,4}
    42: {1,2,4}
    45: {2,2,3}
    55: {3,5}
    88: {1,1,1,5}
    91: {4,6}
   105: {2,3,4}
   110: {1,3,5}
   125: {3,3,3}
   156: {1,1,2,6}
   176: {1,1,1,1,5}
		

Crossrefs

For product instead of length we have new, counted by A004526.
The version for compositions is A357184, counted by A357182.
For absolute value we have A357486, counted by A357487.
These partitions are counted by A357189.
A000041 counts partitions, strict A000009.
A000712 up to 0's counts partitions, sum = twice alt sum, rank A349159.
A001055 counts partitions with product equal to sum, ranked by A301987.
A006330 up to 0's counts partitions, sum = twice rev-alt sum, rank A349160.
A025047 counts alternating compositions.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Select[Range[100],PrimeOmega[#]==ats[Reverse[primeMS[#]]]&]

A177787 Number of paths from (0,0) to (n+2,n) using only up and right steps and avoiding two or more consecutive moves up or three or more consecutive moves right.

Original entry on oeis.org

2, 5, 10, 18, 30, 47, 70, 100, 138, 185, 242, 310, 390, 483, 590, 712, 850, 1005, 1178, 1370, 1582, 1815, 2070, 2348, 2650, 2977, 3330, 3710, 4118, 4555, 5022, 5520, 6050, 6613, 7210, 7842, 8510, 9215, 9958, 10740, 11562, 12425, 13330, 14278, 15270
Offset: 1

Views

Author

Shanzhen Gao, May 13 2010

Keywords

Comments

Strings of length 2n+2 over the alphabet {U, R} with n Rs and avoiding UU or RRR as substrings.
Also number of binary words with 3 1's and n 0's that do not contain the substring 101. a(2) = 5: 00111, 10011, 11001, 11100, 01110. - Alois P. Heinz, Jul 18 2013
Let (b(n)) be the p-INVERT of A010892 using p(S) = 1 - S^2; then b(n) = a(n+1) for n >= 0. See A292301. - Clark Kimberling, Sep 30 2017
From Gus Wiseman, Oct 13 2022: (Start)
Also the number of integer compositions of n+3 with half-alternating sum n-1, where 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 - ... For example, the a(1) = 2 through a(4) = 10 compositions are:
(112) (122) (132)
(1111) (212) (222)
(1211) (312)
(2111) (1311)
(11111) (2211)
(3111)
(11112)
(12111)
(21111)
(111111)
A001700/A138364 = compositions with alternating sum 0, ranked by A344619.
A357621 = half-alternating sum of standard compositions, reverse A357622.
A357641 = compositions with half-alternating sum 0, ranked by A357625.
(End)

Crossrefs

First differences of A227161. - Alois P. Heinz, Jul 18 2013

Programs

  • Magma
    I:=[2, 5, 10, 18]; [n le 4 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..50]]; // Vincenzo Librandi, Jul 04 2012
  • Maple
    a:= n-> n/6*(11+n^2): seq(a(n), n=1..40);
  • Mathematica
    CoefficientList[Series[(2-3*x+2*x^2)/(x-1)^4,{x,0,50}],x] (* Vincenzo Librandi, Jul 04 2012 *)

Formula

a(n) = 1/6 * n (11 + n^2).
From R. J. Mathar, May 22 2010: (Start)
a(n) = A140226(n)/2.
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
G.f.: x*(2-3*x+2*x^2)/(x-1)^4. (End)

Extensions

More terms from R. J. Mathar, May 22 2010

A357710 Number of integer compositions of n with integer geometric mean.

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 4, 8, 4, 15, 17, 22, 48, 40, 130, 88, 287, 323, 543, 1084, 1145, 2938, 3141, 6928, 9770, 15585, 29249, 37540, 78464, 103289, 194265, 299752, 475086, 846933, 1216749, 2261920, 3320935, 5795349, 9292376, 14825858, 25570823, 39030115, 68265801, 106030947, 178696496
Offset: 0

Views

Author

Gus Wiseman, Oct 15 2022

Keywords

Examples

			The a(6) = 4 through a(9) = 15 compositions:
  (6)       (7)        (8)         (9)
  (33)      (124)      (44)        (333)
  (222)     (142)      (2222)      (1224)
  (111111)  (214)      (11111111)  (1242)
            (241)                  (1422)
            (412)                  (2124)
            (421)                  (2142)
            (1111111)              (2214)
                                   (2241)
                                   (2412)
                                   (2421)
                                   (4122)
                                   (4212)
                                   (4221)
                                   (111111111)
		

Crossrefs

The unordered version (partitions) is A067539, ranked by A326623.
Compositions with integer average are A271654, partitions A067538.
Subsets whose geometric mean is an integer are A326027.
The version for factorizations is A326028.
The strict case is A339452, partitions A326625.
These compositions are ranked by A357490.
A011782 counts compositions.

Programs

  • Mathematica
    Table[Length[Select[Join @@ Permutations/@IntegerPartitions[n],IntegerQ[GeometricMean[#]]&]],{n,0,15}]
  • Python
    from math import prod, factorial
    from sympy import integer_nthroot
    from sympy.utilities.iterables import partitions
    def A357710(n): return sum(factorial(s)//prod(factorial(d) for d in p.values()) for s,p in partitions(n,size=True) if integer_nthroot(prod(a**b for a, b in p.items()),s)[1]) if n else 0 # Chai Wah Wu, Sep 24 2023

Extensions

More terms from David A. Corneth, Oct 17 2022
Previous Showing 11-20 of 26 results. Next