login
A084143
Number of partitions of n into a sum of two or more consecutive primes.
14
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, 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, 0, 0, 1, 2, 0, 0, 1
OFFSET
1,36
LINKS
Eric Weisstein's World of Mathematics, Prime Sums
FORMULA
G.f.: Sum_{i>=1} Sum_{j>=i+1} Product_{k=i..j} x^prime(k). - Emeric Deutsch, Mar 30 2006
EXAMPLE
a(36)=2 because we have 36 = 17 + 19 = 5 + 7 + 11 + 13.
MAPLE
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
# alternative, R. J. Mathar, Aug 19 2020
A084143 := proc(n::integer)
local a, k, i, spr ;
a := 0 ;
for k from 2 do
if add(ithprime(i), i=1..k) > n then
break;
end if;
for i from 1 do
spr := add( ithprime(j), j=i..i+k-1) ;
if spr > n then
break;
end if;
if spr = n then
a := a +1 ;
end if;
end do:
end do:
a ;
end proc:
MATHEMATICA
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 *)
CROSSREFS
Sequence in context: A349433 A346478 A346250 * A025888 A145708 A138532
KEYWORD
nonn
AUTHOR
Eric W. Weisstein, May 15 2003
STATUS
approved