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.

Previous Showing 11-20 of 20 results.

A259195 Number of partitions of n into five primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 3, 5, 4, 6, 6, 7, 6, 10, 7, 11, 9, 12, 11, 17, 11, 18, 13, 20, 14, 24, 15, 27, 18, 29, 21, 35, 19, 38, 24, 41, 26, 47, 26, 53, 30, 54, 34, 64, 33, 70, 38, 73, 41, 81, 41, 89, 45, 92, 50, 103, 47, 112, 56, 117, 61, 127, 57
Offset: 0

Views

Author

Doug Bell, Jun 20 2015

Keywords

Examples

			a(17) = 3 because 17 can be written as the sum of five primes in exactly three ways: 2+2+3+3+7, 2+2+3+5+5, and 3+3+3+3+5.
		

Crossrefs

Column k=5 of A117278.
Number of partitions of n into r primes for r = 1..10: A010051, A061358, A068307, A259194, this sequence, A259196, A259197, A259198, A259200, A259201.
Cf. A000040.

Programs

Formula

a(n) = Sum_{l=1..floor(n/5)} Sum_{k=l..floor((n-l)/4)} Sum_{j=k..floor((n-k-l)/3)} Sum_{i=j..floor((n-j-k-l)/2)} c(i) * c(j) * c(k) * c(l) * c(n-i-j-k-l), where c = A010051. - Wesley Ivan Hurt, Apr 17 2019
a(n) = [x^n y^5] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019

Extensions

More terms from David A. Corneth, Sep 06 2020

A319797 Number T(n,k) of partitions of n into exactly k positive triangular numbers; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 2, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 1, 1, 1, 1, 1, 0, 1, 0, 1
Offset: 0

Views

Author

Alois P. Heinz, Sep 28 2018

Keywords

Comments

Equals A181506 when the first column is removed. - Georg Fischer, Jul 26 2023

Examples

			Triangle T(n,k) begins:
  1;
  0, 1;
  0, 0, 1;
  0, 1, 0, 1;
  0, 0, 1, 0, 1;
  0, 0, 0, 1, 0, 1;
  0, 1, 1, 0, 1, 0, 1;
  0, 0, 1, 1, 0, 1, 0, 1;
  0, 0, 0, 1, 1, 0, 1, 0, 1;
  0, 0, 1, 1, 1, 1, 0, 1, 0, 1;
  0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1;
  0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1;
  0, 0, 1, 2, 1, 1, 1, 1, 1, 0, 1, 0, 1;
		

Crossrefs

Columns k=0-10 give: A000007, A010054 (for n>0), A052344, A063993, A319814, A319815, A319816, A319817, A319818, A319819, A319820.
Row sums give A007294.
T(2n,n) gives A319799.

