OFFSET
1,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
MATHEMATICA
terms = 60; A111745 = Module[{prs = Prime[Range[2terms]], m3, m1, min}, m3 = Select[prs, Mod[#, 4] == 3&]; m1 = Select[prs, Mod[#, 4] == 1&]; min = Min[Length[m1], Length[m3]]; Riffle[Take[m3, min], Take[m1, min]]]; a[1] = 2; a[n_] := A111745[[n-1]]; Table[a[n], {n, 1, terms}] (* Jean-François Alcover, May 18 2017, using Harvey P. Dale's code for A111745 *)
PROG
(Haskell)
import Data.List (transpose)
a108546 n = a108546_list !! (n-1)
a108546_list = 2 : concat
(transpose [a002145_list, a002144_list])
-- Reinhard Zumkeller, Nov 13 2014, Feb 22 2011
(PARI)
up_to = 10000;
A108546list(up_to) = { my(v=vector(up_to), p, q); v[1] = 2; v[2] = 3; v[3] = 5; for(n=4, up_to, p = v[n-2]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[n] = q); (v); };
v108546 = A108546list(up_to);
A108546(n) = v108546[n]; \\ Antti Karttunen, Feb 27 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jun 10 2005
STATUS
approved