A191837 Least even number m which can be written as sum of 2n primes p(1) < ... < p(2n) < m/2 such that m-p(i) is also prime for i=1,...,2n.
48, 108, 204, 324, 624, 630, 1050, 1320, 1590, 2100, 2400, 2730, 3570, 3960, 4830, 5460, 5880, 6930, 7770, 9240, 9450, 11970, 12810, 13020, 14910, 14910, 17430, 18480, 20160, 21630, 23100, 24150, 28770, 28770, 31290, 32760, 32760, 36960, 36960, 39270, 39270, 50190, 51870, 51870
Offset: 2
Keywords
Examples
For 48, we have 48=5+43=7+41=17+31=19+29 (ignoring 11+37), and use 5+7+17+19 to give the first even number having four such primes summing to itself. Similarly, 108 is the least even number with six prime elements summing to itself: 5+103=7+101=11+97=19+89=29+79=37+71 and taking 5+7+11+19+29+37=108. a(2) = 48 = 5+7+17+19 = 7+11+13+17 a(3) = 108 = 5+7+11+19+29+37 a(9) = 1320 = 13+17+19+23+29+31+37+41+43+61+71+83+89+97+103+107+149+307
Links
- J. Stauduhar, Table of n, a(n) for n = 2..2500
- J. Stauduhar, C program to generate sequence A191837
Programs
-
Mathematica
nCk[a_, b_]:=Block[{ndx=ns= a, i=rs=b, ct=t=0}, If[(d[[1]]-1)==(ns-rs), For[ct=1, ct<=rs, ct++, t+=s[[d[[ct]]]]]; If[t==m, Print[sm/2, " ", t]; sm+=2; m-=6; Return[False], Return[False]]]; While[d[[i]]==ndx && i>1, --i; --ndx]; d[[i]]+=1; i++; While[i<=rs, d[[i]]=d[[i-1]]+1; ++i;]; For[ct=1, ct<=rs, ct++, t+=s[[d[[ct]]]]; If[t>m, Break[]]]; If[t==m, Print[sm/2, " ", t]; sm+=2; m-=6; Return[False]]; Return[True]]; For[sm=4; m=6, sm<=60, m+=6, s={}; sum=smndct=pct=0; For[p=5, p
m, Break[]]; If[smndct++ = sm, d=Range[sm]; While[nCk[Length[s], sm]]]]; (* J. Stauduhar, Sep 07 2012*) -
PARI
a(n)=forstep(m=2,1e9,2,L=[]; forprime(p=1,m\2-1,isprime(m-p)||next;L=concat(L,p)); #L<2*n&next; sum(i=#L-2*n+1,#L,L[i])
Extensions
a(4)-a(5) from M. F. Hasler, Jun 21 2011
a(2) to a(5) verified; a(6) to a(10) added by S Kolman, Jul 03 2011
a(11) to a(13) added by S Kolman, Jul 04 2011
a(14) to a(14) added by S Kolman, Jul 05 2011
Confirmed a(7). a(6) corrected by J. Stauduhar, Jul 08 2011
Corrected a(8)-a(14) and extended to a(2500). - J. Stauduhar, Jul 12 2011
Edited by J. Stauduhar, Aug 28 2012
Comments