OFFSET
1,2
COMMENTS
Also, numbers n such that the sum of the first n cubes precedes a prime.
EXAMPLE
1 is in the sequence because ((1^2 + 1)/2)^2 + 1 = 2 and 2 is prime;
3 is in the sequence because ((3^2 + 3)/2)^2 + 1 = 37 and 37 is prime.
MATHEMATICA
Select[Range[400], PrimeQ[((#^2 + #)/2)^2 + 1] &] (* Alonso del Arte, Mar 26 2013 *)
PROG
(PARI) for(n=1, 10^3, if(isprime(((n^2 + n)/2)^2 + 1), print1(n, ", "))); /* Joerg Arndt, Mar 27 2013 */
(Magma) [n: n in [1..500] | IsPrime(s+1) where s is (n^2+n)^2 div 4]; // Bruno Berselli, Mar 27 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Luca Brigada Villa, Mar 26 2013
STATUS
approved