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.

A028871 Primes of the form k^2 - 2.

This page as a plain text file.
%I A028871 #67 Feb 16 2025 08:32:35
%S A028871 2,7,23,47,79,167,223,359,439,727,839,1087,1223,1367,1847,2207,2399,
%T A028871 3023,3719,3967,4759,5039,5623,5927,7919,8647,10607,11447,13687,14159,
%U A028871 14639,16127,17159,18223,19319,21023,24023,25919,28559,29927
%N A028871 Primes of the form k^2 - 2.
%C A028871 Except for the initial term, primes equal to the product of two consecutive even numbers minus 1. - _Giovanni Teofilatto_, Sep 24 2004
%C A028871 With exception of the first term 2, primes p such that continued fraction of (1+sqrt(p))/2 have period 4. - _Artur Jasinski_, Feb 03 2010
%C A028871 Subsequence of A094786. First primes q that are in A094786 but not here are 241, 3373, 6857, 19681, 29789, 50651, 300761, 371291, ...; q+2 are perfect powers m^k with odd k>1. - _Zak Seidov_, Dec 09 2014
%D A028871 D. Shanks, Solved and Unsolved Problems in Number Theory, 2nd. ed., Chelsea, 1978, p. 31.
%H A028871 Nathaniel Johnston, <a href="/A028871/b028871.txt">Table of n, a(n) for n = 1..10000</a>
%H A028871 P. De Geest, <a href="https://www.worldofnumbers.com/consemor.htm">Palindromic Quasipronics of the form n(n+x)</a>
%H A028871 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Near-SquarePrime.html">Near-Square Prime</a>
%H A028871 Wikipedia, <a href="https://en.wikipedia.org/wiki/Bunyakovsky_conjecture">Bunyakovsky conjecture</a>
%F A028871 a(n) = A028870(n)^2 -2. - _R. J. Mathar_, Dec 12 2023
%p A028871 select(isprime, [2,seq((2*n+1)^2-2, n=1..1000)]); # _Robert Israel_, Dec 09 2014
%t A028871 lst={};Do[s=n^2;If[PrimeQ[p=s-2], AppendTo[lst, p]], {n, 6!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Sep 26 2008 *)
%t A028871 aa = {}; Do[If[4 == Length[ContinuedFraction[(1 + Sqrt[Prime[m]])/2][[2]]], AppendTo[aa, Prime[m]]], {m, 1, 1000}]; aa (* _Artur Jasinski_, Feb 03 2010 *)
%t A028871 Select[Table[n^2 - 2, {n, 400}], PrimeQ] (* _Vincenzo Librandi_, Jun 19 2014 *)
%o A028871 (PARI) list(lim)=select(n->isprime(n),vector(sqrtint(floor(lim)+2),k,k^2-2)) \\ _Charles R Greathouse IV_, Jul 25 2011
%o A028871 (Haskell)
%o A028871 a028871 n = a028871_list !! (n-1)
%o A028871 a028871_list = filter ((== 1) . a010051') a008865_list
%o A028871 -- _Reinhard Zumkeller_, May 06 2013
%o A028871 (Magma) [p: p in PrimesUpTo(100000)| IsSquare(p+2)]; // _Vincenzo Librandi_, Jun 19 2014
%Y A028871 Cf. A028870, A089623, A010051, A094786; subsequence of A008865.
%K A028871 nonn,easy
%O A028871 1,1
%A A028871 _Patrick De Geest_