cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A217001 Numbers k such that (k^2 + k + 2)/4 is prime.

Original entry on oeis.org

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

Views

Author

César Eliud Lozada, Sep 22 2012

Keywords

Comments

(A000217(a(n))+1)/2 is prime.

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.
		

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