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

A099773 Number of partitions of n into odd prime parts.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 7, 7, 9, 10, 11, 12, 14, 15, 17, 20, 21, 24, 26, 29, 33, 35, 40, 44, 47, 53, 58, 64, 70, 77, 84, 91, 101, 110, 120, 130, 142, 155, 168, 184, 199, 215, 234, 254, 275, 298, 323, 348, 376, 407, 439, 474, 511, 551, 592
Offset: 0

Views

Author

Vladeta Jovovic, Nov 11 2004

Keywords

Crossrefs

Programs

  • Haskell
    a099773 = p a065091_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
  • Mathematica
    CoefficientList[ Series[ Product[1/(1 - x^Prime[i]), {i, 2, 25}], {x, 0, 70}], x] (* Robert G. Wilson v, Jun 14 2006 *)

Formula

G.f.: 1/Product_{k>1} (1-x^prime(k)).

A002124 Number of compositions of n into a sum of odd primes.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 2, 1, 3, 4, 3, 7, 7, 8, 14, 15, 21, 28, 33, 47, 58, 76, 103, 125, 169, 220, 277, 373, 476, 616, 810, 1037, 1361, 1763, 2279, 2984, 3846, 5006, 6521, 8428, 10983, 14249, 18480, 24048, 31178, 40520, 52635, 68281, 88765, 115211, 149593, 194381, 252280, 327696, 425587, 552527, 717721
Offset: 0

Views

Author

Keywords

Comments

Arises in studying the Goldbach conjecture.
The g.f. -(z-1)*(z+1)*(z**2+z+1)*(z**2-z+1)/(1-z**6-z**3-z**5-z**7+z**9) conjectured by Simon Plouffe in his 1992 dissertation is wrong.

References

  • 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

Programs

  • Haskell
    import Data.List (genericIndex)
    a002124 n = genericIndex a002124_list n
    a002124_list = 1 : f 1 [] a065091_list where
       f x qs ps'@(p:ps)
         | p <= x    = f x (p:qs) ps
         | otherwise = sum (map (a002124 . (x -)) qs) : f (x + 1) qs ps'
    -- Reinhard Zumkeller, Mar 21 2014
  • Maple
    A002124 := proc(n) coeff(series(1/(1-add(z^numtheory[ithprime](j),j=2..n)),z=0,n+1),z,n) end;
    M:=120; a:=array(0..M); a[0]:=1; a[1]:=0; a[2]:=0; for n from 3 to M do t1:=0; for k from 2 to n do p := ithprime(k); if p <= n then t1 := t1 + a[n-p]; fi; od: a[n]:=t1; od: [seq(a[n],n=0..M)]; # N. J. A. Sloane, after MacMahon, Dec 03 2006; used in A002125
  • Mathematica
    a[0] = 1; a[1] = a[2] = 0; a[n_] := a[n] = (s = 0; p = 3; While[p <= n, s = s + a[n-p]; p = NextPrime[p]]; s); a /@ Range[0, 58] (* Jean-François Alcover, Jun 28 2011, after P. A. MacMahon *)

Formula

a(0)=1, a(1)=a(2)=0; for n >= 3, a(n) = Sum_{ primes p with 3 <= p <= n} a(n-p). [MacMahon]
G.f.: 1/( 1 - Sum_{k>=2} x^A000040(k) ). [Joerg Arndt, Sep 30 2012]

Extensions

Better description and more terms from Philippe Flajolet, Nov 11 2002
Edited by N. J. A. Sloane, Dec 03 2006

A331981 Number of compositions (ordered partitions) of n into distinct odd primes.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 1, 2, 0, 2, 1, 2, 1, 2, 6, 4, 1, 4, 7, 4, 12, 4, 13, 6, 12, 28, 18, 28, 19, 6, 25, 52, 24, 54, 30, 56, 31, 98, 156, 102, 37, 104, 157, 150, 276, 150, 175, 154, 288, 200, 528, 246, 307, 226, 666, 990, 780, 1038, 679, 348, 799, 1828, 1272, 1162, 1164
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 03 2020

Keywords

