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

A000607 Number of partitions of n into prime parts.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 9, 10, 12, 14, 17, 19, 23, 26, 30, 35, 40, 46, 52, 60, 67, 77, 87, 98, 111, 124, 140, 157, 175, 197, 219, 244, 272, 302, 336, 372, 413, 456, 504, 557, 614, 677, 744, 819, 899, 987, 1083, 1186, 1298, 1420, 1552, 1695, 1850, 2018, 2198, 2394, 2605, 2833, 3079, 3344
Offset: 0

Views

Author

Keywords

Comments

a(n) gives the number of values of k such that A001414(k) = n. - Howard A. Landman, Sep 25 2001
Let W(n) = {prime p: There is at least one number m whose spf is p, and sopfr(m) = n}. Let V(n,p) = {m: sopfr(m) = n, p belongs to W(n)}. Then a(n) = sigma(|V(n,p)|). E.g.: W(10) = {2,3,5}, V(10,2) = {30,32,36}, V(10,3) = {21}, V(10,5) = {25}, so a(10) = 3+1+1 = 5. - David James Sycamore, Apr 14 2018
From Gus Wiseman, Jan 18 2020: (Start)
Also the number of integer partitions such that the sum of primes indexed by the parts is n. For example, the sum of primes indexed by the parts of the partition (3,2,1,1) is prime(3)+prime(2)+prime(1)+prime(1) = 12, so (3,2,1,1) is counted under a(12). The a(2) = 1 through a(14) = 10 partitions are:
1 2 11 3 22 4 32 41 33 5 43 6 44
21 111 31 221 222 42 322 331 51 52
211 1111 311 321 411 421 332 431
2111 2211 2221 2222 422 3222
11111 3111 3211 3221 3311
21111 22111 4111 4211
111111 22211 22221
31111 32111
211111 221111
1111111
(End)

Examples

			n = 10 has a(10) = 5 partitions into prime parts: 10 = 2 + 2 + 2 + 2 + 2 = 2 + 2 + 3 + 3 = 2 + 3 + 5 = 3 + 7 = 5 + 5.
n = 15 has a(15) = 12 partitions into prime parts: 15 = 2 + 2 + 2 + 2 + 2 + 2 + 3 = 2 + 2 + 2 + 3 + 3 + 3 = 2 + 2 + 2 + 2 + 2 + 5 = 2 + 2 + 2 + 2 + 7 = 2 + 2 + 3 + 3 + 5 = 2 + 3 + 5 + 5 = 2 + 3 + 3 + 7 = 2 + 2 + 11 = 2 + 13 = 3 + 3 + 3 + 3 + 3 = 3 + 5 + 7 = 5 + 5 + 5.
		

References

  • R. Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; see p. 203.
  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem, Mathematics and Computer Education, Vol. 31, No. 1, pp. 24-28, Winter 1997. MathEduc Database (Zentralblatt MATH, 1997c.01891).
  • B. C. Berndt and B. M. Wilson, Chapter 5 of Ramanujan's second notebook, pp. 49-78 of Analytic Number Theory (Philadelphia, 1980), Lect. Notes Math. 899, 1981, see Entry 29.
  • D. M. Burton, Elementary Number Theory, 5th ed., McGraw-Hill, 2002.
  • L. M. Chawla and S. A. Shad, On a trio-set of partition functions and their tables, J. Natural Sciences and Mathematics, 9 (1969), 87-96.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

G.f. = 1 / g.f. for A046675. See A046113 for the ordered (compositions) version.
Row sums of array A116865 and of triangle A261013.
Column sums of A331416.
Partitions whose Heinz number is divisible by their sum of primes are A330953.
Partitions of whose sum of primes is divisible by their sum are A331379.

