OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..6214
FORMULA
EXAMPLE
405 is in the list because it is composite and
405 = 202 + 203 (Sum of two consecutive composite numbers)
405 = 134 + 135 + 136 (Sum of three consecutive composite numbers)
405 = 99 + 100 + 102 + 104 (Sum of four consecutive composite numbers)
405 = 78 + 80 + 81 + 82 + 84 (Sum of five consecutive composite numbers).
MAPLE
N:= 10^5: # for terms <= N
Comps:= remove(isprime, [$2..N]):
PSComps:= [0, op(ListTools:-PartialSums(Comps))]:
C2:= convert(PSComps[3..-1]-PSComps[1..-3], set):
C3:= convert(PSComps[4..-1]-PSComps[1..-4], set):
C4:= convert(PSComps[5..-1]-PSComps[1..-5], set):
C5:= convert(PSComps[6..-1]-PSComps[1..-6], set):
R:= convert(Comps, set) intersect C2 intersect C3 intersect C4 intersect C5:
sort(convert(R, list)); # Robert Israel, Aug 17 2020
MATHEMATICA
CompositeNext[n_]:=Module[{k=n+1}, While[PrimeQ[k], k++ ]; k]; q=8!; lst2={}; Do[If[ !PrimeQ[n], c=CompositeNext[n]; a2=n+c; If[ !PrimeQ[a2], AppendTo[lst2, a2]]], {n, q}]; lst2; lst3={}; Do[If[ !PrimeQ[n], c1=CompositeNext[n]; c2=CompositeNext[c1]; a3=n+c1+c2; If[ !PrimeQ[a3], AppendTo[lst3, a3]]], {n, q}]; lst3; lst4={}; Do[If[ !PrimeQ[n], c1=CompositeNext[n]; c2=CompositeNext[c1]; c3=CompositeNext[c2]; a4=n+c1+c2+c3; If[ !PrimeQ[a4], AppendTo[lst4, a4]]], {n, q}]; lst4; lst5={}; Do[If[ !PrimeQ[n], c1=CompositeNext[n]; c2=CompositeNext[c1]; c3=CompositeNext[c2]; c4=CompositeNext[c3]; a5=n+c1+c2+c3+c4; If[ !PrimeQ[a5], AppendTo[lst5, a5]]], {n, q}]; lst5; Intersection[lst2, lst3, lst4, lst5] (* Vladimir Joseph Stephan Orlovsky, Jun 17 2009 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Claudio Meller, Jun 15 2009
EXTENSIONS
Corrected and extended by Harvey P. Dale, Nov 25 2014
Corrected by Robert Israel, Aug 17 2020
STATUS
approved