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-10 of 19 results. Next

A088763 a(n) = A087695(n)/2.

Original entry on oeis.org

4, 5, 7, 8, 10, 13, 17, 20, 22, 25, 28, 32, 35, 38, 43, 50, 52, 53, 55, 67, 77, 80, 85, 88, 97, 98, 113, 115, 118, 127, 130, 133, 137, 140, 155, 157, 167, 175, 178, 185, 188, 193, 218, 223, 230, 232, 253, 272, 280, 283, 287, 295, 298, 302, 305, 308, 322, 325, 328, 340
Offset: 1

Views

Author

Ray Chandler, Oct 26 2003

Keywords

Comments

A260689(a(n),1) = A264526(a(n)) = 3. - Reinhard Zumkeller, Nov 17 2015

Crossrefs

Programs

  • Haskell
    a088763 = flip div 2 . a087695  -- Reinhard Zumkeller, Nov 17 2015
  • Maple
    ZL:=[]:for p from 1 to 700 do if (isprime(p) and isprime(p+6) ) then ZL:=[op(ZL),(p+(p+6))/4]; fi; od; print(ZL); # Zerinvary Lajos, Mar 07 2007
  • Mathematica
    f[n_]:=PrimeQ[n-3]&&PrimeQ[n+3]; lst={};Do[If[f[n],AppendTo[lst,n]],{n,2,8!,2}];lst/2 (* Vladimir Joseph Stephan Orlovsky, Oct 09 2009 *)

Extensions

Offset corrected by Reinhard Zumkeller, Nov 17 2015

A023201 Primes p such that p + 6 is also prime. (Lesser of a pair of sexy primes.)

Original entry on oeis.org

5, 7, 11, 13, 17, 23, 31, 37, 41, 47, 53, 61, 67, 73, 83, 97, 101, 103, 107, 131, 151, 157, 167, 173, 191, 193, 223, 227, 233, 251, 257, 263, 271, 277, 307, 311, 331, 347, 353, 367, 373, 383, 433, 443, 457, 461, 503, 541, 557, 563, 571, 587, 593, 601, 607, 613, 641, 647
Offset: 1

Views

Author

Keywords

Crossrefs

A031924 (primes starting a gap of 6) and A007529 together give this (A023201).
Cf. A046117 (a(n)+6), A087695 (a(n)+3), A098428, A000040, A010051, A006489 (subsequence).

