OFFSET
1,1
COMMENTS
Prime complement of A098058. - Robert G. Wilson v, Jul 17 2015
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) ~ 2n log n. - Charles R Greathouse IV, Jun 29 2015
EXAMPLE
7 is a term since the next prime after 7 is 11 and 11-7 is divisible by 4.
MAPLE
N:= 1000: # to get all terms up to the second-last prime <= N
Primes:= select(isprime, [2, 2*i+1 $ i=1..floor((N-1)/2)]):
Gaps:= Primes[2..-1] - Primes[1..-2]:
Primes[select(t-> Gaps[t] mod 4 = 0, [$1..nops(Gaps)])]; # Robert Israel, Jun 24 2015
MATHEMATICA
Prime[Select[Range[150], Mod[Prime[ # + 1] - Prime[ # ], 4] == 0 &]] (* Ray Chandler, Oct 26 2006 *)
Transpose[Select[Partition[Prime[Range[200]], 2, 1], Divisible[Last[#]- First[#], 4]&]][[1]] (* Harvey P. Dale, Apr 06 2013 *)
PROG
(PARI) f(n) = for(x=1, n, z=(prime(x+1)-prime(x)); if(z%4==0, print1(prime(x)", ")))
(PARI) p=2; forprime(q=3, 1e4, if((q-p)%4==0, print1(p", ")); p=q) \\ Charles R Greathouse IV, Jun 29 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Sep 11 2004
EXTENSIONS
Edited by Ray Chandler, Oct 26 2006
New name from Robert Israel and Charles R Greathouse IV, Jun 29 2015
STATUS
approved