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.

A049002 Primes of form p^2 - 2, where p is prime.

Original entry on oeis.org

2, 7, 23, 47, 167, 359, 839, 1367, 1847, 2207, 3719, 5039, 7919, 10607, 11447, 16127, 17159, 19319, 29927, 36479, 44519, 49727, 54287, 57119, 66047, 85847, 97967, 113567, 128879, 177239, 196247, 201599, 218087, 241079, 273527, 292679, 323759
Offset: 1

Views

Author

Herman H. Rosenfeld (herm3(AT)pacbell.net)

Keywords

Examples

			127^2 - 2 = 16127.
		

Crossrefs

Primes in A049001.
Cf. A062326 (values of p).
Cf. A010051.

Programs

  • Haskell
    a049002 n = a049002_list !! (n-1)
    a049002_list = filter ((== 1) . a010051') a049001_list
    -- Reinhard Zumkeller, Jul 30 2015
  • Magma
    [a: p in PrimesUpTo(1000) | IsPrime(a) where a is p^2-2 ]; // Vincenzo Librandi, Apr 29 2015
    
  • Mathematica
    f[n_]:=n^2-2; lst={};Do[p=Prime[n];If[PrimeQ[f[p]],AppendTo[lst,f[p]]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 16 2009 *)
    Select[Prime[Range[150]]^2 - 2, PrimeQ] (* Vincenzo Librandi, Apr 29 2015 *)
  • PARI
    lista(nn) = forprime(p=1, nn, if (isprime(q=p^2-2), print1(q, ", "))); \\ Michel Marcus, Jan 08 2015
    
  • Sage
    a = lambda p: p^2-2
    [a(p) for p in primes(600) if is_prime(a(p))] # Bruno Berselli, Apr 29 2015
    

Formula

a(n) = A062326(n)^2-2. - Zak Seidov, Apr 29 2015

Extensions

More terms from James Sellers