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.

A270190 Numbers n for which prime(n+1)-prime(n) is a multiple of three.

Original entry on oeis.org

9, 11, 15, 16, 18, 21, 23, 32, 36, 37, 39, 40, 46, 47, 51, 54, 55, 56, 58, 67, 71, 73, 74, 76, 84, 86, 91, 96, 97, 99, 100, 102, 103, 105, 107, 108, 110, 111, 114, 118, 119, 121, 123, 129, 130, 133, 139, 160, 161, 164, 165, 167, 168, 170, 174, 179, 180, 184, 185, 187, 188, 194, 195, 197, 199, 200, 202, 203, 205, 208, 210
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Comments

Numbers n for which A001223(n) = 0 modulo 3.
See comments in A270189 and A269364.
Equivalently, numbers n for which prime(n+1)-prime(n) is a multiple of six. See A276414 for runs of increasing length of consecutive integers. - M. F. Hasler, Sep 03 2016

Examples

			9 is present as the difference between A000040(9+1) = 29 and A000040(9) = 23 is 6, a multiple of three.
		

Crossrefs

Complement: A270189.
Positions of zeros in A137264.
Left inverse: A269850.

Programs

  • Mathematica
    Select[Range@ 210, Divisible[Prime[# + 1] - Prime@ #, 3] &] (* Michael De Vlieger, Mar 17 2016 *)
    PrimePi/@Select[Partition[Prime[Range[350]],2,1],Divisible[#[[2]]-#[[1]], 3]&][[All,1]] (* Harvey P. Dale, Jul 11 2017 *)
  • PARI
    isok(n) = ((prime(n+1) - prime(n)) % 3) == 0; \\ Michel Marcus, Mar 17 2016

Formula

Other identities. For all n >= 1:
a(n) = A269399(n) + 6.
A269850(a(n)) = n.

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

A054679 First of n consecutive primes which differ by a multiple of 6.

Original entry on oeis.org

2, 23, 47, 251, 1741, 1741, 19471, 118801, 148531, 148531, 406951, 1820111, 2339041, 19725473, 19725473, 73451737, 232301497, 400414121, 489144599, 489144599, 766319189, 766319189, 21549657539, 21549657539, 21549657539, 140432294381, 140432294381, 437339303279, 1552841185921, 1552841185921, 1552841185921
Offset: 1

Views

Author

Jeff Burch, Apr 18 2000

Keywords

Comments

See A276414 for the indices of these primes. - M. F. Hasler, Sep 02 2016
The sequence is infinite, by Shiu's theorem. - Jonathan Sondow, Jun 22 2017

Crossrefs

Formula

a(n) = A000040(A276414(n)). - M. F. Hasler, Sep 02 2016
a(n) = min(A057620(n), A057621(n)) for all n >= 1. - M. F. Hasler, Sep 03 2016

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Nov 09 2000
More terms from Jens Kruse Andersen, May 30 2006
Initial term and a(27)-a(31) added and name edited by M. F. Hasler, Sep 02 2016

A247816 a(n) is the smallest k such that prime(k+i) = 1 (mod 6) for i = 0, 1,...,n-1.

Original entry on oeis.org

4, 11, 36, 271, 271, 271, 2209, 11199, 13717, 13717, 34369, 172146, 172146, 3094795, 3094795, 4308948, 12762142, 23902561, 72084956, 72084956, 72084956, 1052779161, 1052779161, 1857276773, 1857276773, 19398320447, 57446769091, 57446769091, 57446769091
Offset: 1

Views

Author

Michel Lagneau, Sep 28 2014

Keywords

Comments

Equivalently, "mod 6" can be replaced by "mod 3". See A247967 for the variant "= 5 (mod 6)" and A276414 for runs of primes congruent to each other (mod 3). - M. F. Hasler, Sep 02 2016
The sequence is infinite, by Shiu's theorem. - Jonathan Sondow, Jun 22 2017

Examples

			a(1)= 4 => prime(4) (mod 6)= 1;
a(2)= 11 => prime(11)(mod 6)= 1, prime(12)(mod 6) = 1;
a(3)= 36 => prime(36)(mod 6)= 1, prime(37)(mod 6)= 1, prime(38)(mod 6)= 1.
The resulting primes are:
7;
31, 37;
151, 157, 163;
1741, 1747, 1753, 1759;
1741, 1747, 1753, 1759, 1777;
1741, 1747, 1753, 1759, 1777, 1783;
19471, 19477, 19483, 19489, 19501, 19507, 19531;
... - _Michel Marcus_, Sep 29 2014
		

Crossrefs

Programs

  • 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 = 1
            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
    With[{m6=If[Mod[#,6]==1,1,0]&/@Prime[Range[5*10^6]]},Flatten[Table[SequencePosition[ m6,PadRight[{},n,1],1],{n,16}],1]][[;;,1]] (* Harvey P. Dale, May 07 2023 *)
  • PARI
    m=c=i=0;forprime(p=1,, i++;p%6!=1&&(!c||!c=0)&&next; c++>m||next; print1(1+i-m=c,",")) \\ M. F. Hasler, Sep 02 2016

Formula

a(n) = primepi(A057620(n)). - Michel Marcus, Sep 30 2014

Extensions

a(12)-a(21) from A057620 by Michel Marcus, Oct 03 2014
a(22)-a(29) from Giovanni Resta, Oct 03 2018
Showing 1-4 of 4 results.