cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-5 of 5 results.

A098058 Prime(n) such that 4 does not divide the difference between prime(n) and prime(n+1).

Original entry on oeis.org

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

Views

Author

Cino Hilliard, Sep 11 2004

Keywords

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

Examples

			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.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, A4.

Crossrefs

Programs

  • Mathematica
    Prime[Select[Range[100], Mod[Prime[ # + 1] - Prime[ # ], 4] !=0 &]] (* Ray Chandler, Oct 09 2006 *)
  • 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(kFranklin 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

Extensions

Edited by Ray Chandler, Oct 26 2006

A330561 a(n) = number of primes p <= prime(n) with Delta(p) == 0 (mod 4), where Delta(p) = nextprime(p) - p.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 15, 16, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 21, 21, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 26, 27, 27, 27, 27, 27
Offset: 1

Views

Author

N. J. A. Sloane, Dec 30 2019

Keywords

Crossrefs

Cf. A098059.
Sequences related to the differences between successive primes: A001223 (Delta(p)), A028334, A080378, A104120, A330556, A330557, A330558, A330559, A330560.

Programs

  • Magma
    [#[p:p in PrimesInInterval(1,NthPrime(n))|IsIntegral((NextPrime(p)-p)/4)]:n in [1..80]]; // Marius A. Burtea, Dec 31 2019
  • Maple
    N:= 200: # for a(1)..a(N)
    P:= [seq(ithprime(i),i=1..N+1)]:
    Delta:= P[2..-1]-P[1..-2] mod 4:
    R:= map(charfcn[0],Delta):
    ListTools:-PartialSums(R); # Robert Israel, Dec 31 2019
  • Mathematica
    Accumulate[Map[Boole[Mod[#, 4] == 0]&, Differences[Prime[Range[100]]]]] (* Paolo Xausa, Feb 05 2024 *)

A247384 Find the first (maximal) string of consecutive primes of length exactly n which alternate between 4*k+1 and 4*k+3 or 4*k+3 and 4*k+1 as in A002144(4*n+1) and A002145(4*n+3). The first element is a(n).

Original entry on oeis.org

97, 11, 3, 23, 47, 167, 131, 2011, 233, 23633, 34499, 1013, 9341, 90659, 521, 51749, 505049, 1391087, 2264839, 2556713, 17123893, 2569529, 15090641, 18246451, 6160043, 1557431471, 43679609, 198572029, 701575297, 5552898499, 6639843979, 61233611783, 9005520203
Offset: 1

Views

Author

J. M. Bergot, Sep 15 2014

Keywords

Examples

			a(4)=23 because 23,29,31,37 alternate 4*n+3,4*n+1,4*n+3,4*n+1 for exactly four primes and 23 is the least prime for a string of exactly four.
		

Crossrefs

Programs

  • Maple
    Primes:= select(isprime,[seq(2*i+1,i=1..10^7)]):
    Pm4:= map(`modp`,[seq((-1)^j*Primes[j],j=1..nops(Primes))],4):
    Starts:= [1,op(select(t -> Pm4[t-1]<> Pm4[t], [$2..nops(Pm4)]))]:
    Lengths:= [seq(Starts[i+1]-Starts[i],i=1..nops(Starts)-1)]:
    for i from 1 to max(Lengths) do A[i]:= ListTools:-Search(i,Lengths) od:
    R:=[seq(A[i],i=1..max(Lengths))]:
    seq(`if`(a=0,0,Primes[Starts[a]]),a=R); # Robert Israel, Sep 15 2014
  • Mathematica
    i = 2; While[ Mod[ Prime[i] - Prime[i - 1], 4] != 0 || Mod[ Prime[i + 1] - Prime[i], 4] != 0, i++]; T = {Prime[i]}; Do[j = 2; While[! (Product[ Mod[ Prime[k + 1] - Prime[k], 4], {k, j, j + n}] != 0 && (Mod[Prime[j] - Prime[j - 1], 4] == 0 || j == 2) && Mod[ Prime[j + n + 2] - Prime[j + n + 1], 4] == 0), j++]; T = Append[T, Prime[j]], {n, 0, 13}]; T (* Jonathan Sondow, Jun 28 2017 *)
  • PARI
    v=vector(100);v[1]=7;cur=1;p=3;forprime(q=5, 1e10, if((q-p)%4==0,if(!v[cur],v[cur]=back(p,cur);print("a("cur") = "v[cur]));cur=1,cur++);p=q) \\ Charles R Greathouse IV, Sep 15 2014

Formula

a(n) = A289118(n) if and only if n > 1 and A289118(n) < A289118(n+1). - Jonathan Sondow, Jun 27 2017

Extensions

More terms from Jens Kruse Andersen, Oct 01 2014
Definition clarified by Jonathan Sondow, Jun 25 2017

A259360 Initial prime in the least set of exactly n+1 consecutive primes with n gaps all multiples of 4.

Original entry on oeis.org

7, 89, 199, 883, 12401, 463, 36551, 11593, 183091, 766261, 3358169, 241603, 11739307, 9177431, 12270077, 105639091, 310523021, 297779117, 727334879, 5344989829, 1481666377, 2572421893, 1113443017, 79263248027, 84676452781
Offset: 1

Views

Author

Zak Seidov, Jun 24 2015

Keywords

Examples

			a(6)=463 because the first set of 7 consecutive primes is {463,467,479,487,491,499,503} with 6 gaps {4,12,8,4,8,4} all multiples of 4 while the next prime after 503 is 509 and 509-503=6 is not a multiple of 4.
		

Crossrefs

Programs

  • PARI
    back(p,n)=while(n,p=precprime(p-1); n--); p
    v=vector(20); g=0; p=2; forprime(q=3,1e6, if((q-p)%4, if(g&&g<=#v&&v[g]==0, v[g]=back(p,g)); g=0, g++);p=q); v \\ Charles R Greathouse IV, Jul 14 2015

Extensions

a(13)-a(14) corrected by Charles R Greathouse IV, Jul 14 2015
a(24)-a(25) by Zak Seidov, Jul 15 2015

A152087 Primes p such that q - p is not squarefree, where q is the next prime immediately following p.

Original entry on oeis.org

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, 523, 613, 619, 643, 661, 673, 683, 701, 719, 739, 743, 757, 761, 769, 797, 823, 853
Offset: 1

Views

Author

Leroy Quet, Nov 23 2008

Keywords

Comments

This sequence contains all terms of A098059 and also contains those primes (p) that differ from the next higher primes (q) by nonsquarefree integers congruent to 2 (mod 4).

Crossrefs

Cf. A098059.

Extensions

Extended by Ray Chandler, Nov 26 2008
Showing 1-5 of 5 results.