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 84 results. Next

A344616 Alternating sum of the integer partition with Heinz number n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 03 2021

Keywords

Comments

The alternating sum of a partition (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i, which is equal to the number of odd parts in the conjugate partition.
The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), giving a bijective correspondence between positive integers and integer partitions.
Also the reverse-alternating sum of the prime indices of n.

Examples

			The partition (6,4,3,2,2) has Heinz number 4095 and conjugate (5,5,3,2,1,1), so a(4095) = 5.
		

Crossrefs

Positions of nonzeros are A000037.
Positions of 0's are A000290.
The version for prime factors is A071321 (reverse: A071322).
A version for compositions is A124754.
The version for prime multiplicities is A316523.
The reverse version is A316524, with sign A344617.
A000041 counts partitions of 2n with alternating sum 0.
A056239 adds up prime indices, row sums of A112798.
A103919 counts partitions by sum and alternating sum.
A335433 ranks separable partitions.
A335448 ranks inseparable partitions.
A344606 counts wiggly permutations of prime indices with twins.
A344610 counts partitions by sum and positive reverse-alternating sum.
A344612 counts partitions by sum and reverse-alternating sum.
A344618 gives reverse-alternating sums of standard compositions.

Programs

  • Maple
    a:= n-> (l-> -add(l[i]*(-1)^i, i=1..nops(l)))(sort(map(
        i-> numtheory[pi](i[1])$i[2], ifactors(n)[2]), `>`)):
    seq(a(n), n=1..82);  # Alois P. Heinz, Jun 04 2021
  • 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]}];
    Table[ats[Reverse[primeMS[n]]],{n,100}]

Formula

a(n) = A257991(A122111(n)).
A057427(a(n)) = A049240(n).

A257992 Number of even parts in the partition having Heinz number n.

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, May 18 2015

Keywords

Comments

We define the Heinz number of a partition p = [p_1, p_2, ..., p_r] as Product(p_j-th prime, j=1...r) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). For example, for the partition [1, 1, 2, 4, 10] we get 2*2*3*7*29 = 2436.
In the Maple program the subprogram B yields the partition with Heinz number n.

Examples

			a(18) = 2 because the partition having Heinz number 18 = 2*3*3 is [1,2,2], having 2 even parts.
		

References

  • George E. Andrews and Kimmo Eriksson, Integer Partitions, Cambridge Univ. Press, Cambridge, 2004.
  • Miklós Bóna, A Walk Through Combinatorics, World Scientific Publishing Co., 2002.

Crossrefs

