A098059 Primes preceding gaps divisible by 4.
7, 13, 19, 37, 43, 67, 79, 89, 97, 103, 109, 127, 163, 193, 199, 211, 223, 229, 277, 307, 313, 349, 359, 379, 389, 397, 401, 439, 449, 457, 463, 467, 479, 487, 491, 499, 509, 613, 619, 643, 661, 673, 683, 701, 719, 739, 743, 757, 761, 769, 797, 823, 853, 859
Offset: 1
Examples
7 is a term since the next prime after 7 is 11 and 11-7 is divisible by 4.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
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
Formula
a(n) ~ 2n log n. - Charles R Greathouse IV, Jun 29 2015
Extensions
Edited by Ray Chandler, Oct 26 2006
New name from Robert Israel and Charles R Greathouse IV, Jun 29 2015
Comments