Programs

  • Maple
    h:= proc(n) option remember; `if`(n<1, 0,
          `if`(issqr(8*n+1), n, h(n-1)))
        end:
    b:= proc(n, i) option remember; `if`(n=0 or i=1, x^n,
          b(n, h(i-1))+expand(x*b(n-i, h(min(n-i, i)))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, h(n))):
    seq(T(n), n=0..20);
  • Mathematica
    h[n_] := h[n] = If[n < 1, 0, If[IntegerQ @ Sqrt[8*n + 1], n, h[n - 1]]];
    b[n_, i_] := b[n, i] = If[n == 0 || i == 1, x^n, b[n, h[i - 1]] + Expand[ x*b[n - i, h[Min[n - i, i]]]]];
    T[n_] := Table[Coefficient[#, x, i], {i, 0, n}]& @ b[n, h[n]];
    Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, May 27 2019, after Alois P. Heinz *)

Formula

T(n,k) = [x^n y^k] 1/Product_{j>=1} (1-y*x^A000217(j)).

A344447 Number T(n,k) of partitions of n into k semiprimes; triangle T(n,k), n>=0, read by rows.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, May 19 2021

Keywords

Comments

T(n,k) is defined for all n,k >= 0. The triangle contains in each row n only the terms for k=0 and then up to the last positive T(n,k) (if it exists).

Examples

			Triangle T(n,k) begins:
  1 ;
  0 ;
  0 ;
  0 ;
  0, 1 ;
  0    ;
  0, 1 ;
  0    ;
  0, 0, 1 ;
  0, 1    ;
  0, 1, 1 ;
  0       ;
  0, 0, 1, 1 ;
  0, 0, 1    ;
  0, 1, 1, 1 ;
  0, 1, 1    ;
  0, 0, 1, 1, 1 ;
  0, 0, 0, 1    ;
  0, 0, 2, 2, 1 ;
  0, 0, 2, 1    ;
  0, 0, 2, 1, 1, 1 ;
  ...
		

Crossrefs

Row sums give A101048.
T(4n,n) gives A000012.

Programs

  • Maple
    h:= proc(n) option remember; `if`(n=0, 0,
         `if`(numtheory[bigomega](n)=2, n, h(n-1)))
        end:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
         `if`(i>n, 0, expand(x*b(n-i, h(min(n-i, i)))))+b(n, h(i-1))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..max(0, degree(p))))(b(n, h(n))):
    seq(T(n), n=0..32);
  • Mathematica
    h[n_] := h[n] = If[n == 0, 0,
         If[PrimeOmega[n] == 2, n, h[n-1]]];
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0,
         If[i > n, 0, Expand[x*b[n-i, h[Min[n-i, i]]]]] + b[n, h[i-1]]]];
    T[n_] := Table[Coefficient[#, x, i], {i, 0, Max[0, Exponent[#, x]]}]&[b[n, h[n]]];
    Table[T[n], {n, 0, 32}] // Flatten (* Jean-François Alcover, Aug 19 2021, after Alois P. Heinz *)

Formula

T(n,k) = [x^n y^k] 1/Product_{j>=1} (1-y*x^A001358(j)).
Sum_{k>0} k * T(n,k) = A281617(n).

A259254 Number of partitions of prime(n) into n primes.

Original entry on oeis.org

1, 0, 0, 0, 1, 1, 2, 2, 3, 7, 7, 12, 19, 19, 25, 44, 72, 72, 119, 147, 152, 234, 292, 435, 777, 920, 946, 1135, 1161, 1377, 3703, 4294, 5944, 5944, 10742, 10742, 14488, 18958, 22092, 28662, 37687, 37687, 63068, 63068, 72400, 72400, 132756, 233796, 265315, 265315
Offset: 1

Views

Author

Doug Bell, Jun 22 2015

Keywords

Comments

a(n) = number of partitions of A000040(n) into n primes.
If n > 1 and prime(n) - prime(n-1) = 2 (twin primes), then the number of partitions of prime(n) into n primes that don't contain 2 is equal to a(n) - a(n-1); every partition of primes in a(n) that does contain a 2 matches a partition of primes in a(n-1) with an added partition for 2. Further, if n is even, then a(n) = a(n-1).

Examples

			a(9) = 3 because 23 is the ninth prime number (A000040(9) = 23), and 23 can be partitioned into nine primes in three ways: [2,2,2,2,2,2,2,2,7], [2,2,2,2,2,2,3,3,5] and [2,2,2,2,3,3,3,3,3].
		

Crossrefs

Subsequence of A117278.
Cf. A000040.

Programs

  • Maple
    N:= 100:  # to get a(1) to a(N)
    Primes:= [seq(ithprime(i),i=1..N)]:
    W:= proc(n,m,j) option remember;
      if n < 0 then return 0 fi;
      if n=0 then if m=0 then return 1 else return 0 fi fi;
      add(W(n-Primes[i],m-1,i),i=1..j)
    end proc:
    seq(W(Primes[n],n,n), n = 1 .. N); # Robert Israel, Jun 22 2015
  • Mathematica
    f[n_] := Length@ IntegerPartitions[ Prime@n, {n}, Prime@ Range@ n]; Array[f, 50] (* Giovanni Resta, Jun 23 2015 *)
  • PARI
    a(n) = {nb = 0; forpart(p=prime(n), ok=1; for (k=1, n, if (!isprime(p[k]), ok=0; break));nb += ok,[2,prime(n)],[n,n]); nb;} \\ Michel Marcus, Jun 23 2015
    
  • Perl
    use ntheory ":all"; use List::MoreUtils qw/all/; sub a259254 { my($n,$sum)=(shift,0); forpart { $sum++ if all { is_prime($) } @; } nth_prime($n),{n=>$n,amin=>2}; $sum; } say a259254($) for 1..60; # _Dana Jacobsen, Dec 15 2015
    
  • Perl
    use ntheory ":all";
    use Memoize;  memoize 'W';
    sub W {
      my($n, $m, $j) = @_;
      return 0 if $n < 0;
      return ($m == 0) ? 1 : 0  if $n == 0;
      vecsum( map { W($n-nth_prime($), $m-1, $) } 1 .. $j );
    }
    sub A259254 { my $n = shift; W(nth_prime($n), $n, $n); }
    print "$A259254($"> ", A259254($),"\n" for 1..60; # Dana Jacobsen, Dec 15 2015

Formula

a(n) = A117278(A000040(n),n). - Robert Israel, Jun 22 2015

A347578 Number of partitions of n into at most 4 prime parts.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 8, 8, 9, 10, 9, 11, 11, 13, 11, 15, 12, 16, 15, 16, 15, 18, 16, 20, 17, 23, 18, 24, 20, 26, 22, 26, 23, 31, 23, 33, 26, 35, 26, 39, 27, 41, 32, 41, 31, 46, 31, 48, 34, 51, 34, 54, 36, 58, 40, 58, 42, 64, 41
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 08 2021

Keywords

Crossrefs

Formula

a(n) = Sum_{k=1..4} A117278(n,k) for n >= 2. - Alois P. Heinz, Sep 08 2021

A347609 Number of partitions of n into at most 5 prime parts.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 6, 8, 8, 9, 10, 11, 11, 14, 14, 15, 17, 18, 19, 21, 22, 23, 25, 27, 27, 32, 29, 34, 33, 37, 37, 42, 39, 47, 44, 51, 47, 58, 50, 61, 57, 67, 61, 73, 65, 80, 71, 86, 75, 95, 79, 101, 86, 107, 92, 115, 95, 125, 103, 132, 108
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 08 2021

Keywords

Crossrefs

Formula

a(n) = Sum_{k=1..5} A117278(n,k) for n >= 2. - Alois P. Heinz, Sep 08 2021

A347610 Number of partitions of n into at most 6 prime parts.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 9, 9, 11, 12, 14, 15, 17, 18, 20, 23, 24, 27, 28, 32, 33, 37, 38, 43, 44, 48, 51, 55, 55, 63, 62, 70, 71, 77, 78, 89, 87, 97, 96, 108, 105, 121, 114, 133, 127, 144, 139, 161, 149, 174, 165, 189, 177, 208, 188, 226, 206
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 08 2021

Keywords

Crossrefs

Formula

a(n) = Sum_{k=1..6} A117278(n,k) for n >= 2. - Alois P. Heinz, Sep 08 2021

A299168 Number of ordered ways of writing n-th prime number as a sum of n primes.

Original entry on oeis.org

1, 0, 0, 0, 5, 6, 42, 64, 387, 5480, 10461, 113256, 507390, 1071084, 4882635, 44984560, 382362589, 891350154, 7469477771, 33066211100, 78673599501, 649785780710, 2884039365010, 22986956007816, 306912836483025, 1361558306986280, 3519406658042964
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 04 2018

Keywords

Examples

			a(5) = 5 because fifth prime number is 11 and we have [3, 2, 2, 2, 2], [2, 3, 2, 2, 2], [2, 2, 3, 2, 2], [2, 2, 2, 3, 2] and [2, 2, 2, 2, 3].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), b(n-j, t-1), 0), j=1..n)))
        end:
    a:= n-> b(ithprime(n), n):
    seq(a(n), n=1..30);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    Table[SeriesCoefficient[Sum[x^Prime[k], {k, 1, n}]^n, {x, 0, Prime[n]}], {n, 1, 27}]