Examples

			a(16) = 4 because we have [13, 3], [11, 5], [5, 11] and [3, 13].
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n<1, 0, ithprime(n+1)+s(n-1)) end:
    b:= proc(n, i, t) option remember; `if`(s(i)`if`(p>n, 0, b(n-p, i-1, t+1)))(ithprime(i+1))+b(n, i-1, t)))
        end:
    a:= n-> b(n, numtheory[pi](n), 0):
    seq(a(n), n=0..72);  # Alois P. Heinz, Feb 03 2020
  • Mathematica
    s[n_] := s[n] = If[n < 1, 0, Prime[n + 1] + s[n - 1]];
    b[n_, i_, t_] := b[n, i, t] = If[s[i] < n, 0, If[n == 0, t!, If[# > n, 0, b[n - #, i - 1, t + 1]]&[Prime[i + 1]] + b[n, i - 1, t]]];
    a[n_] := b[n, PrimePi[n], 0];
    a /@ Range[0, 72] (* Jean-François Alcover, Nov 09 2020, after Alois P. Heinz *)

A024937 a(n) = number of 2's in all partitions of n into distinct primes.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 4, 3, 5, 4, 4, 5, 5, 6, 6, 5, 7, 7, 7, 8, 8, 9, 8, 9, 11, 11, 10, 12, 12, 13, 14, 14, 16, 15, 16, 17, 19, 20, 20, 20, 22, 24, 23, 26, 27, 27, 28, 30, 33, 34, 34, 36, 37, 40, 41, 43, 46, 46, 47, 50, 55, 56, 56, 58, 63, 64
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A024939.

Programs

  • Maple
    with(numtheory):
    b:= proc(n, i) option remember; local g;
        if n=0 then [1, 0]
        elif i<1 then [0, 0]
        else g:= `if`(ithprime(i)>n, [0$2], b(n-ithprime(i), i-1));
             b(n, i-1) +g +[0, `if`(i=1,g[1],0)]
        fi
    end:
    a:= n-> b(n, pi(n))[2]:
    seq(a(n), n=0..80);  # Sean A. Irvine, after Alois P. Heinz, Jul 29 2019
  • Mathematica
    max = 100; (* number of terms *)
    CoefficientList[x^2*Product[1+x^Prime[k], {k, 2, PrimePi[max]}]+O[x]^max, x] (* Jean-François Alcover, Sep 07 2022, after Vladeta Jovovic *)

Formula

G.f.: x^2*Product_{k>1} (1+x^prime(k)). - Vladeta Jovovic, Jul 20 2003

Extensions

More terms from Vladeta Jovovic, Jul 20 2003
a(0)-a(6) prepended by Sean A. Irvine, Jul 29 2019

A298604 Number of partitions of n into distinct odd prime parts (including 1).

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 6, 5, 5, 6, 6, 7, 7, 8, 9, 8, 9, 10, 11, 12, 11, 12, 14, 14, 15, 16, 17, 17, 17, 20, 22, 21, 22, 24, 25, 27, 28, 30, 31, 31, 33, 36, 39, 40, 40, 42, 46, 47, 49, 53, 54, 55, 58, 63, 67, 68, 70, 73, 77, 81, 84
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 22 2018

Keywords

Examples

			a(16) = 3 because we have [13, 3], [11, 5] and [7, 5, 3, 1].
		

Crossrefs

Programs

  • Mathematica
    nmax = 78; CoefficientList[Series[(1 + x) Product[(1 + x^Prime[k]), {k, 2, nmax}], {x, 0, nmax}], x]

Formula

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

A317678 Sets of n distinct primes p_i in ascending order, written as triangle, such that S_n = Sum_{k=1..n} p_k is minimized and that there exists a compensation set of n primes q_j with q_j = n*p_j - Sum_{k=1..n,k!=j} p_k, j=1..n such that the set union {p_j} U {q_j} contains 2*n distinct primes and Sum_{k=1..n} q_k = S_n.

Original entry on oeis.org

1, 11, 17, 37, 43, 61, 29, 31, 37, 41, 67, 71, 73, 83, 101, 97, 101, 103, 107, 113, 139, 179, 181, 191, 199, 211, 223, 241, 223, 227, 229, 233, 239, 257, 269, 283, 223, 227, 229, 233, 239, 241, 251, 257, 317, 347, 349, 353, 359, 367, 373, 397, 401, 421, 443
Offset: 1

Views

Author

Hugo Pfoertner, Aug 10 2018

Keywords

Comments

In case of ties, i.e., if more than one set exists for the same minimal sum S_n, the lexicographically least set is chosen. Since the condition of distinctness of {p_j} U {q_j} cannot be satisfied for n=1, the sets p = q = {1} are assumed to complete the triangle.
The minimal sums S_n are provided in A317680 and the corresponding compensation sets are provided in A317679. The compensation set is a solution to the "fair compensation" problem. n persons who own individual shares of p_i units of an asset agree to equally share those assets among themselves and a person n+1, who owns 0 units of this asset, but is willing to pay S_n units of compensation, e.g. money, to buy his share of S_n/(n+1) units of the asset. S_n/(n+1) doesn't need to be integer. q_j as defined above is a fair compensation for person j's relinquishment of assets by equipartitioning, assuming a constant price per asset.

Examples

			Table begins:
  n  Sum          p_k                       q_k
     A317680                                A317679
  1     1     1                        1
  2    28    11  17                    5  23
  3   141    37  43  61                7  31 103
  4   138    29  31  37  41            7  17  47  67
  5   395    67  71  73  83 101        7  31  43 103 211
  6   660    97 101 103 107 113 139   19  47  61  89 131 313
		

Crossrefs

A369708 Maximal coefficient of (1 + x^3) * (1 + x^5) * (1 + x^7) * ... * (1 + x^prime(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 4, 5, 8, 14, 23, 40, 70, 126, 221, 394, 711, 1290, 2354, 4344, 8015, 14868, 27585, 51094, 95160, 178436, 335645, 634568, 1202236, 2261052, 4267640, 8067296, 15318171, 29031484, 55248527, 105251904, 200711160, 383580180, 733704990
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 29 2024

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<2, 1, expand(b(n-1)*(1+x^ithprime(n)))) end:
    a:= n-> max(coeffs(b(n))):
    seq(a(n), n=0..40);  # Alois P. Heinz, Jan 29 2024
  • Mathematica
    Table[Max[CoefficientList[Product[(1 + x^Prime[k]), {k, 2, n}], x]], {n, 0, 40}]
  • PARI
    a(n) = vecmax(Vec(prod(i=2, n, 1+x^prime(i)))); \\ Michel Marcus, Jan 29 2024
    
  • Python
    from collections import Counter
    from sympy import prime
    def A369708(n):
        c = {0:1}
        for i in range(2,n+1):
            p, d = prime(i), Counter(c)
            for k in c:
                d[k+p] += c[k]
            c = d
        return max(c.values()) # Chai Wah Wu, Jan 31 2024

A281545 Expansion of Sum_{k>=2} x^prime(k)/(1 + x^prime(k)) * Product_{k>=2} (1 + x^prime(k)).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 2, 0, 2, 1, 2, 1, 2, 3, 4, 1, 4, 4, 4, 6, 4, 7, 6, 6, 8, 9, 8, 10, 6, 13, 12, 12, 14, 15, 16, 16, 18, 23, 22, 19, 24, 24, 30, 28, 30, 33, 34, 34, 40, 44, 46, 44, 46, 58, 56, 60, 64, 65, 68, 70, 80, 86, 88, 87, 94, 101, 112, 114, 116, 125, 130, 132, 148, 159, 162, 163, 168, 190, 196
Offset: 1

Views

Author

Ilya Gutkovskiy, Jan 23 2017

Keywords

Comments

Total number of parts in all partitions of n into distinct odd primes.

Examples

			a(23) = 7 because we have [23], [13, 7, 3], [11, 7, 5] and 1 + 3 + 3 = 7.
		

Crossrefs

Programs

  • Mathematica
    nmax = 80; Rest[CoefficientList[Series[Sum[x^Prime[k]/(1 + x^Prime[k]), {k, 2, nmax}] Product[1 + x^Prime[k], {k, 2, nmax}], {x, 0, nmax}], x]]
  • PARI
    sumparts(n, pred)={sum(k=1, n, 1 - 1/(1+pred(k)*x^k) + O(x*x^n))*prod(k=1, n, 1+pred(k)*x^k + O(x*x^n))}
    {my(n=60); Vec(sumparts(n, v->v>2 && isprime(v)), -n)} \\ Andrew Howroyd, Dec 28 2017

Formula

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

A352166 Number of partitions of n into distinct odd prime powers (1 included).

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 5, 4, 5, 6, 6, 6, 7, 8, 9, 9, 10, 12, 12, 13, 14, 16, 17, 17, 19, 21, 23, 23, 25, 28, 30, 31, 33, 37, 38, 40, 43, 47, 50, 52, 55, 60, 64, 66, 70, 76, 81, 83, 89, 96, 101, 105, 110, 119, 125, 130, 138, 147, 155, 161
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 06 2022

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 70; CoefficientList[Series[Product[(1 + Boole[(PrimePowerQ[k] || k == 1) && OddQ[k]] x^k), {k, 1, nmax}], {x, 0, nmax}], x]

Formula

G.f.: Product_{k>=0} (1 + x^A061345(k)).
Showing 1-9 of 9 results.