Programs

  • Haskell
    a023201 n = a023201_list !! (n-1)
    a023201_list = filter ((== 1) . a010051 . (+ 6)) a000040_list
    -- Reinhard Zumkeller, Feb 25 2013
    
  • Magma
    [n: n in [0..40000] | IsPrime(n) and IsPrime(n+6)]; // Vincenzo Librandi, Aug 04 2010
    
  • Maple
    A023201 := proc(n)
        option remember;
        if n = 1 then
            5;
        else
            for a from procname(n-1)+2 by 2 do
                if isprime(a) and isprime(a+6) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, May 28 2013
  • Mathematica
    Select[Range[10^2], PrimeQ[ # ]&&PrimeQ[ #+6] &] (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
    Select[Prime[Range[120]],PrimeQ[#+6]&] (* Harvey P. Dale, Mar 20 2018 *)
  • PARI
    is(n)=isprime(n+6)&&isprime(n) \\ Charles R Greathouse IV, Mar 20 2013

Formula

From M. F. Hasler, Jan 02 2020: (Start)
a(n) = A046117(n) - 6 = A087695(n) - 3.
A023201 = { p = A000040(k) | A000040(k+1) = p+6 or A000040(k+2) = p+6 } = A031924 U A007529. (End)

A046117 Primes p such that p-6 is also prime. (Upper of a pair of sexy primes.)

Original entry on oeis.org

11, 13, 17, 19, 23, 29, 37, 43, 47, 53, 59, 67, 73, 79, 89, 103, 107, 109, 113, 137, 157, 163, 173, 179, 197, 199, 229, 233, 239, 257, 263, 269, 277, 283, 313, 317, 337, 353, 359, 373, 379, 389, 439, 449, 463, 467, 509, 547, 563, 569, 577, 593, 599, 607, 613
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [p:p in PrimesInInterval(7,650)| IsPrime(p-6)]; // Marius A. Burtea, Jan 03 2020
  • Mathematica
    q=6; a={}; Do[p1=Prime[n]; p2=p1+q; If[PrimeQ[p2], AppendTo[a, p2]], {n, 7^2}]; a "and/or" Select[Prime[Range[3, 7^2]], PrimeQ[ # ]&&PrimeQ[ #-6]&] (* Vladimir Joseph Stephan Orlovsky, Aug 07 2008 *)
    Select[Prime[Range[4,200]],PrimeQ[#-6]&] (* Harvey P. Dale, Mar 31 2018 *)
  • PARI
    forprime(p=2,1e4,if(isprime(p-6),print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
    

Formula

a(n) = A087695(n) + 3.
a(n) = A023201(n) + 6. - M. F. Hasler, Jan 02 2020

Extensions

Name edited by M. F. Hasler, Jan 02 2020

A082467 Least k>0 such that n-k and n+k are both primes.

Original entry on oeis.org

1, 2, 1, 4, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 12, 3, 2, 9, 6, 5, 6, 3, 4, 9, 12, 1, 12, 9, 4, 3, 6, 5, 6, 9, 2, 3, 12, 1, 24, 3, 2, 15, 6, 5, 12, 3, 8, 9, 6, 7, 12, 3, 4, 15, 12, 1, 18, 9, 4, 3, 6, 5, 6, 15, 2, 3, 12, 1, 6, 15, 4, 3, 6, 5, 18, 9, 2, 15, 24, 5, 12, 3, 14, 9, 18, 7, 12, 9, 4, 15, 6, 7, 30, 9
Offset: 4

Views

Author

Benoit Cloitre, Apr 27 2003

Keywords

Comments

The existence of k>0 for all n >= 4 is equivalent to the strong Goldbach Conjecture that every even number >= 8 is the sum of two distinct primes.
n and k are coprime, because otherwise n + k would be composite. So the rational sequence r(n) = a(n)/n = k/n is injective. - Jason Kimberley, Sep 21 2011
Because there are arbitrarily many composites from m!+2 to m!+m, there are also arbitrarily large a(n) but they increase very slowly. The twin prime conjecture implies that infinitely many a(n) are 1. - Juhani Heino, Apr 09 2020

Examples

			n=10: k=3 because 10-3 and 10+3 are both prime and 3 is the smallest k such that n +/- k are both prime.
		

Crossrefs

Cf. A129301 (records), A129302 (where records occur).
Cf. A047160 (allows k=0).
Cf. A078611 (subset for prime n).

Programs

  • Magma
    A082467 := func; [A082467(n):n in [4..98]]; // Jason Kimberley, Sep 03 2011
  • Maple
    A082467 := proc(n) local k; k := 1+irem(n,2);
    while n > k do if isprime(n-k) then if isprime(n+k)
    then RETURN(k) fi fi; k := k+2 od; print("Goldbach erred!") end:
    seq(A082467(i),i=4..90); # Peter Luschny, Sep 21 2011
  • Mathematica
    f[n_] := Block[{k}, If[OddQ[n], k = 2, k = 1]; While[ !PrimeQ[n - k] || !PrimeQ[n + k], k += 2]; k]; Table[ f[n], {n, 4, 98}] (* Robert G. Wilson v, Mar 28 2005 *)
  • PARI
    a(n)=if(n<0,0,k=1; while(isprime(n-k)*isprime(n+k) == 0,k++); k)
    

Formula

A078496(n)-a(n) = A078587(n)+a(n) = n.

Extensions

Entries checked by Klaus Brockhaus, Apr 08 2007

A087679 Numbers k such that both k+2 and k-2 are prime.

Original entry on oeis.org

5, 9, 15, 21, 39, 45, 69, 81, 99, 105, 111, 129, 165, 195, 225, 231, 279, 309, 315, 351, 381, 399, 441, 459, 465, 489, 501, 615, 645, 675, 741, 759, 771, 825, 855, 861, 879, 885, 909, 939, 969, 1011, 1089, 1095, 1215, 1281, 1299, 1305, 1425, 1431, 1449, 1485
Offset: 1

Views

Author

Zak Seidov, Sep 27 2003

Keywords

Comments

Essentially the same as A029708: a(n) = A029708(n-1) for n>=2.
Midpoint of cousin prime pairs.
The only prime is 5. All other terms are multiples of 3. - Zak Seidov, May 19 2014

Crossrefs

Programs

  • Maple
    ZL:=[]:for p from 1 to 1485 do if (isprime(p) and isprime(p+4) ) then ZL:=[op(ZL),(p+(p+4))/2]; fi; od; print(ZL); # Zerinvary Lajos, Mar 07 2007
  • Mathematica
    lst={};Do[If[PrimeQ[n-2]&&PrimeQ[n+2],AppendTo[lst,n]],{n,3,8!,2}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 14 2009 *)
  • PARI
    s=[]; for(n=1, 2000, if(isprime(n-2) && isprime(n+2), s=concat(s, n))); s \\ Colin Barker, May 19 2014
    
  • PARI
    is_A087679(n)={isprime(n-2) && isprime(n+2)} \\ For numbers >> 10^12 one should add conditions {n%6==3 && ... || n==5} or consider only such numbers congruent to 3 (mod 6). - M. F. Hasler, Apr 05 2017

Formula

a(n) = (A023200(n) + A046132(n))/2 = A023200(n) + 2 = A046132(n) - 2.
a(n+1) = A056956(n)*6 + 3 = A157834(n)*3; a(n) = A088762(n)*2 + 1. - M. F. Hasler, Apr 05 2017

Extensions

More terms from Ray Chandler, Oct 26 2003

A087697 Numbers k such that k + 7 and k - 7 are both prime.

Original entry on oeis.org

10, 12, 24, 30, 36, 54, 60, 66, 90, 96, 120, 144, 156, 174, 186, 204, 234, 264, 270, 276, 300, 324, 360, 366, 390, 426, 450, 456, 516, 564, 570, 594, 600, 606, 624, 654, 666, 684, 726, 750, 780, 804, 816, 846, 870, 960, 984, 990
Offset: 1

Views

Author

Zak Seidov, Sep 27 2003

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [5..1000] | IsPrime(n-7) and IsPrime(n+7)]; // Vincenzo Librandi, Jul 23 2018
  • Maple
    select(t -> isprime(t+7) and isprime(t-7), [seq(i,i=8..1000,2)]); # Robert Israel, Jul 22 2018
  • Mathematica
    Rest[Select[Range[1000], PrimeQ[# - 7] && PrimeQ[# + 7] &]] (* Vincenzo Librandi, Jul 23 2018 *)
  • PARI
    isok(n) = isprime(n-7) && isprime(n+7); \\ Michel Marcus, Jul 23 2018
    

A087678 Numbers n such that n + 9 and n - 9 are both prime.

Original entry on oeis.org

14, 20, 22, 28, 32, 38, 50, 52, 62, 70, 80, 88, 92, 98, 118, 122, 140, 148, 158, 172, 182, 188, 190, 202, 220, 232, 242, 248, 260, 272, 302, 322, 340, 358, 388, 392, 410, 430, 440, 448, 452, 458, 470, 500, 512, 532, 578, 608, 610, 622, 650, 652, 668, 682, 692
Offset: 1

Views

Author

Zak Seidov, Sep 27 2003

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_]:=PrimeQ[n-9]&&PrimeQ[n+9]; lst={};Do[If[f[n],AppendTo[lst,n]],{n,6,8!,2}];lst (* Vladimir Joseph Stephan Orlovsky, Oct 09 2009 *)
    Select[Range[10,700],AllTrue[#+{9,-9},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 23 2019 *)

A087683 Numbers n such that n + 10 and n - 10 are both prime.

Original entry on oeis.org

13, 21, 27, 33, 51, 57, 63, 69, 93, 99, 117, 141, 147, 183, 189, 201, 261, 267, 273, 303, 321, 327, 357, 363, 369, 399, 411, 429, 453, 477, 489, 513, 531, 567, 597, 603, 609, 651, 663, 729, 819, 849, 867, 873, 897, 957, 981, 987
Offset: 1

Views

Author

Zak Seidov, Sep 27 2003

Keywords

Comments

3 divides every term except the first. - T. D. Noe, May 14 2008

Crossrefs

Programs

  • Mathematica
    f[n_]:=PrimeQ[n-10]&&PrimeQ[n+10]; lst={};Do[If[f[n],AppendTo[lst,n]],{n,9,8!,2}];lst (* Vladimir Joseph Stephan Orlovsky, Oct 09 2009 *)
    Select[Range[10,1000],AllTrue[#+{10,-10},PrimeQ]&] (* Harvey P. Dale, Jul 29 2024 *)

A087711 a(n) = smallest number k such that both k-n and k+n are primes.

Original entry on oeis.org

2, 4, 5, 8, 7, 8, 11, 10, 11, 14, 13, 18, 17, 16, 17, 22, 21, 20, 23, 22, 23, 26, 25, 30, 29, 28, 33, 32, 31, 32, 37, 36, 35, 38, 37, 38, 43, 42, 41, 44, 43, 48, 47, 46, 57, 52, 51, 50, 53, 52, 53, 56, 55, 56, 59, 58, 75, 70, 69, 72, 67, 66, 65, 68, 67, 72, 71, 70, 71, 80, 81, 78
Offset: 0

Views

Author

Zak Seidov, Sep 28 2003

Keywords

Comments

Let b(n), c(n) and d(n) be respectively, smallest number m such that phi(m-n) + sigma(m+n) = 2n, smallest number m such that phi(m+n) + sigma(m-n) = 2n and smallest number m such that phi(m-n) + sigma(m+n) = phi(m+n) + sigma(m-n), we conjecture that for each positive integer n, a(n)=b(n)=c(n)=d(n). Namely we conjecture that for each positive integer n, a(n) < A244446(n), a(n) < A244447(n) and a(n) < A244448(n). - Jahangeer Kholdi and Farideh Firoozbakht, Sep 05 2014

Examples

			n=10: k=13 because 13-10 and 13+10 are both prime and 13 is the smallest k such that k +/- 10 are both prime
4-1=3, prime, 4+1=5, prime; 5-2=3, 5+2=7; 8-3=5, 8+3=11; 9-4=5, 9+4=13, ...
		

Crossrefs

Programs

  • Magma
    distance:=function(n); k:=n+2; while not IsPrime(k-n) or not IsPrime(k+n) do k:=k+1; end while; return k; end function; [ distance(n): n in [1..71] ]; /* Klaus Brockhaus, Apr 08 2007 */
    
  • Maple
    Primes:= select(isprime,{seq(2*i+1,i=1..10^3)}):
    a[0]:= 2:
    for n from 1 do
      Q:= Primes intersect map(t -> t-2*n,Primes);
      if nops(Q) = 0 then break fi;
      a[n]:= min(Q) + n;
    od:
    seq(a[i],i=0..n-1); # Robert Israel, Sep 08 2014
  • Mathematica
    s = ""; k = 0; For[i = 3, i < 22^2, If[PrimeQ[i - k] && PrimeQ[i + k], s = s <> ToString[i] <> ","; k++ ]; i++ ]; Print[s] (* Vladimir Joseph Stephan Orlovsky, Apr 03 2008 *)
    snk[n_]:=Module[{k=n+1},While[!PrimeQ[k+n]||!PrimeQ[k-n],k++];k]; Array[ snk,80,0] (* Harvey P. Dale, Dec 13 2020 *)
  • PARI
    a(n)=my(k);while(!isprime(k-n) || !isprime(k+n),k++);return(k) \\ Edward Jiang, Sep 05 2014

Formula

a(n) = A020483(n)+n for n >= 1. - Robert Israel, Sep 08 2014

Extensions

Entries checked by Klaus Brockhaus, Apr 08 2007

A087681 Numbers n such that n + 6 and n - 6 are both prime.

Original entry on oeis.org

11, 13, 17, 23, 25, 35, 37, 47, 53, 65, 67, 73, 77, 95, 103, 107, 133, 143, 145, 157, 173, 185, 187, 205, 217, 233, 235, 245, 257, 263, 275, 277, 287, 343, 353, 373, 395, 403, 415, 425, 427, 437, 455, 473, 485, 493, 497, 515, 563, 593, 607, 613, 625, 637, 647
Offset: 1

Views

Author

Zak Seidov, Sep 27 2003

Keywords

Comments

Many terms are of the form 5 + n + n^2 or 5 + 2*n^2: A054794.

Crossrefs

Programs

  • Mathematica
    f[n_]:=PrimeQ[n-6]&&PrimeQ[n+6]; lst={}; Do[If[f[n],AppendTo[lst,n]],{n,2,7!,1}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 12 2009 *)
    Select[Range[2,700],AllTrue[#+{6,-6},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 26 2019 *)
Showing 1-10 of 19 results. Next