Formula

a(n) = [x^prime(n)] (Sum_{k>=1} x^prime(k))^n.

A347552 Number of partitions of n into at most 2 prime parts.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 3, 1, 3, 0, 2, 1, 3, 2, 2, 1, 4, 0, 4, 1, 2, 1, 3, 1, 4, 2, 3, 1, 4, 1, 5, 1, 4, 0, 3, 1, 5, 1, 3, 0, 4, 1, 6, 2, 3, 1, 5, 0, 6, 1, 2, 1, 5, 1, 6, 2, 5, 1, 5, 0, 7, 1, 4, 1, 5, 1, 8, 1, 5
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 08 2021

Keywords

Crossrefs

Formula

a(n) = Sum_{k=1..2} A117278(n,k) for n >= 2. - Alois P. Heinz, Sep 08 2021

A301971 a(n) = [x^n] Product_{k>=1} 1/(1 - x^prime(k))^n.

Original entry on oeis.org

1, 0, 2, 3, 10, 30, 77, 252, 682, 2136, 6182, 18766, 56173, 169351, 512990, 1551828, 4720170, 14348289, 43751984, 133502873, 408029510, 1248460587, 3823949824, 11724787763, 35980251181, 110510334780, 339674840715, 1044812449722, 3215861978150, 9904301974294, 30521063942312, 94103983534015
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 29 2018

Keywords

Comments

Number of partitions of n into prime parts of n kinds.

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[Product[1/(1 - x^Prime[k])^n, {k, 1, n}], {x, 0, n}], {n, 0, 31}]
Previous Showing 11-20 of 20 results.