OFFSET
1,1
COMMENTS
a(n) mod 24 = 5 or 13 and if a(n) mod 24 =13 then a(n) mod 72 = 13.
From Artur Jasinski, Oct 30 2008: (Start)
Primes p such that the continued fraction of (1+sqrt(p))/2 has period 1.
Primes in A078370 = primes of the form 4*k^2 + 4*k + 5 = (2*k+1)^2 + 4.
(End)
Starting at a(3) all the primes in this sequence can be expressed as the following sum: ((2*k+1)*(2*k+3)+(2*k+3)*(2*k+5)+(2*k+5)+(2*k+7)+(2*k+7)*(2*k+9))/4 for some values (not all!) of k>=0. Thus for a(5)=173 the sum is (9*11 + 11*13 + 13*15 + 15*17)/4=173. - J. M. Bergot, Nov 03 2014
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..4600
D. Shanks, The simplest cubic fields, Math. Comp., 28 (1974), 1137-1152.
Eric Weisstein's World of Mathematics, Near-Square Prime
FORMULA
a(n) = 24*A056904(n)+m, where m=13 if A056904(n) is three times a triangular number (and n>0) and m=5 if A056904(n) is not three times a triangular number (or n=0).
For n>=2, a(n) = A098062(n-1). - Zak Seidov, Apr 12 2007
EXAMPLE
a(2)=29 since 29=5^2+4 is prime.
MAPLE
select(isprime, [seq(4*k^2 + 4*k + 5, k=0..1000)]); # Robert Israel, Nov 02 2014
MATHEMATICA
Intersection[Table[n^2+4, {n, 0, 10^2}], Prime[Range[9*10^3]]] ...or... For[i=4, i<=4, a={}; Do[If[PrimeQ[n^2+i], AppendTo[a, n^2+i]], {n, 0, 100}]; Print["n^2+", i, ", ", a]; i++ ] (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
aa = {}; Do[If[PrimeQ[4 k^2 + 4 k + 5], AppendTo[aa, 4 k^2 + 4 k + 5]], {k, 0, 200}]; aa (* Artur Jasinski, Oct 30 2008 *)
Select[Table[n^2+4, {n, 0, 7000}], PrimeQ] (* Vincenzo Librandi, Nov 30 2011 *)
PROG
(PARI) for(n=1, 1e3, if(isprime(t=n^2+4), print1(t", "))) \\ Charles R Greathouse IV, Jul 05 2011
(Magma) [a: n in [0..300] | IsPrime(a) where a is n^2+4]; // Vincenzo Librandi, Nov 30 2011
(Haskell)
a005473 n = a005473_list !! (n-1)
a005473_list = filter ((== 1) . a010051') $ map (+ 4) a000290_list
-- Reinhard Zumkeller, Mar 12 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms and additional comments from Henry Bottomley, Jul 06 2000
STATUS
approved