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-18 of 18 results.

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}]

A357185 Numbers k such that the k-th composition in standard order has the same length as the absolute value of its alternating sum.

Original entry on oeis.org

0, 1, 9, 12, 19, 22, 28, 34, 40, 69, 74, 84, 97, 104, 132, 135, 141, 144, 153, 177, 195, 198, 204, 216, 225, 240, 265, 271, 274, 283, 286, 292, 307, 310, 316, 321, 328, 355, 358, 364, 376, 386, 400, 451, 454, 460, 472, 496, 520, 523, 526, 533, 538, 544, 553
Offset: 1

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. 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.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The sequence together with the corresponding compositions begins:
    0: ()
    1: (1)
    9: (3,1)
   12: (1,3)
   19: (3,1,1)
   22: (2,1,2)
   28: (1,1,3)
   34: (4,2)
   40: (2,4)
   69: (4,2,1)
   74: (3,2,2)
   84: (2,2,3)
   97: (1,5,1)
  104: (1,2,4)
  132: (5,3)
  135: (5,1,1,1)
  141: (4,1,2,1)
		

Crossrefs

See link for sequences related to standard compositions.
For sum equal to twice alternating sum we have A348614, counted by A262977.
For product equal to sum we have A335404, counted by A335405.
These compositions are counted by A357183.
This is the absolute value version of A357184, counted by A357183.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A032020 counts strict compositions, ranked by A233564.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Select[Range[0,100],Length[stc[#]]==Abs[ats[stc[#]]]&]

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

A357847 Number of integer compositions of n whose length is twice their alternating sum.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 3, 1, 8, 11, 15, 46, 59, 127, 259, 407, 888, 1591, 2925, 5896, 10607, 20582, 39446, 73448, 142691, 269777, 513721, 988638, 1876107, 3600313, 6893509, 13165219, 25288200, 48408011, 92824505, 178248758, 341801149, 656641084, 1261298356
Offset: 0

Views

Author

Gus Wiseman, Oct 16 2022

Keywords

Comments

The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The a(0) = 1 through a(9) = 15 compositions:
  ()  .  .  (21)  .  (32)  (1131)  (43)  (1142)  (54)
                           (2121)        (1241)  (111141)
                           (3111)        (2132)  (112131)
                                         (2231)  (113121)
                                         (3122)  (114111)
                                         (3221)  (211131)
                                         (4112)  (212121)
                                         (4211)  (213111)
                                                 (311121)
                                                 (312111)
                                                 (411111)
		

Crossrefs

The version for partitions is A357709, ranked by A357848.
A011782 counts compositions.
A025047 counts alternating compositions.
A103919 counts partitions by alternating sum, full triangle A344651.
A357136 counts compositions by alternating sum, full triangle A097805.
A357182 counts compositions w/ length = alternating sum, ranked by A357184.
A357189 counts partitions w/ length = alternating sum, ranked by A357486.

Programs

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

Extensions

a(21)-a(38) from Alois P. Heinz, Oct 19 2022

A357709 Number of integer partitions of n whose length is twice their alternating sum.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 2, 2, 4, 3, 6, 6, 9, 11, 13, 18, 21, 28, 32, 44, 49, 65, 76, 96, 114, 141, 170, 204, 250, 295, 361, 425, 516, 606, 734, 858, 1031, 1210, 1440, 1690, 2000, 2347, 2759, 3240, 3786, 4441, 5174, 6053, 7030, 8210, 9509, 11074, 12807, 14870
Offset: 0

Views

Author

Gus Wiseman, Oct 16 2022

Keywords

Comments

The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. The alternating sum of a partition is also the number of odd conjugate parts.

Examples

			The a(1) = 0 through a(12) = 6 partitions:
  .  .  21  .  32  3111  43  3221  54      3331  65      4332
                             4211  411111  4222  422111  4431
                                           4321  521111  5322
                                           5311          5421
                                                         6411
                                                         51111111
		

Crossrefs

This is the "twice" version of A357189, ranked by A357486.
The version for compositions is A357847.
These partitions are ranked by A357848.
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.
A357182 counts compositions w/ length = alternating sum, ranked by A357184.

Programs

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

A357848 Heinz numbers of integer partitions whose length is twice their alternating sum.

Original entry on oeis.org

1, 6, 15, 35, 40, 77, 84, 90, 143, 189, 210, 220, 221, 224, 250, 323, 364, 437, 462, 490, 495, 504, 525, 528, 667, 748, 819, 858, 899, 988, 1029, 1040, 1134, 1147, 1155, 1188, 1210, 1320, 1326, 1375, 1400, 1408, 1517, 1564, 1683, 1690, 1763, 1904, 1938, 2021
Offset: 1

Views

Author

Gus Wiseman, Oct 16 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: {}
     6: {1,2}
    15: {2,3}
    35: {3,4}
    40: {1,1,1,3}
    77: {4,5}
    84: {1,1,2,4}
    90: {1,2,2,3}
   143: {5,6}
   189: {2,2,2,4}
   210: {1,2,3,4}
   220: {1,1,3,5}
   221: {6,7}
   224: {1,1,1,1,1,4}
		

Crossrefs

These partitions are counted by A357709.
The version for compositions is counted by A357847.
A000041 counts partitions, strict A000009.
A003963 multiplies prime indices.
A025047 counts alternating compositions.
A056239 adds up prime indices.
A103919 counts partitions by alternating sum, full triangle A344651.
A357136 counts compositions by alternating sum, full triangle A097805.
A357182 counts compositions w/ length = alternating sum, ranked by A357184.
A357189 counts partitions w/ length = alternating sum, ranked by A357486.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    sats[y_]:=Sum[(-1)^(i-Length[y])*y[[i]],{i,Length[y]}];
    Select[Range[1000],Length[primeMS[#]]==2sats[primeMS[#]]&]
Previous Showing 11-18 of 18 results.