OFFSET
1,2
COMMENTS
LINKS
René Gy, When the sum of the first n consecutive even (2k>0) powers is a prime number?, Math StackExchange.
EXAMPLE
2 belongs to the sequence since 1 + 2^(2*2) = 17 is a prime number which is larger than 2*2 + 1 = 5.
5 belongs to the sequence because 1 + 2^20 + 3^20 + 4^20 + 5^20 = 96470431101379 = 137*704163730667 has no prime divisor smaller than 2*5 + 3 = 13.
MATHEMATICA
lim = 330; listu = {};
listn = Select[Range[1, lim],
SquareFreeQ[# (# + 1) (2 # + 1)] &]; listL = {};
Do[M = (Transpose[FactorInteger[m (m + 1) (2 m + 1)]][[1]] - 1)/2;
L = 1; Do[L = LCM[L, j], {j, M}];
AppendTo[listL, L], {m, listn}]; list = Transpose[{listn, listL}];
Do[n = l[[1]]; L = l[[2]];
listp = Select[Range[n-1],
PrimeQ[#] && Mod[L, (# - 1)/2] == 0 &]; lp = Length[listp];
j = 1; While[j \[LessSlantEqual] lp, p = listp[[j]];
If[Mod[n - Floor[n/p], p] == 0, j = lp + 2, j = j + 1]];
If[j != lp + 2, AppendTo[listu, n]];
, {l, list}]; listu
CROSSREFS
KEYWORD
nonn
AUTHOR
René Gy, May 16 2021
STATUS
approved