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.

A084143 Number of partitions of n into a sum of two or more consecutive primes.

This page as a plain text file.
%I A084143 #20 Feb 16 2025 08:32:49
%S A084143 0,0,0,0,1,0,0,1,0,1,0,1,0,0,1,0,1,1,0,0,0,0,1,1,0,1,0,1,0,1,1,0,0,0,
%T A084143 0,2,0,0,1,0,2,1,0,0,0,0,0,1,1,0,0,1,1,0,0,1,0,1,1,2,0,0,0,0,0,0,1,1,
%U A084143 0,0,1,2,0,0,1
%N A084143 Number of partitions of n into a sum of two or more consecutive primes.
%H A084143 T. D. Noe, <a href="/A084143/b084143.txt">Table of n, a(n) for n = 1..10000</a>
%H A084143 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimeSums.html">Prime Sums</a>
%F A084143 G.f.: Sum_{i>=1} Sum_{j>=i+1} Product_{k=i..j} x^prime(k). - _Emeric Deutsch_, Mar 30 2006
%e A084143 a(36)=2 because we have 36 = 17 + 19 = 5 + 7 + 11 + 13.
%p A084143 g:=sum(sum(product(x^ithprime(k),k=i..j),j=i+1..25),i=1..25): gser:=series(g,x=0,80): seq(coeff(gser,x,n),n=1..75); # _Emeric Deutsch_, Mar 30 2006
%p A084143 # alternative, _R. J. Mathar_, Aug 19 2020
%p A084143 A084143 := proc(n::integer)
%p A084143     local a,k,i,spr ;
%p A084143     a := 0 ;
%p A084143     for k from 2 do
%p A084143         if add(ithprime(i),i=1..k) > n then
%p A084143             break;
%p A084143         end if;
%p A084143         for i from 1 do
%p A084143             spr := add( ithprime(j),j=i..i+k-1) ;
%p A084143             if spr > n then
%p A084143                 break;
%p A084143             end if;
%p A084143             if spr = n then
%p A084143                 a := a +1 ;
%p A084143             end if;
%p A084143         end do:
%p A084143     end do:
%p A084143     a ;
%p A084143 end proc:
%t A084143 max = 25; gf = Sum[ Sum[ Product[ x^Prime[k], {k, i, j}], {j, i+1, max}], {i, 1, max}]; Rest[ CoefficientList[gf, x]][[1 ;; 75]] (* _Jean-François Alcover_, Oct 23 2012, after _Emeric Deutsch_ *)
%Y A084143 Cf. A084146, A084147.
%K A084143 nonn
%O A084143 1,36
%A A084143 _Eric W. Weisstein_, May 15 2003