login
a(n) = A002144(n) - A002145(n).
2

%I #20 May 20 2015 19:52:36

%S 2,6,6,10,14,10,10,14,14,22,26,22,26,10,30,22,26,34,30,30,30,50,42,42,

%T 46,46,50,42,42,50,46,54,42,42,42,42,38,34,30,38,14,18,18,18,46,54,62,

%U 70,78,78,90,78,66,54,70,66,62,66,58,70,66,86,98,78,78,54,70,70,78,78

%N a(n) = A002144(n) - A002145(n).

%C a(n) = A108546(2*n+1) - A108546(2*n).

%H Ivan Neretin, <a href="/A102261/b102261.txt">Table of n, a(n) for n = 1..30000</a>

%p A002144 := proc(n) option remember ; if n = 1 then RETURN(5) ; fi; for a from procname(n-1)+2 do if isprime(a) and (a mod 4 = 1 ) then RETURN(a) ; fi; od: end; A002145 := proc(n) option remember ; if n = 1 then RETURN(3) ; fi; for a from procname(n-1)+2 do if isprime(a) and (a mod 4 = 3 ) then RETURN(a) ; fi; od: end; A102261 := proc(n) A002144(n)-A002145(n) ; end: seq(A102261(n),n=1..120) ; # _R. J. Mathar_, Feb 07 2009

%t nmax = 70; a1 = Select[Range[1, Prime[3*nmax], 4], PrimeQ]; a3 = Select[Range[3, Prime[3*nmax], 4], PrimeQ]; a[n_] := a1[[n]] - a3[[n]]; Table[a[n], {n, 1, nmax}] (* _Jean-François Alcover_, Dec 17 2013 *)

%K sign,look

%O 1,1

%A _Paul Curtz_, Sep 06 2008

%E Edited by _N. J. A. Sloane_, Sep 06 2008

%E More terms from _R. J. Mathar_, Feb 07 2009