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.

A247967 a(n) is the smallest k such that prime(k+i) (mod 6) takes successively the values 5, 5, ... for i = 0, 1, ..., n-1.

Original entry on oeis.org

3, 9, 15, 54, 290, 987, 4530, 21481, 58554, 60967, 136456, 136456, 673393, 1254203, 1254203, 7709873, 21357253, 21357253, 25813464, 25813464, 39500857, 39500857, 947438659, 947438659, 947438659, 5703167678, 5703167678, 16976360924, 68745739764, 117327812949
Offset: 1

Views

Author

Michel Lagneau, Sep 28 2014

Keywords

Comments

Weakening the definition to prime(k+i) == 2 (mod 3) yields a(1) = 1, but all other terms are unchanged. See also A247816 (residue 5) or A276414 (equal residues, all 1 or all -1). - M. F. Hasler, Sep 02 2016

Examples

			a(1)= 3 => prime(3) == 5 (mod 6).
a(2)= 9 => prime(9) == 5 (mod 6), prime(10) == 5 (mod 6).
a(3)= 15 => prime(15) == 5 (mod 6), prime(16) == 5 (mod 6), prime(17) == 5 (mod 6).
From _Michel Marcus_, Sep 30 2014: (Start)
The resulting primes are:
  5;
  23, 29;
  47, 53, 59;
  251, 257, 263, 269;
  1889, 1901, 1907, 1913, 1931;
  7793, 7817, 7823, 7829, 7841, 7853;
  43451, 43457, 43481, 43487, 43499, 43517, 43541;
  243161, 243167, 243197, 243203, 243209, 243227, 243233, 243239;
  ... (End)
		

Crossrefs

