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-4 of 4 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

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

A289119 Least prime beginning a string, of length at least n, of consecutive primes which alternate between types 6*k+1 and 6*k+5 or 6*k+5 and 6*k+1.

Original entry on oeis.org

5, 5, 5, 5, 5, 5, 5, 89, 89, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 3954889, 15186319, 15186319, 15186319, 77011289, 77011289, 77011289, 288413159, 288413159, 288413159, 288413159, 288413159, 62585146739, 114058236679, 143014298809
Offset: 1

Views

Author

Jonathan Sondow, Jun 25 2017

Keywords

Comments

Conjecture: the sequence is infinite. (Motivation: the string HTHTHT... of length n eventually occurs in any sufficiently long sequence of coin tosses.)

Examples

			For k = 3, 4, ..., 33, {Prime[k], Mod[Prime[k], 6]} = {5, 5}, {7, 1}, {11, 5}, {13, 1}, {17, 5}, {19, 1}, {23, 5}, {29, 5}, {31, 1}, {37, 1}, {41, 5}, {43, 1}, {47, 5}, {53, 5}, {59, 5}, {61, 1}, {67,  1}, {71, 5}, {73, 1}, {79, 1}, {83, 5}, {89, 5}, {97, 1}, {101, 5}, {103, 1}, {107, 5}, {109, 1}, {113, 5}, {127, 1}, {131, 5}, {137, 5}, so a(n) = 5, 5, 5, 5, 5, 5, 5, 89, 89 for n = 1, 2, ..., 9 with a(10) > 89.
		

References

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

Crossrefs

Programs

  • Mathematica
    j = 3; T = Table[ While[ Product[ Mod[ Prime[k + 1] - Prime[k], 6], {k, j, j + n}] == 0, j++]; Prime[j], {n, 0, 20}]; Prepend[T, 5]

Extensions

a(23)-a(36) from Giovanni Resta, Jun 29 2017

A289237 Find the first (maximal) string, of length exactly n, of consecutive primes that alternate between types 6*k+1 and 6*k+5 or 6*k+5 and 6*k+1. The first element is a(n).

Original entry on oeis.org

53, 29, 67, 37, 449, 179, 5, 389, 89, 2213, 11149, 10369, 6761, 113341, 80447, 151909, 43777, 2964553, 1457333, 175573, 809, 3954889, 121930481, 96050953, 15186319, 296080717, 98380549, 77011289, 2720227693, 5696814287, 1572386903, 4136299357, 288413159
Offset: 1

Views

Author

Jonathan Sondow, Jun 28 2017

Keywords

Comments

By the first Formula, a(21) = 809 since A289119(21) = 809 < A289119(22).

Examples

			{Prime[k], Mod[Prime[k], 6]} = {2, 2}, {3, 3}, {5, 5}, {7, 1}, {11, 5}, {13, 1}, {17, 5}, {19, 1}, {23, 5}, {29, 5}, {31, 1}, {37, 1}, {41, 5}, {43, 1}, {47, 5}, {53, 5}, {59, 5}, {61, 1}, {67,  1}, {71, 5}, {73, 1}, {79, 1}, . ., so a(n) = 53, 29, 67, 37 for n = 1, 2, 3, 4 and a(7) = 5.
		

References

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

Crossrefs

Programs

  • Mathematica
    i = 2; While[ Mod[ Prime[i] - Prime[i - 1], 6] != 0 || Mod[ Prime[i + 1] - Prime[i], 6] != 0, i++]; T = {Prime[i]}; Do[j = 3; While[ ! (Product[ Mod[ Prime[k + 1] - Prime[k], 6], {k, j, j + n}] != 0 && (Mod[ Prime[j] - Prime[j - 1], 6] == 0 || j == 3) && Mod[ Prime[j + n + 2] - Prime[j + n + 1], 6] == 0), j++]; T = Append[T, Prime[j]], {n, 0, 16}]; T

Formula

a(n) = A289119(n) if and only if n > 1 and A289119(n) < A289119(n+1).

Extensions

a(19)-a(33) from Giovanni Resta, Jun 29 2017
Showing 1-4 of 4 results.