Programs

  • Haskell
    a000607 = p a000040_list where
       p _      0 = 1
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Aug 05 2012
    
  • Magma
    [1] cat [#RestrictedPartitions(n,{p:p in PrimesUpTo(n)}): n in [1..100]]; // Marius A. Burtea, Jan 02 2019
  • Maple
    with(gfun):
    t1:=mul(1/(1-q^ithprime(n)),n=1..51):
    t2:=series(t1,q,50):
    t3:=seriestolist(t2); # fixed by Vaclav Kotesovec, Sep 14 2014
  • Mathematica
    CoefficientList[ Series[1/Product[1 - x^Prime[i], {i, 1, 50}], {x, 0, 50}], x]
    f[n_] := Length@ IntegerPartitions[n, All, Prime@ Range@ PrimePi@ n]; Array[f, 57] (* Robert G. Wilson v, Jul 23 2010 *)
    Table[Length[Select[IntegerPartitions[n],And@@PrimeQ/@#&]],{n,0,60}] (* Harvey P. Dale, Apr 22 2012 *)
    a[n_] := a[n] = If[PrimeQ[n], 1, 0]; c[n_] := c[n] = Plus @@ Map[# a[#] &, Divisors[n]]; b[n_] := b[n] = (c[n] + Sum[c[k] b[n - k], {k, 1, n - 1}])/n; Table[b[n], {n, 1, 20}] (* Thomas Vogler, Dec 10 2015: Uses Euler transform, caches computed values, faster than IntegerPartitions[] function. *)
    nmax = 100; pmax = PrimePi[nmax]; poly = ConstantArray[0, nmax + 1]; poly[[1]] = 1; poly[[2]] = 0; poly[[3]] = -1; Do[p = Prime[k]; Do[poly[[j + 1]] -= poly[[j + 1 - p]], {j, nmax, p, -1}];, {k, 2, pmax}]; s = Sum[poly[[k + 1]]*x^k, {k, 0, Length[poly] - 1}]; CoefficientList[Series[1/s, {x, 0, nmax}], x] (* Vaclav Kotesovec, Jan 11 2021 *)
  • PARI
    N=66;x='x+O('x^N); Vec(1/prod(k=1,N,1-x^prime(k))) \\ Joerg Arndt, Sep 04 2014
    
  • Python
    from sympy import primefactors
    l = [1, 0]
    for n in range(2, 101):
        l.append(sum(sum(primefactors(k)) * l[n - k] for k in range(1, n + 1)) // n)
    l  # Indranil Ghosh, Jul 13 2017
    
  • Sage
    [Partitions(n, parts_in=prime_range(n + 1)).cardinality() for n in range(100)]  # Giuseppe Coppoletta, Jul 11 2016
    

Formula

Asymptotically a(n) ~ exp(2 Pi sqrt(n/log n) / sqrt(3)) (Ayoub).
a(n) = (1/n)*Sum_{k=1..n} A008472(k)*a(n-k). - Vladeta Jovovic, Aug 27 2002
G.f.: 1/Product_{k>=1} (1-x^prime(k)).
See the partition arrays A116864 and A116865.
From Vaclav Kotesovec, Sep 15 2014 [Corrected by Andrey Zabolotskiy, May 26 2017]: (Start)
It is surprising that the ratio of the formula for log(a(n)) to the approximation 2 * Pi * sqrt(n/(3*log(n))) exceeds 1. For n=20000 the ratio is 1.00953, and for n=50000 (using the value from Havermann's tables) the ratio is 1.02458, so the ratio is increasing. See graph above.
A more refined asymptotic formula is found by Vaughan in Ramanujan J. 15 (2008), pp. 109-121, and corrected by Bartel et al. (2017): log(a(n)) = 2*Pi*sqrt(n/(3*log(n))) * (1 - log(log(n))/(2*log(n)) + O(1/log(n))).
See Bartel, Bhaduri, Brack, Murthy (2017) for a more complete asymptotic expansion. (End)
G.f.: 1 + Sum_{i>=1} x^prime(i) / Product_{j=1..i} (1 - x^prime(j)). - Ilya Gutkovskiy, May 07 2017
a(n) = A184198(n) + A184199(n). - Vaclav Kotesovec, Jan 11 2021

A305614 Expansion of Sum_{p prime} x^p/(1 + x^p).

Original entry on oeis.org

0, 0, 1, 1, -1, 1, 0, 1, -1, 1, 0, 1, -2, 1, 0, 2, -1, 1, 0, 1, -2, 2, 0, 1, -2, 1, 0, 1, -2, 1, -1, 1, -1, 2, 0, 2, -2, 1, 0, 2, -2, 1, -1, 1, -2, 2, 0, 1, -2, 1, 0, 2, -2, 1, 0, 2, -2, 2, 0, 1, -3, 1, 0, 2, -1, 2, -1, 1, -2, 2, -1, 1, -2, 1, 0, 2, -2, 2, -1
Offset: 0

Views

Author

Gus Wiseman, Jun 06 2018

Keywords

Comments

a(n) is the number of prime divisors p|n such that n/p is odd, minus the number of prime divisors p|n such that n/p is even.

Examples

			The prime divisors of 12 are 2, 3. We see that 12/2 = 6, 12/3 = 4. None of those are odd, but both of them are even, so a(12) = -2.
The prime divisors of 30 are {2,3,5} with quotients {15,10,6}. One of these is odd and two are even, so a(30) = 1 - 2 = -1.
		

Crossrefs

Programs

  • Maple
    a:= n-> -add((-1)^(n/i[1]), i=ifactors(n)[2]):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jun 07 2018
    # Alternative
    N:= 1000: # to get a(0)..a(N)
    V:= Vector(N):
    p:= 1:
    do
      p:= nextprime(p);
      if p > N then break fi;
      R:= [seq(i,i=p..N,p)];
      W:= ;
      V[R]:= V[R]+W;
    od:
    [0,seq(V[i],i=1..N)]; # Robert Israel, Jun 07 2018
  • Mathematica
    Table[Sum[If[PrimeQ[d], (-1)^(n/d - 1), 0], {d, Divisors[n]}], {n, 30}]

Formula

a(n) = -Sum_{p|n prime} (-1)^(n/p).
From Robert Israel, Jun 07 2018: (Start)
If n is odd, a(n) = A001221(n).
If n == 2 (mod 4), a(n) = 2 - A001221(n).
If n == 0 (mod 4) and n > 0, a(n) = -A001221(n). (End)
L.g.f.: log(Product_{k>=1} (1 + x^prime(k))^(1/prime(k))) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Jul 30 2018

A184198 Number of partitions of n into an even number of primes.

Original entry on oeis.org

1, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 2, 4, 4, 6, 5, 8, 7, 11, 10, 15, 13, 20, 17, 26, 23, 34, 29, 43, 38, 55, 49, 69, 62, 88, 78, 109, 97, 135, 122, 167, 150, 205, 186, 251, 227, 306, 277, 371, 337, 448, 407, 539, 492, 647, 591, 773, 707, 922, 845, 1096, 1005, 1298, 1193, 1535, 1412, 1809, 1667, 2127
Offset: 0

Views

Author

R. J. Mathar, Jan 10 2011

Keywords

Examples

			n=18 can be partitioned in A000607(18)=19 ways into primes, of which a(18)=11 are even, namely 11+7, 13+5, 5+5+5+3, 7+5+3+3, 3+3+3+3+3+3, 7+7+2+2, 11+3+2+2, 5+3+3+3+2+2, 5+5+2+2+2+2, 7+3+2+2+2+2, 3+3+2+2+2+2+2+2.
The remaining A184199(18)=8 are odd.
		

Crossrefs

Programs

Formula

a(n) = (A000607(n)+A048165(n))/2.

Extensions

a(31)-a(69) corrected by Andrew Howroyd, Dec 28 2017

A184199 Number of partitions of n into an odd number of primes.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 1, 2, 1, 2, 2, 4, 3, 5, 4, 7, 6, 10, 8, 13, 11, 17, 15, 23, 20, 29, 26, 38, 34, 49, 43, 62, 55, 78, 69, 97, 88, 122, 109, 150, 135, 186, 167, 227, 205, 277, 251, 337, 306, 407, 371, 492, 448, 591, 539, 707, 647, 845, 773, 1005, 922, 1193, 1096, 1412, 1298, 1667, 1535, 1963, 1809, 2305, 2127
Offset: 0

Views

Author

R. J. Mathar, Jan 10 2011

Keywords

Examples

			n=18 can be partitioned in A000607(18)=19 ways into primes, of which a(18)=8 are odd, namely  11+5+2, 13+3+2, 5+5+3+3+2, 7+3+3+3+2, 7+5+2+2+2, 3+3+3+3+2+2+2, 5+3+2+2+2+2+2, 2+2+2+2+2+2+2+2+2.
The remaining A184198(18)=11 are even.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = Count[IntegerPartitions[n, All, Prime[Range[PrimePi[n]]]], p_ /; OddQ[Length[p]]];
    Reap[Do[Print[n, " ", a[n]]; Sow[a[n]], {n, 0, 200}]][[2, 1]] (* Jean-François Alcover, Feb 13 2020 *)
  • PARI
    parts(n, pred, y)={prod(k=1, n, if(pred(k), 1/(1-y*x^k) + O(x*x^n), 1))}
    {my(n=80); (Vec(parts(n, isprime, 1)) - Vec(parts(n, isprime, -1)))/2} \\ Andrew Howroyd, Dec 28 2017

Formula

a(n) = (A000607(n)-A048165(n))/2.

Extensions

a(31)-a(70) corrected by Andrew Howroyd, Dec 28 2017

A305630 Expansion of Product_{r = 1 or not a perfect power} 1/(1 - x^r).

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 9, 12, 16, 21, 28, 36, 48, 61, 78, 99, 124, 156, 195, 241, 299, 367, 450, 549, 670, 811, 982, 1183, 1422, 1704, 2040, 2431, 2894, 3435, 4070, 4811, 5679, 6684, 7858, 9217, 10797, 12623, 14738, 17174, 19988, 23225, 26951, 31227, 36141, 41759
Offset: 0

Views

Author

Gus Wiseman, Jun 07 2018

Keywords

Comments

a(n) is the number of integer partitions of n such that each part is either 1 or not a perfect power (A001597, A007916).

Examples

			The a(5) = 6 integer partitions whose parts are 1's or not perfect powers are (5), (32), (311), (221), (2111), (11111).
		

Crossrefs

Programs

  • Maple
    q:= n-> is(n=1 or 1=igcd(map(i-> i[2], ifactors(n)[2])[])):
    a:= proc(n) option remember; `if`(n=0, 1, add(a(n-j)*add(
         `if`(q(d), d, 0), d=numtheory[divisors](j)), j=1..n)/n)
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Jun 07 2018
  • Mathematica
    nn=20;
    radQ[n_]:=Or[n==1,GCD@@FactorInteger[n][[All,2]]==1];
    ser=Product[1/(1-x^p),{p,Select[Range[nn],radQ]}];
    Table[SeriesCoefficient[ser,{x,0,n}],{n,0,nn}]

A305631 Expansion of Product_{r not a perfect power} 1/(1 - x^r).

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 3, 3, 4, 5, 7, 8, 12, 13, 17, 21, 25, 32, 39, 46, 58, 68, 83, 99, 121, 141, 171, 201, 239, 282, 336, 391, 463, 541, 635, 741, 868, 1005, 1174, 1359, 1580, 1826, 2115, 2436, 2814, 3237, 3726, 4276, 4914, 5618, 6445, 7359, 8414, 9594, 10947, 12453
Offset: 0

Views

Author

Gus Wiseman, Jun 07 2018

Keywords

Comments

a(n) is the number of integer partitions of n whose parts are not perfect powers (A001597, A007916).

Examples

			The a(9) = 5 integer partitions whose parts are not perfect powers are (72), (63), (522), (333), (3222).
		

Crossrefs

Programs

  • Maple
    q:= n-> is(1=igcd(map(i-> i[2], ifactors(n)[2])[])):
    a:= proc(n) option remember; `if`(n=0, 1, add(a(n-j)*add(
         `if`(q(d), d, 0), d=numtheory[divisors](j)), j=1..n)/n)
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Jun 07 2018
  • Mathematica
    nn=100;
    wadQ[n_]:=n>1&&GCD@@FactorInteger[n][[All,2]]==1;
    ser=Product[1/(1-x^p),{p,Select[Range[nn],wadQ]}];
    Table[SeriesCoefficient[ser,{x,0,n}],{n,0,nn}]

A298160 G.f.: Product_{k>=1} 1/(1+prime(k)*x^prime(k)).

Original entry on oeis.org

1, 0, -2, -3, 4, 1, 1, -9, 13, -9, 20, -38, 76, -75, 65, -323, 378, -197, 805, -1394, 1635, -2513, 3175, -5442, 11135, -12570, 12526, -33357, 51563, -46460, 93551, -155750, 186650, -313241, 421641, -620393, 1131820, -1321220, 1663951, -3559915, 5011036, -5207116
Offset: 0

Views

Author

Seiichi Manyama, Jan 14 2018

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[Product[1/(1+Prime[k]x^Prime[k]),{k,50}],{x,0,50}],x] (* Harvey P. Dale, Mar 24 2020 *)

A302236 Expansion of Product_{k>=1} (1 + x^prime(k))/(1 + x^k).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Apr 03 2018

Keywords

Comments

The difference between the number of partitions of n into an even number of nonprime parts and the number of partitions of n into an odd number of nonprime parts.
Convolution of the sequences A000586 and A081362.

Crossrefs

Programs

  • Mathematica
    nmax = 80; CoefficientList[Series[Product[(1 + x^Prime[k])/(1 + x^k), {k, 1, nmax}], {x, 0, nmax}], x]
    nmax = 80; CoefficientList[Series[Product[1/(1 + Boole[!PrimeQ[k]] x^k), {k, 1, nmax}], {x, 0, nmax}], x]

Formula

G.f.: Product_{k>=1} 1/(1 + x^A018252(k)).

A305632 Expansion of Product_{r = 1 or not a perfect power} 1/(1 + (-x)^r).

Original entry on oeis.org

1, 1, 0, 1, 2, 2, 1, 2, 4, 3, 2, 4, 6, 5, 4, 7, 10, 8, 7, 11, 15, 13, 12, 17, 22, 19, 18, 25, 30, 28, 26, 35, 42, 39, 38, 49, 59, 56, 54, 69, 81, 77, 76, 94, 110, 105, 105, 127, 147, 141, 142, 171, 195, 189, 190, 227, 257, 250, 254, 299, 335, 328, 334, 390, 432
Offset: 0

Views

Author

Gus Wiseman, Jun 07 2018

Keywords

Examples

			O.g.f.: 1/((1 - x)(1 + x^2)(1 - x^3)(1 - x^5)(1 + x^6)(1 - x^7)(1 + x^10)...).
		

Crossrefs

Programs

  • Mathematica
    nn=20;
    radQ[n_]:=Or[n==1,GCD@@FactorInteger[n][[All,2]]==1];
    ser=Product[1/(1+(-x)^p),{p,Select[Range[nn],radQ]}];
    Table[SeriesCoefficient[ser,{x,0,n}],{n,0,nn}]

A305633 Expansion of Sum_{r not a perfect power} x^r/(1 + x^r).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 07 2018

Keywords

Crossrefs

Programs

  • Mathematica
    nn=100;
    wadQ[n_]:=n>1&&GCD@@FactorInteger[n][[All,2]]==1;
    ser=Sum[x^p/(1+x^p),{p,Select[Range[nn],wadQ]}];
    Table[SeriesCoefficient[ser,{x,0,n}],{n,nn}]
Showing 1-10 of 13 results. Next