Programs

  • MATLAB
    N = 2*10^8; % to use primes up to N
    P = mod(primes(N),6);
    P5 = find(P==5);
    n5 = numel(P5);
    a(1) = P5(1);
    for k = 2:100
      r = find(P5(k:n5) == P5(1:n5+1-k)+k-1,1,'first');
      if numel(r) == 0
         break
      end
      a(k) = P5(r);
    end
    a % Robert Israel, Sep 02 2016
  • Maple
    for n from 1 to 22 do :
    ii:=0:
       for k from 3 to 10^5 while (ii=0)do :
         s:=0:
          for i from 0 to n-1 do:
            r:=irem(ithprime(k+i),6):
            if r = 5
            then
            s:=s+1:
            else
            fi:
          od:
           if s=n and ii=0
           then
           printf ( "%d %d \n",n,k):ii:=1:
           else
           fi:
        od:
    od:
  • Mathematica
    Table[k = 1; While[Times @@ Boole@ Map[Mod[Prime[k + #], 6] == 5 &, Range[0, n - 1]] == 0, k++]; k, {n, 10}] (* Michael De Vlieger, Sep 02 2016 *)
  • PARI
    a(n) = {k = 1; ok = 0; while (!ok, nb = 0; for (i=0, n-1, if (prime(k+i) % 6 == 5, nb++, break);); if (nb == n, ok=1, k++);); k;} \\ Michel Marcus, Sep 28 2014
    
  • PARI
    m=c=i=0;forprime(p=1,, i++;p%6!=5&&(!c||!c=0)&&next; c++>m||next; print1(1+i-m=c,",")) \\ M. F. Hasler, Sep 02 2016
    

Formula

a(n) = primepi(A057622(n)). - Michel Marcus, Oct 01 2014

Extensions

a(11)-a(22) from A057622 by Michel Marcus, Oct 03 2014
a(23)-a(25) from Jinyuan Wang, Jul 08 2019
a(26)-a(30) added using A057622 by Jinyuan Wang, Apr 15 2020

A276414 Index of the first prime which starts a run of n consecutive primes all congruent to each other mod 3 (or mod 6).

Original entry on oeis.org

1, 9, 15, 54, 271, 271, 2209, 11199, 13717, 13717, 34369, 136456, 172146, 1254203, 1254203, 4308948, 12762142, 21357253, 25813464, 25813464, 39500857, 39500857, 947438659, 947438659, 947438659, 5703167678, 5703167678, 16976360924, 57446769091, 57446769091, 57446769091
Offset: 1

Views

Author

M. F. Hasler, Sep 02 2016

Keywords

Comments

First term of runs of increasing length of consecutive integers in A270190. - M. F. Hasler, Sep 03 2016

Examples

			prime(9) = 23 starts the first run of 2 consecutive primes, {23, 29}, which are congruent to each other (mod 6). Therefore a(2) = 9.
prime(15) = 47 starts the first run of 3 consecutive primes, {47, 53, 59}, which are congruent to each other (mod 6). Therefore a(3) = 15.
prime(54) = 251 starts the first run of 4 consecutive primes, {251, 257, 263, 269}, which are congruent to each other (mod 6). Therefore a(4) = 54.
prime(271) = 1741 starts the first run of 5 consecutive primes, {1741, 1747, 1753, 1759, 1777}, which are congruent to each other (mod 6). Therefore a(5) = 271. This is the first case where the primes are of the form 3k+1.
prime(271) = 1741 also starts the first run of 6 consecutive primes, {1741, 1747, 1753, 1759, 1777, 1783}, which are all congruent to each other (mod 6). Therefore a(6) = 271, too.
		

Crossrefs

Subsequence of A270190 (after discarding 1 and duplicates of other terms).

Programs

  • PARI
    m=c=i=o=0;print1(1);forprime(p=1,,i++;(o-o=p)%3&&(!c||!c=0)&&next;c++>m||next;print1(",",i-m=c))

Formula

a(n) = A000720(A054679(n)).

Extensions

a(30)-a(31) from and name clarified by Jinyuan Wang, Feb 24 2020

A247969 a(n) is the smallest k such that prime(k+i) (mod 6) takes successively the values 1,5,1,5,... for i = 0, 1,...,n-1 ending with 1 or 5.

Original entry on oeis.org

4, 4, 4, 4, 4, 4, 25, 25, 59, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 280230, 280230, 981960, 981960, 981960, 4505195, 4505195, 7438440, 15658002, 15658002, 15658002, 15658002, 2628111621, 4671618380, 4671618380, 5803722576, 5803722576, 5803722576
Offset: 1

Views

Author

Michel Lagneau, Sep 28 2014

Keywords

Examples

			a(1)= 4 => prime(4) (mod 6)= 1, and not for k = 1, 2, 3.
a(2)= 4 => prime(4) (mod 6)= 1, prime(5) (mod 6) = 5;
a(3)= 4 => prime(4) (mod 6)= 1, prime(5) (mod 6)= 5, prime(6) (mod 6)= 1.
The corresponding primes are for
n= 6: 7, 11, 13, 17, 19, 23;
n= 8: 97, 101, 103, 107, 109, 113, 127, 131;
n= 9: 277, 281, 283, 293, 307, 311, 313, 317, 331;
n= 20: 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941. - _Michel Marcus_, Sep 29 2014
		

Crossrefs

Programs

  • Maple
    for n from 1 to 21 do :
    ii:=0:
       for k from 3 to 10^5 while (ii=0)do :
         s:=0:
          for i from 0 to n-1 do:
            r:=irem(ithprime(k+i),6):
            if r = irem(5^i,6)
            then
            s:=s+1:
            else
            fi:
          od:
           if s=n and ii=0
           then
           printf ( "%d %d \n",n,k):ii:=1:
           else
           fi:
        od:
    od:
  • PARI
    a(n) = {k = 1; ok = 0; while (! ok, m = 1; nb = 0; for (i=0, n-1, if ((prime(k+i) % 6) == m, nb++, break); m = 5*m % 6;); if (nb == n, ok = 1, k++);); k;} \\ Michel Marcus, Sep 29 2014
    
  • PARI
    See Links section.

Extensions

More terms from Rémy Sigrist, Oct 18 2020

A247970 a(n) is the smallest k such that prime(k+i) (mod 6) takes successively the values 5,1,5,1... for i = 0, 1,...,n-1 ending with 1 or 5.

Original entry on oeis.org

3, 3, 3, 3, 3, 3, 3, 24, 24, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140
Offset: 1

Views

Author

Michel Lagneau, Sep 28 2014

Keywords

Comments

If a(22) exists, k > 10^5.

Examples

			a(1)= 3 => prime(3) (mod 6)= 5;
a(2)= 3 => prime(3) (mod 6)= 5, prime(4) (mod 6) = 1;
a(3)= 3 => prime(3) (mod 6)= 5, prime(4) (mod 6)= 1, prime(5) (mod 6)= 5.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    for n from 1 to 35 do :
    ii:=0:
       for k from 3 to 10^5 while (ii=0)do :
         s:=0:
          for i from 0 to n-1 do:
            r:=irem(ithprime(k+i),6):
            if r = irem(5^(i+1),6)
            then
            s:=s+1:
            else
            fi:
          od:
           if s=n and ii=0
           then
           printf ( "%d %d \n",n,k):ii:=1:
           else
           fi:
        od:
    od:
Showing 1-4 of 4 results.