login
A073698
a(n) is smallest prime not already in the sequence such that the sum of the first n terms is an n-th power.
4
2, 7, 503, 113, 7151, 109873, 162287, 2251875110689, 1423309560546093919, 1831931738588396657, 266306005917953213327, 13573982207668041076860262513, 4485809513902758532742979512207
OFFSET
1,1
LINKS
EXAMPLE
Sum of two terms 2+7 = 9 = 3^2. Sum of three terms 2+7+503 = 512 = 8^3.
MATHEMATICA
a[n_] := a[n]=Module[{sm, i}, sm=Sum[a[i], {i, 1, n-1}]; For[k=Ceiling[(sm+2)^(1/n)], !ProvablePrimeQ[k^n-sm]||MemberQ[a/@Range[n-1], k^n-sm], k++, Null]; k^n-sm] (* First do <<NumberTheory`PrimeQ` *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 12 2002
EXTENSIONS
Edited by Dean Hickerson, Dec 02 2002
STATUS
approved