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.

A064410 Number of partitions of n with zero crank.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 2, 2, 4, 4, 7, 7, 11, 12, 17, 19, 27, 30, 41, 48, 62, 73, 95, 110, 140, 166, 206, 243, 302, 354, 435, 513, 622, 733, 887, 1039, 1249, 1467, 1750, 2049, 2438, 2847, 3371, 3934, 4634, 5398, 6343, 7367, 8626, 10009, 11677, 13521, 15737, 18184
Offset: 1

Views

Author

Vladeta Jovovic, Sep 29 2001

Keywords

Comments

For a partition p, let l(p) = largest part of p, w(p) = number of 1's in p, m(p) = number of parts of p larger than w(p). The crank of p is given by l(p) if w(p) = 0, otherwise m(p)-w(p).

Examples

			a(10)=4 because there are 4 partitions of 10 with zero crank: 1+1+2+3+3, 1+1+4+4, 1+1+3+5 and 1+9.
From _Gus Wiseman_, Apr 02 2021: (Start)
The a(3) = 1 through a(14) = 11 partitions (A..D = 10..13):
  21  31  41  51  61  71    81    91     A1     B1      C1      D1
                      3311  4311  4411   5411   5511    6511    6611
                                  5311   6311   6411    7411    7511
                                  33211  43211  7311    8311    8411
                                                44211   54211   9311
                                                53211   63211   55211
                                                332211  432211  64211
                                                                73211
                                                                442211
                                                                532211
                                                                3322211
(End)
		

Crossrefs

The version for positive crank is A001522.
Central column of A064391.
The version for nonnegative crank is A064428.
The Heinz numbers of these partitions are A342192.
A003242 counts anti-run compositions.
A224958 counts compositions with alternating parts unequal.
A257989 gives the crank of the partition with Heinz number n.

