A217001 Numbers k such that (k^2 + k + 2)/4 is prime.
2, 6, 9, 14, 22, 25, 30, 33, 41, 46, 49, 54, 57, 62, 86, 89, 97, 113, 118, 121, 126, 134, 142, 161, 177, 198, 201, 209, 214, 217, 222, 225, 238, 254, 265, 273, 278, 286, 294, 302, 305, 310, 313, 321, 329, 337, 342, 350, 366, 393, 414, 417, 425, 441, 449, 470
Offset: 1
Examples
For k=2, (k^2 + k + 2)/4 = 2 is prime. Then 2 is in the sequence. For k=6, (k^2 + k + 2)/4 = 11 is prime. Then 6 is in the sequence. For k=5, (k^2 + k + 2)/4 = 8 is not prime. Then 5 is not in the sequence.
Links
- Daniel Starodubtsev, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A000040.
Programs
-
Maple
tn := unapply(n*(n+1)/2,n): f := unapply((t+1)/2,t): T := []: N := []: P := []: for k from 0 to 5000 do t:=tn(k): p := f(k): if p = floor(p) then p = floor(p): if isprime(p) then T := [op(T), t]: N := [op(N), k]: P := [op(P), p]: end if: end if: if nops(T) = 50 then break: end if: end do: N := N;
-
Mathematica
Select[Range[500], PrimeQ[(#^2 + # + 2)/4] &] (* T. D. Noe, Sep 24 2012 *)
-
PARI
is(n)=isprime((n^2+n+2)/4) \\ Charles R Greathouse IV, Jun 13 2017
Comments