Programs

  • Maple
    with(numtheory): a := proc (n) local B, ct, q: B := proc (n) local nn, j, m: nn := op(2, ifactors(n)): for j to nops(nn) do m[j] := op(j, nn) end do: [seq(seq(pi(op(1, m[i])), q = 1 .. op(2, m[i])), i = 1 .. nops(nn))] end proc: ct := 0: for q to nops(B(n)) do if `mod`(B(n)[q], 2) = 0 then ct := ct+1 else  end if end do: ct end proc: seq(a(n), n = 1 .. 135);
    # second Maple program:
    a:= n-> add(`if`(numtheory[pi](i[1])::even, i[2], 0), i=ifactors(n)[2]):
    seq(a(n), n=1..120);  # Alois P. Heinz, May 09 2016
  • Mathematica
    a[n_] := Sum[If[PrimePi[i[[1]]] // EvenQ, i[[2]], 0], {i, FactorInteger[n]} ]; a[1] = 0; Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Dec 10 2016 after Alois P. Heinz *)

Formula

From Amiram Eldar, Jun 17 2024: (Start)
Totally additive with a(p) = 1 if primepi(p) is even, and 0 otherwise.
a(n) = A257991(n) - A195017(n). (End)

A325698 Numbers with as many even as odd prime indices, counted with multiplicity.

Original entry on oeis.org

1, 6, 14, 15, 26, 33, 35, 36, 38, 51, 58, 65, 69, 74, 77, 84, 86, 90, 93, 95, 106, 119, 122, 123, 141, 142, 143, 145, 156, 158, 161, 177, 178, 185, 196, 198, 201, 202, 209, 210, 214, 215, 216, 217, 219, 221, 225, 226, 228, 249, 262, 265, 278, 287, 291, 299
Offset: 1

Views

Author

Gus Wiseman, May 17 2019

Keywords

Comments

These are Heinz numbers of the integer partitions counted by A045931.
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.
The integers in the multiplicative subgroup of positive rational numbers generated by the products of two consecutive primes (A006094). The sequence is closed under multiplication, prime shift (A003961), and - where the result is an integer - under division. Using these closures, all the terms can be derived from the presence of 6. For example, A003961(6) = 15, A003961(15) = 35, 6 * 35 = 210, 210/15 = 14. Closed also under A297845, since A297845 can be defined using squaring, prime shift and multiplication. - Peter Munn, Oct 05 2020

Examples

			The sequence of terms together with their prime indices begins:
    1: {}
    6: {1,2}
   14: {1,4}
   15: {2,3}
   26: {1,6}
   33: {2,5}
   35: {3,4}
   36: {1,1,2,2}
   38: {1,8}
   51: {2,7}
   58: {1,10}
   65: {3,6}
   69: {2,9}
   74: {1,12}
   77: {4,5}
   84: {1,1,2,4}
   86: {1,14}
   90: {1,2,2,3}
   93: {2,11}
   95: {3,8}
		

Crossrefs

Positions of 0's in A195017.
A257992(n) = A257991(n).
Closed under: A003961, A003991, A297845.
Subsequence of A028260, A332820.

Programs

  • Mathematica
    Select[Range[100],Total[Cases[If[#==1,{},FactorInteger[#]],{p_,k_}:>k*(-1)^PrimePi[p]]]==0&]
  • PARI
    is(n) = {my(v = vector(2), f = factor(n));for(i = 1, #f~,v[1 + primepi(f[i, 1])%2]+=f[i, 2]);v[1] == v[2]} \\ David A. Corneth, Oct 06 2020
    
  • Python
    from sympy import factorint, primepi
    def ok(n):
        v = [0, 0]
        for p, e in factorint(n).items(): v[primepi(p)%2] += e
        return v[0] == v[1]
    print([k for k in range(300) if ok(k)]) # Michael S. Branicky, Apr 16 2022 after David A. Corneth

A045931 Number of partitions of n with equal number of even and odd parts.

Original entry on oeis.org

1, 0, 0, 1, 0, 2, 1, 3, 2, 5, 5, 7, 9, 11, 16, 18, 25, 28, 41, 44, 62, 70, 94, 107, 140, 163, 207, 245, 302, 361, 440, 527, 632, 763, 904, 1090, 1285, 1544, 1812, 2173, 2539, 3031, 3538, 4202, 4896, 5793, 6736, 7934, 9221, 10811, 12549, 14661, 16994, 19780
Offset: 0

Views

Author

Keywords

Comments

The trivariate g.f. with x marking weight (i.e., sum of the parts), t marking number of odd parts and s marking number of even parts, is 1/product((1-tx^(2j-1))(1-sx^(2j)), j=1..infinity). - Emeric Deutsch, Mar 30 2006

Examples

			a(9) = 5 because we have [8,1], [7,2], [6,3], [5,4] and [2,2,2,1,1,1].
From _Gus Wiseman_, Jan 23 2022: (Start)
The a(0) = 1 through a(12) = 9 partitions (A = 10, empty columns indicated by dots):
  ()  .  .  21   .  32   2211   43   3221   54       3322   65       4332
                    41          52   4211   63       4321   74       4431
                                61          72       4411   83       5322
                                            81       5221   92       5421
                                            222111   6211   A1       6321
                                                            322211   6411
                                                            422111   7221
                                                                     8211
                                                                     22221111
(End)
		

Crossrefs

The version for subsets of {1..n} is A001405.
Dominated by A027187 (partitions of even length).
More odd/even parts: A108950/A108949.
More or same number of odd/even parts: A130780/A171966.
The strict case is A239241.
This is column k = 0 of the triangle A240009.
Counting only distinct parts gives A241638, ranked by A325700.
A half-conjugate version is A277579.
These partitions are ranked by A325698.
A000041 counts integer partitions, strict A000009.
A047993 counts balanced partitions, ranked by A106529.
A257991/A257992 count odd/even parts by Heinz number.

Programs

  • Maple
    g:=1/product((1-t*x^(2*j-1))*(1-s*x^(2*j)),j=1..30): gser:=simplify(series(g,x=0,56)): P[0]:=1: for n from 1 to 53 do P[n]:=subs(s=1/t,coeff(gser,x^n)) od: seq(coeff(t*P[n],t),n=0..53); # Emeric Deutsch, Mar 30 2006
  • Mathematica
    p[n_] := p[n] = Select[IntegerPartitions[n], Count[#, ?OddQ] == Count[#, ?EvenQ] &]; t = Table[p[n], {n, 0, 10}] (* partitions of n with # odd parts = # even parts *)
    TableForm[t] (* partitions, vertical format *)
    Table[Length[p[n]], {n, 0, 30}] (* A045931 *)
    (* Peter J. C. Moses, Mar 10 2014 *)
    nmax = 100; CoefficientList[Series[Sum[x^(3*k) / Product[(1 - x^(2*j))^2, {j, 1, k}], {k, 0, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Jun 15 2025 *)

Formula

G.f.: Sum_{k>=0} x^(3*k)/Product_{i=1..k} (1-x^(2*i))^2. - Vladeta Jovovic, Aug 18 2007
a(n) = A000041(n)-A171967(n) = A130780(n)-A108950(n) = A171966(n)-A108949(n). - Reinhard Zumkeller, Jan 21 2010
a(n) = A000041(n) - A108950(n) - A108949(n) = A130780(n) + A171966(n) - A000041(n). - Gus Wiseman, Jan 23 2022
a(n) ~ Pi * exp(Pi*sqrt(2*n/3)) / (48*n^(3/2)). - Vaclav Kotesovec, Jun 15 2025

A195017 If n = Product_{k >= 1} (p_k)^(c_k) where p_k is k-th prime and c_k >= 0 then a(n) = Sum_{k >= 1} c_k*((-1)^(k-1)).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Feb 06 2012

Keywords

Comments

Let p(n,x) be the completely additive polynomial-valued function such that p(1,x) = 0 and p(prime(n),x) = x^(n-1), like is defined in A206284 (although here we are not limited to just irreducible polynomials). Then a(n) is the value of the polynomial encoded in such a manner by n, when it is evaluated at x=-1. - The original definition rewritten and clarified by Antti Karttunen, Oct 03 2018
Positions of 0 give the values of n for which the polynomial p(n,x) is divisible by x+1. For related sequences, see the Mathematica section.
Also the number of odd prime indices of n minus the number of even prime indices of n (both counted with multiplicity), where 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. - Gus Wiseman, Oct 24 2023

Examples

			The sequence can be read from a list of the polynomials:
  p(n,x)      with x = -1, gives a(n)
------------------------------------------
  p(1,x) = 0           0
  p(2,x) = 1x^0        1
  p(3,x) = x          -1
  p(4,x) = 2x^0        2
  p(5,x) = x^2         1
  p(6,x) = 1+x         0
  p(7,x) = x^3        -1
  p(8,x) = 3x^0        3
  p(9,x) = 2x         -2
  p(10,x) = x^2 + 1    2.
(The list runs through all the polynomials whose coefficients are nonnegative integers.)
		

Crossrefs

For other evaluation functions of such encoded polynomials, see A001222, A048675, A056239, A090880, A248663.
Zeros are A325698, distinct A325700.
For sum instead of count we have A366749 = A366531 - A366528.
A000009 counts partitions into odd parts, ranked by A066208.
A035363 counts partitions into even parts, ranked by A066207.
A112798 lists prime indices, reverse A296150, sum A056239.
A257991 counts odd prime indices, even A257992.
A300061 lists numbers with even sum of prime indices, odd A300063.

Programs

  • Mathematica
    b[n_] := Table[x^k, {k, 0, n}];
    f[n_] := f[n] = FactorInteger[n]; z = 200;
    t[n_, m_, k_] := If[PrimeQ[f[n][[m, 1]]] && f[n][[m, 1]]
    == Prime[k], f[n][[m, 2]], 0];
    u = Table[Apply[Plus,
        Table[Table[t[n, m, k], {k, 1, PrimePi[n]}], {m, 1,
          Length[f[n]]}]], {n, 1, z}];
    p[n_, x_] := u[[n]].b[-1 + Length[u[[n]]]]
    Table[p[n, x] /. x -> 0, {n, 1, z/2}]   (* A007814 *)
    Table[p[2 n, x] /. x -> 0, {n, 1, z/2}] (* A001511 *)
    Table[p[n, x] /. x -> 1, {n, 1, z}]     (* A001222 *)
    Table[p[n, x] /. x -> 2, {n, 1, z}]     (* A048675 *)
    Table[p[n, x] /. x -> 3, {n, 1, z}]     (* A090880 *)
    Table[p[n, x] /. x -> -1, {n, 1, z}]    (* A195017 *)
    z = 100; Sum[-(-1)^k IntegerExponent[Range[z], Prime[k]], {k, 1, PrimePi[z]}] (* Friedjof Tellkamp, Aug 05 2024 *)
  • PARI
    A195017(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i,2] * (-1)^(1+primepi(f[i,1])))); } \\ Antti Karttunen, Oct 03 2018

Formula

Totally additive with a(p^e) = e * (-1)^(1+PrimePi(p)), where PrimePi(n) = A000720(n). - Antti Karttunen, Oct 03 2018
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{p prime} = (-1)^(primepi(p)+1)/(p-1) = Sum_{k>=1} (-1)^(k+1)/A006093(k) = A078437 + Sum_{k>=1} (-1)^(k+1)/A036689(k) = 0.6339266524059... . - Amiram Eldar, Sep 29 2023
a(n) = A257991(n) - A257992(n). - Gus Wiseman, Oct 24 2023
a(n) = -Sum_{k=1..pi(n)} (-1)^k * valuation(n, prime(k)). - Friedjof Tellkamp, Aug 05 2024

Extensions

More terms, name changed and example-section edited by Antti Karttunen, Oct 03 2018

A087897 Number of partitions of n into odd parts greater than 1.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 5, 6, 8, 8, 10, 12, 13, 15, 18, 20, 23, 27, 30, 34, 40, 44, 50, 58, 64, 73, 83, 92, 104, 118, 131, 147, 166, 184, 206, 232, 256, 286, 320, 354, 394, 439, 485, 538, 598, 660, 730, 809, 891, 984, 1088, 1196, 1318, 1454, 1596, 1756
Offset: 0

Views

Author

N. J. A. Sloane, Dec 04 2003

Keywords

Comments

Also number of partitions of n into distinct parts which are not powers of 2.
Also number of partitions of n into distinct parts such that the two largest parts differ by 1.
Also number of partitions of n such that the largest part occurs an odd number of times that is at least 3 and every other part occurs an even number of times. Example: a(10) = 2 because we have [2,2,2,1,1,1,1] and [2,2,2,2,2]. - Emeric Deutsch, Mar 30 2006
Also difference between number of partitions of 1+n into distinct parts and number of partitions of n into distinct parts. - Philippe LALLOUET, May 08 2007
In the Berndt reference replace {a -> -x, q -> x} in equation (3.1) to get f(x). G.f. is 1 - x * (1 - f(x)).
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Also number of symmetric unimodal compositions of n+3 where the maximal part appears three times. - Joerg Arndt, Jun 11 2013
Let c(n) = number of palindromic partitions of n whose greatest part has multiplicity 3; then c(n) = a(n-3) for n>=3. - Clark Kimberling, Mar 05 2014
From Gus Wiseman, Aug 22 2021: (Start)
Also the number of integer partitions of n - 1 whose parts cover an interval of positive integers starting with 2. These partitions are ranked by A339886. For example, the a(6) = 1 through a(16) = 5 partitions are:
32 222 322 332 432 3322 3332 4332 4432 5432 43332
2222 3222 22222 4322 33222 33322 33332 44322
32222 222222 43222 43322 333222
322222 332222 432222
2222222 3222222
(End)

Examples

			1 + x^3 + x^5 + x^6 + x^7 + x^8 + 2*x^9 + 2*x^10 + 2*x^11 + 3*x^12 + 3*x^13 + ...
q + q^73 + q^121 + q^145 + q^169 + q^193 + 2*q^217 + 2*q^241 + 2*q^265 + ...
a(10)=2 because we have [7,3] and [5,5].
From _Joerg Arndt_, Jun 11 2013: (Start)
There are a(22)=13 symmetric unimodal compositions of 22+3=25 where the maximal part appears three times:
01:  [ 1 1 1 1 1 1 1 1 3 3 3 1 1 1 1 1 1 1 1 ]
02:  [ 1 1 1 1 1 1 2 3 3 3 2 1 1 1 1 1 1 ]
03:  [ 1 1 1 1 1 5 5 5 1 1 1 1 1 ]
04:  [ 1 1 1 1 2 2 3 3 3 2 2 1 1 1 1 ]
05:  [ 1 1 1 2 5 5 5 2 1 1 1 ]
06:  [ 1 1 2 2 2 3 3 3 2 2 2 1 1 ]
07:  [ 1 1 3 5 5 5 3 1 1 ]
08:  [ 1 1 7 7 7 1 1 ]
09:  [ 1 2 2 5 5 5 2 2 1 ]
10:  [ 1 4 5 5 5 4 1 ]
11:  [ 2 2 2 2 3 3 3 2 2 2 2 ]
12:  [ 2 3 5 5 5 3 2 ]
13:  [ 2 7 7 7 2 ]
(End)
From _Gus Wiseman_, Feb 16 2021: (Start)
The a(7) = 1 through a(19) = 8 partitions are the following (A..J = 10..19). The Heinz numbers of these partitions are given by A341449.
  7  53  9    55  B    75    D    77    F      97    H      99      J
         333  73  533  93    553  95    555    B5    755    B7      775
                       3333  733  B3    753    D3    773    D5      955
                                  5333  933    5533  953    F3      973
                                        33333  7333  B33    5553    B53
                                                     53333  7533    D33
                                                            9333    55333
                                                            333333  73333
(End)
		

References

  • J. W. L. Glaisher, Identities, Messenger of Mathematics, 5 (1876), pp. 111-112. see Eq. I

Crossrefs

The ordered version is A000931.
Partitions with no ones are counted by A002865, ranked by A005408.
The even version is A035363, ranked by A066207.
The version for factorizations is A340101.
Partitions whose only even part is the smallest are counted by A341447.
The Heinz numbers of these partitions are given by A341449.
A000009 counts partitions into odd parts, ranked by A066208.
A025147 counts strict partitions with no 1's.
A025148 counts strict partitions with no 1's or 2's.
A026804 counts partitions whose smallest part is odd, ranked by A340932.
A027187 counts partitions with even length/maximum, ranks A028260/A244990.
A027193 counts partitions with odd length/maximum, ranks A026424/A244991.
A058695 counts partitions of odd numbers, ranked by A300063.
A058696 counts partitions of even numbers, ranked by A300061.
A340385 counts partitions with odd length and maximum, ranked by A340386.

Programs

  • Haskell
    a087897 = p [3,5..] where
       p [] _ = 0
       p _  0 = 1
       p ks'@(k:ks) m | m < k     = 0
                      | otherwise = p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Aug 12 2011
    
  • Maple
    To get 128 terms: t4 := mul((1+x^(2^n)),n=0..7); t5 := mul((1+x^k),k=1..128): t6 := series(t5/t4,x,100); t7 := seriestolist(t6);
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n=0, 1,
          `if`(i<3, 0, b(n, i-2)+`if`(i>n, 0, b(n-i, i))))
        end:
    a:= n-> b(n, n-1+irem(n, 2)):
    seq(a(n), n=0..80);  # Alois P. Heinz, Jun 11 2013
  • Mathematica
    max = 65; f[x_] := Product[ 1/(1 - x^(2k+1)), {k, 1, max}]; CoefficientList[ Series[f[x], {x, 0, max}], x] (* Jean-François Alcover, Dec 16 2011, after Emeric Deutsch *)
    b[n_, i_] := b[n, i] = If[n==0, 1, If[i<3, 0, b[n, i-2]+If[i>n, 0, b[n-i, i]]] ]; a[n_] := b[n, n-1+Mod[n, 2]]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Apr 01 2015, after Alois P. Heinz *)
    Flatten[{1, Table[PartitionsQ[n+1] - PartitionsQ[n], {n, 0, 80}]}] (* Vaclav Kotesovec, Dec 01 2015 *)
    Table[Length[Select[IntegerPartitions[n],FreeQ[#,1]&&OddQ[Times@@#]&]],{n,0,30}] (* Gus Wiseman, Feb 16 2021 *)
  • PARI
    {a(n) = local(A); if( n<0, 0, A = x * O(x^n); polcoeff( (1 - x) * eta(x^2 + A) / eta(x + A), n))} /* Michael Somos, Nov 13 2011 */
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A087897_T(n,k):
        if n==0: return 1
        if k<3 or n<0: return 0
        return A087897_T(n,k-2)+A087897_T(n-k,k)
    def A087897(n): return A087897_T(n,n-(n&1^1)) # Chai Wah Wu, Sep 23 2023, after Alois P. Heinz

Formula

Expansion of q^(-1/24) * (1 - q) * eta(q^2) / eta(q) in powers of q.
Expansion of (1 - x) / chi(-x) in powers of x where chi() is a Ramanujan theta function.
G.f.: 1 + x^3 + x^5*(1 + x) + x^7*(1 + x)*(1 + x^2) + x^9*(1 + x)*(1 + x^2)*(1 + x^3) + ... [Glaisher 1876]. - Michael Somos, Jun 20 2012
G.f.: Product_{k >= 1} 1/(1-x^(2*k+1)).
G.f.: Product_{k >= 1, k not a power of 2} (1+x^k).
G.f.: Sum_{k >= 1} x^(3*k)/Product_{j = 1..k} (1 - x^(2*j)). - Emeric Deutsch, Mar 30 2006
a(n) ~ exp(Pi*sqrt(n/3)) * Pi / (8 * 3^(3/4) * n^(5/4)) * (1 - (15*sqrt(3)/(8*Pi) + 11*Pi/(48*sqrt(3)))/sqrt(n) + (169*Pi^2/13824 + 385/384 + 315/(128*Pi^2))/n). - Vaclav Kotesovec, Aug 30 2015, extended Nov 04 2016
G.f.: 1/(1 - x^3) * Sum_{n >= 0} x^(5*n)/Product_{k = 1..n} (1 - x^(2*k)) = 1/((1 - x^3)*(1 - x^5)) * Sum_{n >= 0} x^(7*n)/Product_{k = 1..n} (1 - x^(2*k)) = ..., extending Deutsch's result dated Mar 30 2006. - Peter Bala, Jan 15 2021
G.f.: Sum_{n >= 0} x^(n*(2*n+1))/Product_{k = 2..2*n+1} (1 - x^k). (Set z = x^3 and q = x^2 in Mc Laughlin et al., Section 1.3, Entry 7.) - Peter Bala, Feb 02 2021
a(2*n+1) = Sum{j>=1} A008284(n+1-j,2*j - 1) and a(2*n) = Sum{j>=1} A008284(n-j, 2*j). - Gregory L. Simay, Sep 22 2023

A086543 Number of partitions of n with at least one odd part.

Original entry on oeis.org

0, 1, 1, 3, 3, 7, 8, 15, 17, 30, 35, 56, 66, 101, 120, 176, 209, 297, 355, 490, 585, 792, 946, 1255, 1498, 1958, 2335, 3010, 3583, 4565, 5428, 6842, 8118, 10143, 12013, 14883, 17592, 21637, 25525, 31185, 36711, 44583, 52382, 63261, 74173, 89134, 104303, 124754, 145698, 173525, 202268
Offset: 0

Views

Author

Vladeta Jovovic, Sep 10 2003

Keywords

Comments

From Gus Wiseman, Oct 12 2023: (Start)
Also the number of integer partitions of n whose greatest part is not n/2, ranked by A366319. The a(1) = 1 through a(7) = 15 partitions are:
(1) (2) (3) (4) (5) (6) (7)
(21) (31) (32) (42) (43)
(111) (1111) (41) (51) (52)
(221) (222) (61)
(311) (411) (322)
(2111) (2211) (331)
(11111) (21111) (421)
(111111) (511)
(2221)
(3211)
(4111)
(22111)
(31111)
(211111)
(1111111)
Compare to the a(1) = 1 through a(7) = 15 partitions with at least one odd part, ranked by A366322:
(1) (11) (3) (31) (5) (33) (7)
(21) (211) (32) (51) (43)
(111) (1111) (41) (321) (52)
(221) (411) (61)
(311) (2211) (322)
(2111) (3111) (331)
(11111) (21111) (421)
(111111) (511)
(2221)
(3211)
(4111)
(22111)
(31111)
(211111)
(1111111)
(End)

Examples

			a(4)=3 because we have [3,1],[2,1,1] and [1,1,1] ([4] and [2,2] do not qualify).
		

Crossrefs

The complement is counted by A035363, ranks A344415.
These partitions have ranks A366322.
A025065 counts partitions with sum <= twice length, ranks A344296.
A110618 counts partitions with sum >= twice maximum, ranks A344291.

Programs

  • Maple
    g:=sum(x^(2*k-1)/product(1-x^j,j=1..2*k-1)/product(1-x^(2*j),j=k..70),k=1..70): gser:=series(g,x=0,50): seq(coeff(gser,x,n),n=0..45); # Emeric Deutsch, Mar 30 2006
  • Mathematica
    nn=50;CoefficientList[Series[Sum[x^(2k-1)/Product[1-x^j,{j,1,2k-1}] /Product[(1-x^(2j)),{j,k,nn}],{k,1,nn}],{x,0,nn}],x] (* Geoffrey Critzer, Sep 28 2013 *)
    Table[Length[Select[IntegerPartitions[n],Max[#]!=n/2&]],{n,0,30}] (* Gus Wiseman, Oct 12 2023 *)
  • PARI
    x='x+O('x^66); concat([0], Vec(1/eta(x)-1/eta(x^2)) ) \\ Joerg Arndt, May 04 2013

Formula

A000041(n) if n is odd; otherwise, A000041(n) - A000041(n/2).
G.f.: Sum_{k>=1} x^(2k-1)/((Product_{j=1..2k-1} (1-x^j))*(Product_{j>=k} (1-x^(2j)))). - Emeric Deutsch, Mar 30 2006
G.f.: 1/E(x) - 1/E(x^2) where E(x) = prod(n>=1, 1-x^n ); see Pari code. - Joerg Arndt, May 04 2013

A277579 Number of partitions of n for which the number of even parts is equal to the positive alternating sum of the parts.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 3, 3, 4, 6, 7, 9, 13, 15, 19, 25, 31, 38, 48, 59, 74, 90, 111, 136, 166, 201, 246, 297, 357, 431, 522, 621, 745, 892, 1063, 1263, 1503, 1780, 2109, 2491, 2941, 3463, 4077, 4783, 5616, 6576, 7689, 8981, 10486, 12207, 14209, 16516, 19178, 22231
Offset: 0

Views

Author

Emeric Deutsch and Alois P. Heinz, Oct 20 2016

Keywords

Comments

In the first Maple program (improvable) AS gives the positive alternating sum of a finite sequence s, EP gives the number of even terms of a finite sequence of positive integers.
For the specified value of n, the second Maple program lists the partitions of n counted by a(n).
Also the number of integer partitions of n with as many even parts as odd parts in the conjugate partition. - Gus Wiseman, Jul 26 2021

Examples

			a(9) = 6: [2,1,1,1,1,1,1,1], [3,2,1,1,1,1], [3,3,2,1], [4,2,2,1], [4,3,1,1], [5,4].
a(10) = 7: [1,1,1,1,1,1,1,1,1,1], [3,2,2,1,1,1], [3,3,1,1,1,1], [4,2,1,1,1,1], [4,3,2,1], [5,5], [6,4].
a(11) = 9: [2,1,1,1,1,1,1,1,1,1], [3,2,1,1,1,1,1,1], [3,3,2,1,1,1], [3,3,3,2], [4,2,2,1,1,1], [4,3,1,1,1,1], [5,2,2,2], [5,4,1,1], [6,5].
		

Crossrefs

The sign-sensitive version is A035457 (aerated version of A000009).
Comparing odd parts to odd conjugate parts gives A277103.
Comparing product of parts to product of conjugate parts gives A325039.
Comparing the rev-alt sum to that of the conjugate gives A345196.
A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A120452 counts partitions of 2n with rev-alt sum 2 (negative: A344741).
A124754 gives alternating sums of standard compositions (reverse: A344618).
A316524 is the alternating sum of the prime indices of n (reverse: A344616).
A344610 counts partitions by sum and positive reverse-alternating sum.
A344611 counts partitions of 2n with reverse-alternating sum >= 0.

Programs

  • Maple
    with(combinat): AS := proc (s) options operator, arrow: abs(add((-1)^(i-1)*s[i], i = 1 .. nops(s))) end proc: EP := proc (s) local ct, j: ct := 0: for j to nops(s) do if `mod`(s[j], 2) = 0 then ct := ct+1 else  end if end do: ct end proc: a := proc (n) local P, c, k: P := partition(n): c := 0: for k to nops(P) do if AS(P[k]) = EP(P[k]) then c := c+1 else  end if end do: c end proc: seq(a(n), n = 0 .. 30);
    n := 8: with(combinat): AS := proc (s) options operator, arrow: abs(add((-1)^(i-1)*s[i], i = 1 .. nops(s))) end proc: EP := proc (s) local ct, j: ct := 0: for j to nops(s) do if `mod`(s[j], 2) = 0 then ct := ct+1 else  end if end do: ct end proc: P := partition(n): C := {}: for k to nops(P) do if AS(P[k]) = EP(P[k]) then C := `union`(C, {P[k]}) else  end if end do: C;
    # alternative Maple program:
    b:= proc(n, i, s, t) option remember; `if`(n=0,
          `if`(s=0, 1, 0), `if`(i<1, 0, b(n, i-1, s, t)+
          `if`(i>n, 0, b(n-i, i, s+t*i-irem(i+1, 2), -t))))
        end:
    a:= n-> b(n$2, 0, 1):
    seq(a(n), n=0..60);
  • Mathematica
    b[n_, i_, s_, t_] := b[n, i, s, t] = If[n == 0, If[s == 0, 1, 0], If[i<1, 0, b[n, i-1, s, t] + If[i>n, 0, b[n-i, i, s + t*i - Mod[i+1, 2], -t]]]]; a[n_] := b[n, n, 0, 1]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Dec 21 2016, translated from Maple *)
    conj[y_]:=If[Length[y]==0,y,Table[Length[Select[y,#>=k&]],{k,1,Max[y]}]]; Table[Length[Select[IntegerPartitions[n],Count[#,?EvenQ]==Count[conj[#],?OddQ]&]],{n,0,15}] (* Gus Wiseman, Jul 26 2021 *)
  • Sage
    def a(n):
        AS = lambda s: abs(sum((-1)^i*t for i,t in enumerate(s)))
        EP = lambda s: sum((t+1)%2 for t in s)
        return sum(AS(p) == EP(p) for p in Partitions(n))
    print([a(n) for n in (0..30)]) # Peter Luschny, Oct 21 2016

A277103 Number of partitions of n for which the number of odd parts is equal to the positive alternating sum of the parts.

Original entry on oeis.org

1, 1, 0, 1, 3, 3, 1, 3, 10, 10, 4, 10, 27, 27, 13, 28, 69, 69, 37, 72, 161, 162, 96, 171, 361, 364, 230, 388, 768, 777, 522, 836, 1581, 1605, 1128, 1739, 3145, 3203, 2345, 3495, 6094, 6225, 4712, 6831, 11511, 11794, 9198, 13010, 21293, 21875, 17496, 24239
Offset: 0

Views

Author

Emeric Deutsch, Oct 18 2016

Keywords

Comments

It follows by conjugation that the partition statistics "alternating sum" and "number of odd parts" are equidistributed. Consequently, the self-conjugate partitions satisfy the required condition.
In the first Maple program (improvable) AS gives the positive alternating sum of a finite sequence s, OP gives the number of odd terms of a finite sequence of positive integers.
For the specified value of n, the second Maple program lists the partitions of n counted by a(n).
Number of integer partitions of n with the same number of odd parts as their conjugate. - Gus Wiseman, Jun 27 2021

Examples

			a(3) = 1 because we have [2,1]. The partitions [3] and [1,1,1] do not qualify.
a(4) = 3 because we have [3,1], [2,2], and [2,1,1]. The partitions [4] and [1,1,1,1] do not qualify.
		

Crossrefs

Comparing even parts to odd conjugate parts gives A277579.
Comparing product of parts to product of conjugate parts gives A325039.
The reverse version is A345196.
A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A120452 counts partitions of 2n with rev-alt sum 2 (negative: A344741).
A124754 gives alternating sums of standard compositions (reverse: A344618).
A316524 is the alternating sum of the prime indices of n (reverse: A344616).
A344610 counts partitions by sum and positive reverse-alternating sum.
A344611 counts partitions of 2n with reverse-alternating sum >= 0.

Programs

  • Maple
    with(combinat): AS := proc (s) options operator, arrow: abs(add((-1)^(i-1)*s[i], i = 1 .. nops(s))) end proc: OP := proc (s) local ct, j: ct := 0: for j to nops(s) do if `mod`(s[j], 2) = 1 then ct := ct+1 else  end if end do: ct end proc: a := proc (n) local P, c, k: P := partition(n): c := 0: for k to nops(P) do if AS(P[k]) = OP(P[k]) then c := c+1 else end if end do: c end proc: seq(a(n), n = 0 .. 50);
    n := 8: with(combinat): AS := proc (s) options operator, arrow: abs(add((-1)^(i-1)*s[i], i = 1 .. nops(s))) end proc: OP := proc (s) local ct, j: ct := 0: for j to nops(s) do if `mod`(s[j], 2) = 1 then ct := ct+1 else  end if end do: ct end proc: P := partition(n): C := {}: for k to nops(P) do if AS(P[k]) = OP(P[k]) then C := `union`(C, {P[k]}) else  end if end do: C;
    # alternative Maple program:
    b:= proc(n, i, s, t) option remember; `if`(n=0,
          `if`(s=0, 1, 0), `if`(i<1, 0, b(n, i-1, s, t)+
          `if`(i>n, 0, b(n-i, i, s+t*i-irem(i, 2), -t))))
        end:
    a:= n-> b(n$2, 0, 1):
    seq(a(n), n=0..60);  # Alois P. Heinz, Oct 19 2016
  • Mathematica
    b[n_, i_, s_, t_] := b[n, i, s, t] = If[n == 0, If[s == 0, 1, 0], If[i<1, 0, b[n, i-1, s, t] + If[i>n, 0, b[n-i, i, s + t*i - Mod[i, 2], -t]]]]; a[n_] := b[n, n, 0, 1]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Dec 21 2016, after Alois P. Heinz *)
    conj[y_]:=If[Length[y]==0,y,Table[Length[Select[y,#>=k&]],{k,1,Max[y]}]]; Table[Length[Select[IntegerPartitions[n],Count[#,?OddQ]==Count[conj[#],?OddQ]&]],{n,0,15}] (* Gus Wiseman, Jun 27 2021 *)

A366528 Sum of odd prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 22 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, sum A056239(n).

Examples

			The prime indices of 198 are {1,2,2,5}, so a(198) = 1+5 = 6.
		

Crossrefs

Zeros are A066207, counted by A035363.
The triangle for this rank statistic is A113685, without zeros A365067.
For count instead of sum we have A257991, even A257992.
Nonzeros are A366322, counted by A086543.
The even version is A366531, halved A366533, triangle A113686.
A000009 counts partitions into odd parts, ranks A066208.
A053253 = partitions with all odd parts and conjugate parts, ranks A352143.
A066967 adds up sums of odd parts over all partitions.
A112798 lists prime indices, reverse A296150, length A001222, sum A056239.
A162641 counts even prime exponents, odd A162642.
A352142 = odd indices with odd exponents, counted by A117958.

Programs

  • Mathematica
    Table[Total[Cases[FactorInteger[n], {p_?(OddQ@*PrimePi),k_}:>PrimePi[p]*k]],{n,100}]

Formula

a(n) = A056239(n) - A366531(n).
Showing 1-10 of 84 results. Next