Programs

  • Mathematica
    nmax = 60; Rest[CoefficientList[Series[x - 1 + Sum[(-1)^k*(x^(k*(k + 1)/2) - x^(k*(k - 1)/2)), {k, 1, nmax}] / Product[1 - x^k, {k, 1, nmax}], {x, 0, nmax}], x]] (* Vaclav Kotesovec, Sep 26 2016 *)
    Flatten[{0, Table[PartitionsP[n] - 2*Sum[(-1)^(j+1)*PartitionsP[n - j*((j+1)/2)], {j, 1, Floor[(Sqrt[8*n + 1] - 1)/2]}], {n, 2, 60}]}] (* Vaclav Kotesovec, Sep 26 2016 *)
    ck[y_]:=With[{w=Count[y,1]},If[w==0,Max@@y,Count[y,_?(#>w&)]-w]];
    Table[Length[Select[IntegerPartitions[n],ck[#]==0&]],{n,0,30}] (* Gus Wiseman, Apr 02 2021 *)
  • Sage
    [[p.crank() for p in Partitions(n)].count(0) for n in (1..20)] # Peter Luschny, Sep 15 2014

Formula

a(n) = A000041(n) - 2*A001522(n). a(n) = A064391(n, 0).
a(n) ~ exp(Pi*sqrt(2*n/3)) * Pi / (3 * 2^(9/2) * n^(3/2)). - Vaclav Kotesovec, May 06 2018
a(n > 1) = A064428(n) - A001522(n), where A001522/A064428 count odd/even-length compositions with alternating parts strictly decreasing. - Gus Wiseman, Apr 02 2021
From Peter Bala, Feb 03 2024: (Start)
For n >= 2, a(n) = A188674(n+1) - A188674(n) (Hopkins and Sellers, Proposition 7).
Equivalently, the g.f. A(x) = (1 - x) * Sum_{n >= 1} x^(n*(n+2)) / Product{k = 1..n} (1 - x^k)^2. (End)

Extensions

More terms from Reiner Martin, Dec 26 2001

A343943 Number of distinct possible alternating sums of permutations of the multiset of prime factors of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 2, 2, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 4, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 1, 3, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 4, 2, 2, 2
Offset: 1

Views

Author

Gus Wiseman, Aug 19 2021

Keywords

Comments

First differs from A096825 at a(525) = 3, A096825(525) = 4.
First differs from A345926 at a(90) = 4, A345926(90) = 3.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. Of course, the alternating sum of prime factors is also the reverse-alternating sum of reversed prime factors.
Also the number of distinct "sums of prime factors" of divisors d|n such that bigomega(d) = bigomega(n)/2 rounded up.

Examples

			The divisors of 525 with 2 prime factors are: 15, 21, 25, 35, with prime factors {3,5}, {3,7}, {5,5}, {5,7}, with distinct sums {8,10,12}, so a(525) = 3.
		

Crossrefs

The half-length submultisets are counted by A114921.
Including all multisets of prime factors gives A305611(n) + 1.
The strict rounded version appears to be counted by A342343.
The version for prime indices instead of prime factors is A345926.
A000005 counts divisors, which add up to A000203.
A001414 adds up prime factors, row sums of A027746.
A056239 adds up prime indices, row sums of A112798.
A071321 gives the alternating sum of prime factors (reverse: A071322).
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A108917 counts knapsack partitions, ranked by A299702.
A276024 and A299701 count positive subset-sums of partitions.
A316524 gives the alternating sum of prime indices (reverse: A344616).
A334968 counts subsequence-sums of standard compositions.

Programs

  • Mathematica
    prifac[n_]:=If[n==1,{},Flatten[ConstantArray@@@FactorInteger[n]]];
    Table[Length[Union[Total/@Subsets[prifac[n],{Ceiling[PrimeOmega[n]/2]}]]],{n,100}]
  • Python
    from sympy import factorint
    from sympy.utilities.iterables import multiset_combinations
    def A343943(n):
        fs = factorint(n)
        return len(set(sum(d) for d in multiset_combinations(fs,(sum(fs.values())+1)//2))) # Chai Wah Wu, Aug 23 2021

A342194 Number of strict compositions of n with equal differences, or strict arithmetic progressions summing to n.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 7, 7, 7, 13, 11, 11, 17, 13, 15, 25, 17, 17, 29, 19, 23, 35, 25, 23, 39, 29, 29, 45, 33, 29, 55, 31, 35, 55, 39, 43, 65, 37, 43, 65, 51, 41, 77, 43, 51, 85, 53, 47, 85, 53, 65, 87, 61, 53, 99, 67, 67, 97, 67, 59, 119, 61, 71, 113, 75, 79, 123, 67, 79, 117
Offset: 0

Views

Author

Gus Wiseman, Apr 02 2021

Keywords

Examples

			The a(1) = 1 through a(9) = 13 compositions:
  (1)  (2)  (3)    (4)    (5)    (6)      (7)    (8)    (9)
            (1,2)  (1,3)  (1,4)  (1,5)    (1,6)  (1,7)  (1,8)
            (2,1)  (3,1)  (2,3)  (2,4)    (2,5)  (2,6)  (2,7)
                          (3,2)  (4,2)    (3,4)  (3,5)  (3,6)
                          (4,1)  (5,1)    (4,3)  (5,3)  (4,5)
                                 (1,2,3)  (5,2)  (6,2)  (5,4)
                                 (3,2,1)  (6,1)  (7,1)  (6,3)
                                                        (7,2)
                                                        (8,1)
                                                        (1,3,5)
                                                        (2,3,4)
                                                        (4,3,2)
                                                        (5,3,1)
		

Crossrefs

Strict compositions in general are counted by A032020.
The unordered version is A049980.
The non-strict version is A175342.
A000203 adds up divisors.
A000726 counts partitions with alternating parts unequal.
A003242 counts anti-run compositions.
A224958 counts compositions with alternating parts unequal.
A342343 counts compositions with alternating parts strictly decreasing.
A342495 counts compositions with constant quotients.
A342527 counts compositions with alternating parts equal.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&],SameQ@@Differences[#]&]],{n,0,30}]

Formula

a(n > 0) = A175342(n) - A000005(n) + 1.
a(n > 0) = 2*A049988(n) - 2*A000005(n) + 1 = 2*A049982(n) + 1.
Showing 1-3 of 3 results.