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.

A343753 Number of partitions of prime(n) containing a prime number of primes.

Original entry on oeis.org

0, 0, 2, 6, 26, 49, 154, 258, 666, 2404, 3588, 11096, 22477, 31620, 61247, 157725, 387527, 518155, 1208470, 2086019, 2726745, 5975695, 9935799, 20882243, 54355088, 86547260, 108874661, 171286370, 214236058, 333331046, 1486031972, 2246585402, 4132451733
Offset: 1

Views

Author

Paolo Xausa, May 01 2021

Keywords

Examples

			a(4) = 6 because there are 6 partitions of prime(4) = 7 that contain a prime number of primes (including repetitions). These partitions are [5,2], [3,3,1], [3,2,2], [3,2,1,1], [2,2,2,1], [2,2,1,1,1].
		

Crossrefs

Programs

  • Mathematica
    nterms=20;Table[Total[Map[If[PrimeQ[Count[#, _?PrimeQ]],1,0] &,IntegerPartitions[Prime[n]]]],{n,1,nterms}]
  • PARI
    forprime(p=2, 67, my(m=0); forpart(X=p, my(j=0); for(k=1, #X, if(isprime(X[k]), j++));if(isprime(j),m++)); print1(m, ", ")) \\ Hugo Pfoertner, May 01 2021

A344677 Number of partitions of n containing a prime number of primes and an arbitrary number of nonprimes.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 4, 6, 9, 13, 20, 26, 36, 49, 68, 90, 120, 154, 201, 258, 330, 418, 532, 666, 834, 1041, 1290, 1592, 1958, 2404, 2935, 3588, 4345, 5278, 6366, 7692, 9215, 11096, 13230, 15853, 18831, 22477, 26580, 31620, 37247, 44145, 51851, 61247, 71681, 84445
Offset: 0

Views

Author

Paolo Xausa, May 26 2021

Keywords

Examples

			a(6) = 4 because there are 4 partitions of 6 that contain a prime number of primes (including repetitions). These partitions are [3,3], [3,2,1], [2,2,2], [2,2,1,1].
		

Crossrefs

Programs

  • Mathematica
    nterms=50;Table[Total[Map[If[PrimeQ[Count[#, _?PrimeQ]],1,0] &,IntegerPartitions[n]]],{n,0,nterms-1}]
    (* Second program: *)
    seq[n_] := Module[{p}, p = 1/Product[1 - If[PrimeQ[k], y*x^k, 0] + O[x]^n, {k, 2, n}]; CoefficientList[Sum[If[PrimeQ[k], Coefficient[p, y, k], 0], {k, 2, n}]/QPochhammer[x + O[x]^n]/(p /. y -> 1), x]];
    seq[50] (* Jean-François Alcover, May 27 2021, after Andrew Howroyd *)
  • PARI
    seq(n)={my(p=1/prod(k=2, n, 1 - if(isprime(k), y*x^k) + O(x*x^n))); Vec(sum(k=2, n, if(isprime(k), polcoef(p,k,y)))/eta(x+O(x*x^n))/subst(p,y,1), -(n+1))} \\ Andrew Howroyd, May 26 2021

A236019 Smallest number having at least n partitions that contain at least n primes.

Original entry on oeis.org

0, 2, 5, 8, 10, 13, 15, 17, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 41, 43, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130
Offset: 0

Views

Author

J. Stauduhar, Jan 18 2014

Keywords

Examples

			a(4) = 10: [2,2,2,2,1,1], [2,2,2,2,2], [3,2,2,2,1], [3,3,2,2].
		

Crossrefs

Cf. A000041, A002095, A235945, A236444 (complement).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
         `if`(i<1, 0, b(n, i-1, t) +`if`(i>n, 0,
          b(n-i, i, t -`if`(t>0 and isprime(i), 1, 0)))))
        end:
    a:= proc(n) option remember; local k;
          for k from a(n-1) while b(k, k, n)Alois P. Heinz, Jan 18 2014
  • Mathematica
    $RecursionLimit = 1000; b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 0, 1, 0], If[i<1, 0, b[n, i-1, t] + If[i>n, 0, b[n-i, i, t - If[t>0 && PrimeQ[i], 1, 0]]]]]; a[n_] := a[n] = Module[{k}, For[k = a[n-1], b[k, k, n] < n, k++]; k]; a[0] = 0; Table[a[n], {n, 0, 61}] (* Jean-François Alcover, Jan 27 2014, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, Jan 18 2014

A343813 Number of partitions of prime(n) containing at least one prime.

Original entry on oeis.org

1, 2, 5, 12, 48, 88, 269, 450, 1176, 4355, 6558, 20958, 43412, 61733, 122194, 324532, 820827, 1107647, 2652517, 4655220, 6133664, 13751210, 23192039, 49730098, 132657130, 213646624, 270244858, 429702432, 540212859, 848899870, 3905568236, 5952945182, 11078643138
Offset: 1

Views

Author

Paolo Xausa, Apr 30 2021

Keywords

Examples

			a(4) = 12 because there are 12 partitions of prime(4) = 7 that contain at least one prime. These partitions are [7], [5,2], [5,1,1], [4,3], [4,2,1], [3,3,1], [3,2,2], [3,2,1,1], [3,1,1,1,1], [2,2,2,1], [2,2,1,1,1], [2,1,1,1,1,1].
		

Crossrefs

Programs

  • Mathematica
    nterms=20;Table[Total[Map[If[Count[#, _?PrimeQ]>0,1,0] &,IntegerPartitions[Prime[n]]]],{n,1,nterms}]
  • PARI
    forprime(p=2,59,my(m=0); forpart(X=p, for(k=1,#X, if(isprime(X[k]),m++;break))); print1(m,", ")) \\ Hugo Pfoertner, Apr 30 2021
    
  • PARI
    seq(n)={my(p=primes(n), m=p[#p]); vecextract(Vec(1/eta(x+O(x*x^m)) - 1/prod(k=1, m, 1-if(!isprime(k), x^k) + O(x*x^m)), -m), p)} \\ Andrew Howroyd, Apr 30 2021
    
  • Python
    from sympy.utilities.iterables import partitions
    from sympy import sieve, prime
    def A343813(n):
        p = prime(n)
        pset = set(sieve.primerange(2,p+1))
        return sum(1 for d in partitions(p) if len(set(d)&pset) > 0) # Chai Wah Wu, May 01 2021

Formula

a(n) = A235945(A000040(n)).

A355225 Number of partitions of n that contain more prime parts than nonprime parts.

Original entry on oeis.org

0, 0, 1, 1, 1, 3, 3, 5, 7, 9, 14, 19, 23, 34, 46, 56, 77, 99, 126, 164, 208, 260, 336, 416, 520, 654, 809, 995, 1237, 1514, 1856, 2274, 2761, 3354, 4078, 4918, 5931, 7153, 8572, 10272, 12298, 14663, 17469, 20787, 24643, 29210, 34568, 40797, 48113, 56664, 66573
Offset: 0

Views

Author

Omar E. Pol, Jun 24 2022

Keywords

Examples

			For n = 8 the partitions of 8 that contain more prime parts than nonprime parts are [5, 3], [3, 3, 2], [4, 2, 2], [2, 2, 2, 2], [5, 2, 1], [3, 2, 2, 1], [2, 2, 2, 1, 1]. There are seven of these partitions so a(8) = 7.
		

Crossrefs

Programs

  • PARI
    a(n) = my(nb=0); forpart(p=n, if (#select(isprime, Vec(p)) > #p/2, nb++)); nb; \\ Michel Marcus, Jun 25 2022
    
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import partitions
    def c(p): return 2*sum(p[i] for i in p if isprime(i)) > sum(p.values())
    def a(n): return sum(1 for p in partitions(n) if c(p))
    print([a(n) for n in range(51)]) # Michael S. Branicky, Jun 28 2022

Formula

a(n) = A000041(n) - A155515(n) - A355158(n).
a(n) = A355306(n) - A355158(n).

Extensions

More terms from Alois P. Heinz, Jun 24 2022

A344715 Number of partitions of n containing a prime number of distinct primes and an arbitrary number of nonprimes.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 3, 5, 9, 12, 20, 27, 42, 56, 80, 107, 151, 195, 265, 342, 453, 577, 753, 949, 1220, 1525, 1930, 2398, 3006, 3701, 4594, 5625, 6922, 8426, 10291, 12455, 15117, 18203, 21955, 26326, 31576, 37689, 45002, 53498, 63581, 75313, 89125, 105199, 124056
Offset: 0

Views

Author

Paolo Xausa, May 27 2021

Keywords

Examples

			a(10) = 12 because there are 12 partitions of 10 that contain a prime number of primes (not counting repetitions). These partitions are [7,3] (containing 2 primes), [7,2,1] (containing 2 primes), [5,3,2] (containing 3 primes), [5,3,1,1] (containing 2 primes), [5,2,2,1] (containing 2 distinct primes), [5,2,1,1,1] (containing 2 primes), [4,3,2,1] (containing 2 primes), [3,3,2,2] (containing 2 distinct primes), [3,3,2,1,1] (containing 2 distinct primes), [3,2,2,2,1] (containing 2 distinct primes), [3,2,2,1,1,1] (containing 2 distinct primes) and [3,2,1,1,1,1,1] (containing 2 primes).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; expand(
          `if`(n=0 or i=1, 1, b(n, i-1)+`if`(isprime(i), x, 1)
              *add(b(n-i*j, i-1), j=1..n/i)))
        end:
    a:= n-> (p-> add(`if`(isprime(i), coeff(p, x, i), 0),
                 i=2..degree(p)))(b(n$2)):
    seq(a(n), n=0..49);  # Alois P. Heinz, Nov 14 2021
  • Mathematica
    nterms=50;Table[Total[Map[If[PrimeQ[Count[#, _?PrimeQ]],1,0] &,Map[DeleteDuplicates[#]&,IntegerPartitions[n],{1}]]],{n,0,nterms-1}]
  • PARI
    seq(n)={my(p=prod(k=2, n, 1 - y + y/(1 - if(isprime(k), x^k))  + O(x*x^n) ) ); Vec(sum(k=2, n, if(isprime(k), polcoef(p,k,y)))/eta(x+O(x*x^n))/subst(p, y, 1), -(n+1))} \\ Andrew Howroyd, May 27 2021

A344890 Number of partitions of prime(n) containing a prime number of distinct primes and an arbitrary number of nonprimes.

Original entry on oeis.org

0, 0, 1, 3, 20, 42, 151, 265, 753, 3006, 4594, 15117, 31576, 45002, 89125, 235501, 589613, 792426, 1871442, 3251293, 4261819, 9403682, 15690192, 33111688, 86520382, 137957345, 173655404, 273492399, 342231447, 532915031, 2380864800, 3601147053, 6628703864
Offset: 1

Views

Author

Paolo Xausa, Jun 01 2021

Keywords

Examples

			a(4) = 3 because there are 3 partitions of prime(4)=7 that contain a prime number of primes (not counting repetitions). These partitions are [5,2] (containing 2 primes), [3,2,2] (containing 2 unique primes) and [3,2,1,1] (containing 2 primes).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; expand(
          `if`(n=0 or i=1, 1, b(n, i-1)+`if`(isprime(i), x, 1)
              *add(b(n-i*j, i-1), j=1..n/i)))
        end:
    a:= n-> (p-> add(`if`(isprime(i), coeff(p, x, i), 0),
                 i=2..degree(p)))(b(ithprime(n)$2)):
    seq(a(n), n=1..33);  # Alois P. Heinz, Nov 14 2021
  • Mathematica
    nterms=22;Table[Total[Map[If[PrimeQ[Count[#, _?PrimeQ]],1,0] &,Map[DeleteDuplicates[#]&,IntegerPartitions[Prime[n]],{1}]]],{n,1,nterms}]

Formula

a(n) = A344715(A000040(n)).

Extensions

a(23)-a(33) from Alois P. Heinz, Jun 02 2021

A355193 Number of partitions of n that contain at least one odd prime as a part.

Original entry on oeis.org

0, 0, 0, 1, 1, 3, 4, 8, 10, 17, 22, 35, 45, 67, 86, 123, 156, 216, 273, 369, 463, 613, 765, 997, 1236, 1587, 1958, 2485, 3049, 3830, 4677, 5823, 7077, 8740, 10576, 12971, 15629, 19046, 22862, 27701, 33125, 39928, 47579, 57078, 67788, 80963, 95852, 114023
Offset: 0

Views

Author

Omar E. Pol, Jun 23 2022

Keywords

Examples

			For n = 6 the partitions of 6 that contain at least one odd prime as a part are [3, 3], [5, 1], [3, 2, 1], [3, 1, 1, 1]. There are four of these partitions so a(6) = 4.
		

Crossrefs

Programs

  • PARI
    a(n) = my(nb=0); forpart(p=n, if (#select(x->((x>2) && isprime(x)), Vec(p)) >=1, nb++);); nb; \\ Michel Marcus, Jun 23 2022

Formula

a(n) = A000041(n) - A355195(n).

Extensions

More terms from Michel Marcus, Jun 23 2022

A348588 Number of partitions of n into 3 parts with at least 1 prime part.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 2, 4, 4, 6, 7, 8, 10, 12, 13, 17, 17, 19, 22, 25, 26, 31, 31, 36, 37, 42, 43, 49, 49, 56, 56, 64, 63, 72, 70, 80, 79, 87, 87, 99, 94, 107, 105, 116, 114, 126, 123, 139, 134, 148, 145, 158, 155, 173, 166, 184, 178, 195, 189, 211, 202, 222, 215, 236, 226, 250, 242
Offset: 0

Views

Author

Wesley Ivan Hurt, Oct 24 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; series(
         `if`(n=0, t, `if`(i<1, 0, expand(x*b(n-i, min(n-i, i),
         `if`(isprime(i), 1, t)))+b(n, i-1, t))), x, 4)
        end:
    a:= n-> coeff(b(n$2, 0), x, 3):
    seq(a(n), n=0..66);  # Alois P. Heinz, Oct 24 2021
  • Mathematica
    Table[Length@Select[IntegerPartitions[k,{3}],Or@@PrimeQ@#&],{k,0,66}] (* Giorgos Kalogeropoulos, Oct 24 2021 *)

Formula

a(n) = Sum_{j=1..floor(n/3)} Sum_{i=j..floor((n-j)/2)} sign(c(i) + c(j) + c(n-i-j)), where c is the prime characteristic (A010051).
Showing 1-9 of 9 results.