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.

A121304 Number of parts in all the compositions of n into primes (i.e., in all ordered sequences of primes having sum n).

This page as a plain text file.
%I A121304 #28 Jun 01 2021 08:06:24
%S A121304 1,1,2,5,5,14,17,32,53,76,139,198,334,515,798,1280,1938,3075,4710,
%T A121304 7299,11298,17296,26738,40874,62763,96036,146674,224210,341562,520767,
%U A121304 792375,1204951,1831124,2779234,4217008,6391663,9683056,14659038,22177341
%N A121304 Number of parts in all the compositions of n into primes (i.e., in all ordered sequences of primes having sum n).
%C A121304 a(n) = Sum_{k=1..floor(n/2)} k*A121303(n,k).
%H A121304 Alois P. Heinz, <a href="/A121304/b121304.txt">Table of n, a(n) for n = 2..2000</a>
%F A121304 G.f.: (Sum_{i>=1} z^prime(i))/(1 - Sum_{i>=1} z^prime(i))^2.
%e A121304 a(8) = 17 because the compositions of 8 into primes are [3,5], [5,3], [2,3,3], [3,2,3], [3,3,2] and [2,2,2,2], having a total of 2+2+3+3+3+4 = 17 parts.
%p A121304 g:=sum(z^ithprime(i),i=1..53)/(1-sum(z^ithprime(i),i=1..53))^2: gser:=series(g,z=0,48): seq(coeff(gser,z,n),n=2..45);
%p A121304 # second Maple program:
%p A121304 b:= proc(n) option remember; `if`(n=0, [1, 0], add(
%p A121304       `if`(isprime(j), (p->p+[0, p[1]])(b(n-j)), 0), j=1..n))
%p A121304     end:
%p A121304 a:= n-> b(n)[2]:
%p A121304 seq(a(n), n=2..50);  # _Alois P. Heinz_, Nov 08 2013, revised Feb 12 2021
%t A121304 nn=40;a[x_]:=Sum[x^Prime[n],{n,1,nn}];Drop[CoefficientList[Series[D[1/(1-y a[x]),y]/.y ->1,{x,0,nn}],x],2] (* _Geoffrey Critzer_, Nov 08 2013 *)
%t A121304 Table[Length[Flatten[Union[Flatten[Permutations/@Select[ IntegerPartitions[ n], AllTrue[ #,PrimeQ]&],1]]]],{n,2,40}] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Oct 24 2016 *)
%t A121304 b[n_] := b[n] = If[n == 0, {1, 0}, Sum[If[PrimeQ[j],
%t A121304      Function[p, p+{0, p[[1]]}][b[n-j]], {0, 0}], {j, 1, n}]];
%t A121304 a[n_] := b[n][[2]];
%t A121304 a /@ Range[2, 50] (* _Jean-François Alcover_, Jun 01 2021, after _Alois P. Heinz_ *)
%Y A121304 Cf. A023360, A121303.
%K A121304 nonn
%O A121304 2,3
%A A121304 _Emeric Deutsch_, Aug 06 2006