login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A098058
Prime(n) such that 4 does not divide the difference between prime(n) and prime(n+1).
17
2, 3, 5, 11, 17, 23, 29, 31, 41, 47, 53, 59, 61, 71, 73, 83, 101, 107, 113, 131, 137, 139, 149, 151, 157, 167, 173, 179, 181, 191, 197, 227, 233, 239, 241, 251, 257, 263, 269, 271, 281, 283, 293, 311, 317, 331, 337, 347, 353, 367, 373, 383, 409, 419, 421, 431
OFFSET
1,1
COMMENTS
First differences are also not divisible by 4. - Zak Seidov, Jun 23 2015
Starting with 3, group the primes into runs of consecutive primes either all == 1 (mod 4) or all == 3 (mod 4). Only the last prime of each run appears in this sequence. Since the runs alternate == 1 (mod 4) and == 3 (mod 4), so do the members of this sequence. - Franklin T. Adams-Watters, Jun 23 2015
The sequence is infinite, by Dirichlet's theorem on primes in arithmetic progressions. The sequence contains arbitrarily long gaps, by Daniel Shiu's theorem on strings of congruent primes (see A057619 and A057622). Conjecture: The sequence contains arbitrarily long strings of consecutive primes (see A289118). - Jonathan Sondow, Jun 25 2017
REFERENCES
R. K. Guy, Unsolved Problems in Number Theory, A4.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Jens Kruse Andersen, Consecutive Congruent Primes
EXAMPLE
Prime(2) = 3, prime(3) = 5. 4 does not divide 5-3 so prime(2)=3 is in the sequence.
Runs: (3), (5), (7,11), (17), (19, 23), (29), (31), (37,41), (43,47), (53), ... The sequence is 2 followed by the last member of each run. Differences within each run are always divisible by 4.
MATHEMATICA
Prime[Select[Range[100], Mod[Prime[ # + 1] - Prime[ # ], 4] !=0 &]] (* Ray Chandler, Oct 09 2006 *)
PROG
(PARI) f(n) = for(x=1, n, z=(prime(x+1)-prime(x)); if(z%4, print1(prime(x)", ")))
(PARI) alist(n)=my(r=vector(n), p=2, np, k=0); while(k<n, np=nextprime(p+1); if((np-p)%4!=0, r[k++]=p); p=np); r \\ Franklin T. Adams-Watters, Jun 23 2015
(PARI) list(lim)=my(v=List(), p=2); forprime(q=3, nextprime(lim\1+1), if((q-p)%4, listput(v, p)); p=q); Vec(v) \\ Charles R Greathouse IV, Jun 24 2015
CROSSREFS
Sequence in context: A049596 A049571 A263090 * A040054 A093503 A040036
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Sep 11 2004
EXTENSIONS
Edited by Ray Chandler, Oct 26 2006
STATUS
approved