OFFSET
1,1
COMMENTS
Fermat discovered, Gauss, Legendre and [1813] Cauchy proved that every integer is the sum of 7 heptagonal numbers (and there are some numbers which require all 7, the smallest being 13). 7 is the only prime heptagonal number. Primes which are sums of two positive heptagonal numbers include: {19, 41, 73, 89, 113, 149, 167, 193, 223, 229, 269, 293, 337, 347, 367, 383, 521, ...}. Primes which are sums of three positive heptagonal numbers include: {3, 37, 43, 53, 59, 83, 89, 107, 131, 137, 149, 163, 167, 173, 191, 197, 211, 227, 241, 251, 257, 263, 271, ...}. Primes which are sums of four positive heptagonal numbers include: {37, 43, 61, 71, 97, 101, 103, 107, 109, 113, 127, 149, 151, 167, 181, 191, 197, 199, 211, 223, 229, 239, 251, ...}.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..2000
FORMULA
MATHEMATICA
Module[{upto=150, max}, max=Ceiling[(3+Sqrt[9+40upto])/10]; Select[Total/@
Tuples[PolygonalNumber[7, Range[max]], 4]//Union, #<=upto&]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 15 2016 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Apr 18 2006
STATUS
approved