OFFSET
1,2
COMMENTS
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1)=abs(3*1-1-(3*1+1/2-1/2))=1; a(2)=abs(3*2-1-(3*2+1/2+1/2))=2.
MAPLE
Contribution from R. J. Mathar, Apr 24 2010: (Start)
A003627 := proc(n) if n <= 2 then op(n, [2, 5]) ; ; else for a from procname(n-1)+2 by 2 do if isprime(a) and (a mod 3) =2 then return a ; end if; end do: end if; end proc:
A007645 := proc(n) if n <= 2 then op(n, [3, 7]) ; ; else for a from procname(n-1)+2 by 2 do if isprime(a) and (a mod 3) <> 2 then return a ; end if; end do: end if; end proc:
MATHEMATICA
Module[{nn=500, p1, p2, len}, p1=Select[3*Range[nn]-1, PrimeQ]; p2=Select[Flatten[#+{0, 1}&/@ (3*Range[nn])], PrimeQ]; len=Min[Length[p1], Length[p2]]; Abs[#[[1]]-#[[2]]]&/@ Thread[ {Take[p1, len], Take[p2, len]}]] (* Harvey P. Dale, Aug 29 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Dec 17 2009, Feb 09 02 2010.
EXTENSIONS
Entries checked by R. J. Mathar, Apr 24 2010
STATUS
approved