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.

This page as a plain text file.
%I A049002 #31 Jul 02 2025 16:01:57
%S A049002 2,7,23,47,167,359,839,1367,1847,2207,3719,5039,7919,10607,11447,
%T A049002 16127,17159,19319,29927,36479,44519,49727,54287,57119,66047,85847,
%U A049002 97967,113567,128879,177239,196247,201599,218087,241079,273527,292679,323759
%N A049002 Primes of form p^2 - 2, where p is prime.
%H A049002 Amiram Eldar, <a href="/A049002/b049002.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from T. D. Noe)
%F A049002 a(n) = A062326(n)^2-2. - _Zak Seidov_, Apr 29 2015
%e A049002 127^2 - 2 = 16127.
%t A049002 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 *)
%t A049002 Select[Prime[Range[150]]^2 - 2, PrimeQ] (* _Vincenzo Librandi_, Apr 29 2015 *)
%o A049002 (PARI) lista(nn) = forprime(p=1, nn, if (isprime(q=p^2-2), print1(q, ", "))); \\ _Michel Marcus_, Jan 08 2015
%o A049002 (Sage)
%o A049002 a = lambda p: p^2-2
%o A049002 [a(p) for p in primes(600) if is_prime(a(p))] # _Bruno Berselli_, Apr 29 2015
%o A049002 (Magma) [a: p in PrimesUpTo(1000) | IsPrime(a) where a is p^2-2 ]; // _Vincenzo Librandi_, Apr 29 2015
%o A049002 (Haskell)
%o A049002 a049002 n = a049002_list !! (n-1)
%o A049002 a049002_list = filter ((== 1) . a010051') a049001_list
%o A049002 -- _Reinhard Zumkeller_, Jul 30 2015
%Y A049002 Primes in A049001.
%Y A049002 Cf. A062326 (values of p).
%Y A049002 Cf. A010051.
%K A049002 nonn,easy
%O A049002 1,1
%A A049002 Herman H. Rosenfeld (herm3(AT)pacbell.net)
%E A049002 More terms from _James Sellers_