OFFSET
1,2
LINKS
Zak Seidov, Table of n, a(n) for n = 1..252
EXAMPLE
a(1) = 1 because 2*n + prime(n) = 2*1 + 2 = 4 = 2^2,
a(2) = 6 because 2*n + prime(n) = 2*6 + 13 = 25 = 5^2,
a(3) = 10 because 2*n + prime(n) = 2*10 + 29 = 49 = 7^2.
MATHEMATICA
Transpose[Select[Table[{2 n, Prime[n]}, {n, 25000}], IntegerQ[Sqrt[Total[#]]]&]][[1]]/2 (* Vincenzo Librandi, Mar 21 2015 *)
Select[Range[25000], IntegerQ[Sqrt[2*#+Prime[#]]]&] (* Harvey P. Dale, Jun 17 2018 *)
PROG
(Magma) [n: n in [1..3*10^4] | IsSquare(2*n + NthPrime(n))]; // Vincenzo Librandi, Mar 21 2015
(PARI) for(n=1, 10^4, if(issquare(2*n+prime(n)), print1(n, ", "))) \\ Derek Orr, Mar 22 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Mar 20 2015
STATUS
approved