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-10 of 25 results. Next

A053632 Irregular triangle read by rows giving coefficients in expansion of Product_{k=1..n} (1 + x^k).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 22 2000

Keywords

Comments

Or, triangle T(n,k) read by rows, giving number of subsets of {1,2,...,n} with sum k. - Roger CUCULIERE (cuculier(AT)imaginet.fr), Nov 19 2000
Row n consists of A000124(n) terms. These are also the successive vectors (their nonzero elements) when one starts with the infinite vector (of zeros) with 1 inserted somewhere and then shifts it one step (right or left) and adds to the original, then shifts the result two steps and adds, three steps and adds, etc. - Antti Karttunen, Feb 13 2002
T(n,k) = number of partitions of k into distinct parts <= n. Triangle of distribution of Wilcoxon's signed rank statistic. - Mitch Harris, Mar 23 2006
T(n,k) = number of binary words of length n in which the sum of the positions of the 0's is k. Example: T(4,5)=2 because we have 0110 (sum of the positions of the 0's is 1+4=5) and 1001 (sum of the positions of the 0's is 2+3=5). - Emeric Deutsch, Jul 23 2006
A fair coin is flipped n times. You receive i dollars for a "success" on the i-th flip, 1<=i<=n. T(n,k)/2^n is the probability that you will receive exactly k dollars. Your expectation is n(n+1)/4 dollars. - Geoffrey Critzer, May 16 2010
From Gus Wiseman, Jan 02 2023: (Start)
With offset 1, also the number of integer compositions of n whose partial sums add up to k for k = n..n(n+1)/2. For example, row n = 6 counts the following compositions:
6 15 24 33 42 51 141 231 321 411 1311 2211 3111 12111 21111 111111
114 123 132 222 312 1131 1221 2121 11121 11211
213 1113 1122 1212 2112 1111
(End)

Examples

			Triangle begins:
  1;
  1, 1;
  1, 1, 1, 1;
  1, 1, 1, 2, 1, 1, 1;
  1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1;
  1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1;
  1, 1, 1, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 4, 4, 4, 3, 2, 2, 1, 1, 1;
  ...
Row n = 4 counts the following binary words, where k = sum of positions of zeros:
  1111  0111  1011  0011  0101  0110  0001  0010  0100  1000  0000
                    1101  1110  1001  1010  1100
Row n = 5 counts the following strict partitions of k with all parts <= n (0 is the empty partition):
  0  1  2  3  4  5  42  43  53  54  532  542  543  5431 5432 54321
           21 31 32 51  52  431 432 541  5321 5421
                 41 321 421 521 531 4321
		

References

  • A. V. Yurkin, New binomial and new view on light theory, (book), 2013, 78 pages, no publisher listed.

Crossrefs

Rows reduced modulo 2 and interpreted as binary numbers: A068052, A068053. Rows converge towards A000009.
Row sums give A000079.
Cf. A285101 (multiplicative encoding of each row), A285103 (number of odd terms on row n), A285105 (number of even terms).
Row lengths are A000124.
A reciprocal version is (A033999, A219977, A291983, A291984, A291985, ...).
A negative version is A231599.
A version for partitions is A358194, reversed partitions A264034.

Programs

  • Maple
    with(gfun,seriestolist); map(op,[seq(seriestolist(series(mul(1+(z^i), i=1..n),z,binomial(n+1,2)+1)), n=0..10)]); # Antti Karttunen, Feb 13 2002
    # second Maple program:
    g:= proc(n) g(n):= `if`(n=0, 1, expand(g(n-1)*(1+x^n))) end:
    T:= n-> seq(coeff(g(n), x, k), k=0..degree(g(n))):
    seq(T(n), n=0..10);  # Alois P. Heinz, Nov 19 2012
  • Mathematica
    Table[CoefficientList[ Series[Product[(1 + t^i), {i, 1, n}], {t, 0, 100}], t], {n, 0, 8}] // Grid (* Geoffrey Critzer, May 16 2010 *)

Formula

From Mitch Harris, Mar 23 2006: (Start)
T(n,k) = T(n-1, k) + T(n-1, k-n), T(0,0)=1, T(0,k) = 0, T(n,k) = 0 if k < 0 or k > (n+1 choose 2).
G.f.: (1+x)*(1+x^2)*...*(1+x^n). (End)
Sum_{k>=0} k * T(n,k) = A001788(n). - Alois P. Heinz, Feb 09 2017
max_{k>=0} T(n,k) = A025591(n). - Alois P. Heinz, Jan 20 2023

A358194 Irregular triangle read by rows where T(n,k) is the number of integer partitions of n with partial sums summing to k, where k ranges from n to n(n+1)/2.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1
Offset: 0

Views

Author

Gus Wiseman, Dec 31 2022

Keywords

Comments

The partial sums of a sequence (a, b, c, ...) are (a, a+b, a+b+c, ...).

Examples

			Triangle begins:
  1
  1
  1 1
  1 0 1 1
  1 0 1 1 0 1 1
  1 0 0 1 1 0 1 1 0 1 1
  1 0 0 1 1 1 1 0 1 1 0 1 1 0 1 1
  1 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 1 1
  1 0 0 0 1 1 1 1 0 1 1 1 2 1 0 1 1 1 1 1 0 1 1 0 1 1 0 1 1
For example, the T(15,59) = 5 partitions are: (8,2,2,2,1), (7,3,3,1,1), (6,5,2,1,1), (4,3,2,2,2,2), (3,3,3,3,2,1).
		

Crossrefs

Row sums are A000041.
The version for compositions is A053632.
Row lengths are A152947.
The version for reversed partitions is A264034.
A048793 = partial sums of reversed standard compositions, sum A029931.
A358134 = partial sums of standard compositions, sum A359042.
A358136 = partial sums of prime indices, sum A318283.
A359361 = partial sums of reversed prime indices, sum A304818.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Total[Accumulate[#]]==k&]],{n,0,8},{k,n,n*(n+1)/2}]

A320387 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are nonincreasing, and first difference <= first part.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 2, 2, 4, 3, 4, 5, 3, 5, 7, 4, 7, 8, 6, 8, 11, 7, 9, 13, 9, 11, 16, 12, 15, 18, 13, 17, 20, 17, 21, 24, 19, 24, 30, 22, 28, 34, 26, 34, 38, 30, 37, 43, 37, 42, 48, 41, 50, 58, 48, 55, 64, 53, 64, 71, 59, 73, 81, 69, 79, 89, 79, 90, 101, 87, 100, 111
Offset: 0

Views

Author

Seiichi Manyama, Oct 12 2018

Keywords

Comments

Partitions are usually written with parts in descending order, but the conditions are easier to check "visually" if written in ascending order.
Generating function of the "second integrals" of partitions: given a partition (p_1, ..., p_s) written in weakly decreasing order, write the sequence B = (b_1, b_2, ..., b_s) = (p_1, p_1 + p_2, ..., p_1 + ... + p_s). The sequence gives the coefficients of the generating function summing q^(b_1 + ... + b_s) over all partitions of all nonnegative integers. - William J. Keith, Apr 23 2022
From Gus Wiseman, Jan 17 2023: (Start)
Equivalently, a(n) is the number of multisets (weakly increasing sequences of positive integers) with weighted sum n. For example, the Heinz numbers of the a(0) = 1 through a(15) = 7 multisets are:
1 2 3 4 7 6 8 10 15 12 16 18 20 26 24 28
5 11 9 17 19 14 21 22 27 41 30 32
13 23 29 31 33 55 39 34
25 35 37 43 45
49 77 47
65
121
These multisets are counted by A264034. The reverse version is A007294. The zero-based version is A359678.
(End)

Examples

			There are a(29) = 15 such partitions of 29:
  01: [29]
  02: [10, 19]
  03: [11, 18]
  04: [12, 17]
  05: [13, 16]
  06: [14, 15]
  07: [5, 10, 14]
  08: [6, 10, 13]
  09: [6, 11, 12]
  10: [7, 10, 12]
  11: [8, 10, 11]
  12: [3, 6, 9, 11]
  13: [5, 7, 8, 9]
  14: [2, 4, 6, 8, 9]
  15: [3, 5, 6, 7, 8]
There are a(30) = 18 such partitions of 30:
  01: [30]
  02: [10, 20]
  03: [11, 19]
  04: [12, 18]
  05: [13, 17]
  06: [14, 16]
  07: [5, 10, 15]
  08: [6, 10, 14]
  09: [6, 11, 13]
  10: [7, 10, 13]
  11: [7, 11, 12]
  12: [8, 10, 12]
  13: [3, 6, 9, 12]
  14: [9, 10, 11]
  15: [4, 7, 9, 10]
  16: [2, 4, 6, 8, 10]
  17: [6, 7, 8, 9]
  18: [4, 5, 6, 7, 8]
		

Crossrefs

Number of appearances of n > 0 in A304818, reverse A318283.
A053632 counts compositions by weighted sum.
A358194 counts partitions by weighted sum, reverse A264034.
Weighted sum of prime indices: A359497, A359676, A359682, A359754, A359755.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ots[y_]:=Sum[i*y[[i]],{i,Length[y]}];
    Table[Length[Select[Range[2^n],ots[prix[#]]==n&]],{n,10}] (* Gus Wiseman, Jan 17 2023 *)
  • PARI
    seq(n)={Vec(sum(k=1, (sqrtint(8*n+1)+1)\2, my(t=binomial(k,2)); x^t/prod(j=1, k-1, 1 - x^(t-binomial(j,2)) + O(x^(n-t+1)))))} \\ Andrew Howroyd, Jan 22 2023
  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary << 0
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0
      }
      cnt
    end
    def A320387(n)
      (0..n).map{|i| f(i)}
    end
    p A320387(50)
    

Formula

G.f.: Sum_{k>=1} x^binomial(k,2)/Product_{j=1..k-1} (1 - x^(binomial(k,2)-binomial(j,2))). - Andrew Howroyd, Jan 22 2023

A359042 Sum of partial sums of the n-th composition in standard order (A066099).

Original entry on oeis.org

0, 1, 2, 3, 3, 5, 4, 6, 4, 7, 6, 9, 5, 8, 7, 10, 5, 9, 8, 12, 7, 11, 10, 14, 6, 10, 9, 13, 8, 12, 11, 15, 6, 11, 10, 15, 9, 14, 13, 18, 8, 13, 12, 17, 11, 16, 15, 20, 7, 12, 11, 16, 10, 15, 14, 19, 9, 14, 13, 18, 12, 17, 16, 21, 7, 13, 12, 18, 11, 17, 16, 22
Offset: 0

Views

Author

Gus Wiseman, Dec 20 2022

Keywords

Comments

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 29th composition in standard order is (1,1,2,1), with partial sums (1,2,4,5), with sum 12, so a(29) = 12.
		

Crossrefs

See link for sequences related to standard compositions.
Each n appears A000009(n) times.
The reverse version is A029931.
Comps counted by this statistic are A053632, ptns A264034, rev ptns A358194.
This is the sum of partial sums of rows of A066099.
The version for Heinz numbers of partitions is A318283, row sums of A358136.
Row sums of A358134.
A011782 counts compositions.
A065120 gives first part of standard compositions, last A001511.
A242628 lists adjusted partial sums, ranked by A253565, row sums A359043.
A358135 gives last minus first of standard compositions.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Total[Accumulate[stc[n]]],{n,0,100}]

A362559 Number of integer partitions of n whose weighted sum is divisible by n.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 3, 3, 5, 4, 5, 7, 8, 11, 14, 14, 18, 25, 28, 26, 42, 47, 52, 73, 77, 100, 118, 122, 158, 188, 219, 266, 313, 367, 412, 489, 578, 698, 809, 914, 1094, 1268, 1472, 1677, 1948, 2305, 2656, 3072, 3527, 4081, 4665, 5342, 6225, 7119, 8150, 9408
Offset: 1

Views

Author

Gus Wiseman, Apr 24 2023

Keywords

Comments

The (one-based) weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} i*y_i. This is also the sum of partial sums of the reverse.
Also the number of n-multisets of positive integers that (1) have integer mean, (2) cover an initial interval, and (3) have weakly decreasing multiplicities.
Conjecture: A partition of n has weighted sum divisible by n iff its reverse has weighted sum divisible by n.

Examples

			The weighted sum of y = (4,2,2,1) is 1*4+2*2+3*2+4*1 = 18, which is a multiple of 9, so y is counted under a(9).
The a(1) = 1 through a(9) = 5 partitions:
  (1)  (2)  (3)    (4)  (5)      (6)     (7)        (8)       (9)
            (111)       (11111)  (222)   (3211)     (3311)    (333)
                                 (3111)  (1111111)  (221111)  (4221)
                                                              (222111)
                                                              (111111111)
		

Crossrefs

For median instead of mean we have A362558.
The complement is counted by A362560.
A000041 counts integer partitions, strict A000009.
A008284/A058398/A327482 count partitions by mean.
A264034 counts partitions by weighted sum.
A304818 = weighted sum of prime indices, row-sums of A359361.
A318283 = weighted sum of reversed prime indices, row-sums of A358136.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], Divisible[Total[Accumulate[Reverse[#]]],n]&]],{n,30}]

A363532 Number of integer partitions of n with weighted alternating sum 0.

Original entry on oeis.org

1, 0, 0, 1, 0, 0, 2, 2, 0, 3, 3, 3, 5, 5, 10, 12, 7, 14, 25, 18, 22, 48, 48, 41, 67, 82, 89, 111, 140, 170, 220, 214, 264, 392, 386, 436, 623, 693, 756, 934, 1102, 1301, 1565, 1697, 2132, 2616, 2727, 3192, 4062, 4550, 5000, 6132, 7197, 8067, 9338, 10750, 12683
Offset: 0

Views

Author

Gus Wiseman, Jun 14 2023

Keywords

Comments

We define the weighted alternating sum of a sequence (y_1,...,y_k) to be Sum_{i=1..k} (-1)^(i-1) * i * y_i.

Examples

			The a(11) = 3 through a(15) = 12 partitions (A = 10):
  (33221)   (84)        (751)       (662)       (A5)
  (44111)   (6222)      (5332)      (4442)      (8322)
  (222221)  (7311)      (6421)      (5531)      (9411)
            (621111)    (532111)    (43331)     (722211)
            (51111111)  (42211111)  (54221)     (831111)
                                    (65111)     (3322221)
                                    (432221)    (3333111)
                                    (443111)    (4422111)
                                    (32222111)  (5511111)
                                    (33311111)  (22222221)
                                                (72111111)
                                                (6111111111)
		

Crossrefs

The unweighted version is A035363.
These partitions have ranks A363621.
The triangle for this rank statistic is A363623, reverse A363622.
The version for compositions is A363626.
A000041 counts integer partitions.
A264034 counts partitions by weighted sum, reverse A358194.
A304818 gives weighted sum of prime indices, reverse A318283.
A316524 gives alternating sum of prime indices, reverse A344616.
A363619 gives weighted alternating sum of prime indices, reverse A363620.
A363624 gives weighted alternating sum of Heinz partition, reverse A363625.

Programs

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

A363626 Number of integer compositions of n with weighted alternating sum 0.

Original entry on oeis.org

1, 0, 0, 1, 1, 0, 2, 5, 7, 8, 14, 38, 64, 87, 174, 373, 649, 1069, 2051, 4091, 7453, 13276, 25260, 48990, 91378, 168890, 321661, 618323, 1169126, 2203649, 4211163, 8085240, 15421171, 29390131, 56382040, 108443047, 208077560, 399310778
Offset: 0

Views

Author

Gus Wiseman, Jun 16 2023

Keywords

Comments

We define the weighted alternating sum of a sequence (y_1,...,y_k) to be Sum_{i=1..k} (-1)^(i-1) * i * y_i.

Examples

			The a(3) = 1 through a(10) = 14 compositions:
  (21)  (121)  .  (42)    (331)     (242)      (63)       (541)
                  (3111)  (1132)    (1331)     (153)      (2143)
                          (2221)    (11132)    (4122)     (3232)
                          (21121)   (12221)    (5211)     (4321)
                          (112111)  (23111)    (13122)    (15112)
                                    (121121)   (14211)    (31231)
                                    (1112111)  (411111)   (42121)
                                               (1311111)  (114112)
                                                          (212122)
                                                          (213211)
                                                          (311221)
                                                          (322111)
                                                          (3111121)
                                                          (21211111)
		

Crossrefs

The unweighted version is A138364, ranks A344619.
The version for partitions is A363532, ranks A363621.
A000041 counts integer partitions.
A264034 counts partitions by weighted sum, reverse A358194.
A304818 gives weighted sum of prime indices, reverse A318283.
A316524 gives alternating sum of prime indices, reverse A344616.
A363619 gives weighted alternating sum of prime indices, reverse A363620.
A363624 gives weighted alternating sum of Heinz partition, reverse A363625.

Programs

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

Extensions

Terms a(22) onward from Max Alekseyev, Sep 05 2023

A222970 Number of 1 X (n+1) 0..1 arrays with every row least squares fitting to a positive-slope straight line and every column least squares fitting to a zero- or positive-slope straight line, with a single point array taken as having zero slope.

Original entry on oeis.org

1, 2, 6, 12, 28, 54, 119, 230, 488, 948, 1979, 3860, 7978, 15624, 32072, 63014, 128746, 253588, 516346, 1019072, 2069590, 4091174, 8291746, 16412668, 33210428, 65808044, 132985161, 263755984, 532421062, 1056789662, 2131312530, 4233176854
Offset: 1

Views

Author

R. H. Hardin, Mar 10 2013

Keywords

Comments

From Gus Wiseman, Jun 16 2023: (Start)
Also appears to be the number of integer compositions of n + 2 with weighted sum greater than reverse-weighted sum, where the weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} i * y_i, and the reverse is Sum_{i=1..k} i * y_{k-i+1}. The a(1) = 1 through a(4) = 12 compositions are:
(21) (31) (32) (42)
(211) (41) (51)
(221) (231)
(311) (312)
(1211) (321)
(2111) (411)
(1311)
(2121)
(2211)
(3111)
(12111)
(21111)
The version for partitions is A144300, strict A111133.
(End)

Examples

			Some solutions for n=3:
  0 1 0 1    0 1 1 1    0 0 1 0    0 0 1 1    0 0 0 1
		

Crossrefs

For >= instead of > we have A222855.
The case of equality is A222955.
Row 1 of A222969.
A053632 counts compositions by weighted sum (or reverse-weighted sum).
A264034 counts partitions by weighted sum, reverse A358194.
A304818 gives weighted sum of prime indices, reverse A318283.

A231429 Number of partitions of 2n into distinct parts < n.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 2, 4, 8, 14, 22, 35, 53, 78, 113, 160, 222, 306, 416, 558, 743, 980, 1281, 1665, 2149, 2755, 3514, 4458, 5626, 7070, 8846, 11020, 13680, 16920, 20852, 25618, 31375, 38309, 46649, 56651, 68616, 82908, 99940, 120192, 144238, 172730, 206425
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 14 2013

Keywords

Comments

From Gus Wiseman, Jun 17 2023: (Start)
Also the number of integer compositions of n with weighted sum 3*n, where the weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} i * y_i. The a(0) = 1 through a(9) = 14 compositions are:
() . . . . (11111) (3111) (3211) (3311) (3411)
(11211) (11311) (4121) (4221)
(12121) (11411) (5112)
(21112) (12221) (11511)
(13112) (12321)
(21131) (13131)
(21212) (13212)
(111122) (21231)
(21312)
(22122)
(31113)
(111141)
(111222)
(112113)
For partitions we have A363527, ranks A363531. For reversed partitions we have A363526, ranks A363530.
(End)

Examples

			a(5) = #{4+3+2+1} = 1;
a(6) = #{5+4+3, 5+4+2+1} = 2;
a(7) = #{6+5+3, 6+5+2+1, 6+4+3+1, 5+4+3+2} = 4;
a(8) = #{7+6+3, 7+6+2+1, 7+6+3, 7+5+3+1, 7+4+3+2, 6+5+4+1, 6+5+3+2, 6+4+3+2+1} = 8;
a(9) = #{8+7+3, 8+7+2+1, 8+6+4, 8+6+3+1, 8+5+4+1, 8+5+3+2, 8+4+3+2+1, 7+6+5, 7+6+4+1, 7+6+3+2, 7+5+4+2, 7+5+3+2+1, 6+5+4+3, 6+5+4+2+1} = 14.
		

Crossrefs

A000041 counts integer partitions, strict A000009.
A053632 counts compositions by weighted sum.
A264034 counts partitions by weighted sum, reverse A358194.
A304818 gives weighted sum of prime indices, reverse A318283.
A320387 counts multisets by weighted sum, zero-based A359678.

Programs

  • Haskell
    a231429 n = p [1..n-1] (2*n) where
       p _  0 = 1
       p [] _ = 0
       p (k:ks) m = if m < k then 0 else p ks (m - k) + p ks m
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], Total[Accumulate[#]]==3n&]],{n,0,15}] (* Gus Wiseman, Jun 17 2023 *)

A363619 Weighted alternating sum of the multiset of prime indices of n.

Original entry on oeis.org

0, 1, 2, -1, 3, -3, 4, 2, -2, -5, 5, 5, 6, -7, -4, -2, 7, 3, 8, 8, -6, -9, 9, -6, -3, -11, 4, 11, 10, 6, 11, 3, -8, -13, -5, -3, 12, -15, -10, -10, 13, 9, 14, 14, 7, -17, 15, 8, -4, 4, -12, 17, 16, -5, -7, -14, -14, -19, 17, -7, 18, -21, 10, -3, -9, 12, 19, 20
Offset: 1

Views

Author

Gus Wiseman, Jun 12 2023

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
We define the weighted alternating sum of a sequence (y_1,...,y_k) to be Sum_{i=1..k} (-1)^(i-1) i * y_i.

Examples

			The prime indices of 300 are {1,1,2,3,3}, with weighted alternating sum 1*1 - 2*1 + 3*2 - 4*3 + 5*3 = 8, so a(300) = 8.
		

Crossrefs

The non-alternating version is A304818, reverse A318283.
The unweighted version is A316524, reverse A344616.
The reverse version is A363620.
The triangle for this rank statistic is A363622, reverse A363623.
For partitions instead of multisets we have A363624, reverse A363625.
A055396 gives minimum prime index, maximum A061395.
A112798 lists prime indices, length A001222, sum A056239.
A264034 counts partitions by weighted sum, reverse A358194.
A320387 counts multisets by weighted sum, zero-based A359678.
A359677 gives zero-based weighted sum of prime indices, reverse A359674.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    altwtsum[y_]:=Sum[(-1)^(k-1)*k*y[[k]],{k,1,Length[y]}];
    Table[altwtsum[prix[n]],{n,100}]
Showing 1-10 of 25 results. Next