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 12 results. Next

A088767 a(n) = A087697(n)/2.

Original entry on oeis.org

5, 6, 12, 15, 18, 27, 30, 33, 45, 48, 60, 72, 78, 87, 93, 102, 117, 132, 135, 138, 150, 162, 180, 183, 195, 213, 225, 228, 258, 282, 285, 297, 300, 303, 312, 327, 333, 342, 363, 375, 390, 402, 408, 423, 435, 480, 492, 495, 513, 528, 555, 558, 597, 612, 615, 642
Offset: 1

Views

Author

Ray Chandler, Oct 26 2003

Keywords

Comments

Numbers n such that 2*n-7 [A089192] and 2*n+7 [A105760] are both prime. [Vincenzo Librandi, Jul 10 2010]

Crossrefs

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

A087695 Numbers n such that n + 3 and n - 3 are both prime.

Original entry on oeis.org

8, 10, 14, 16, 20, 26, 34, 40, 44, 50, 56, 64, 70, 76, 86, 100, 104, 106, 110, 134, 154, 160, 170, 176, 194, 196, 226, 230, 236, 254, 260, 266, 274, 280, 310, 314, 334, 350, 356, 370, 376, 386, 436, 446, 460, 464, 506, 544, 560, 566, 574, 590, 596
Offset: 1

Views

Author

Zak Seidov, Sep 27 2003

Keywords

Comments

A010051(a(n)-3) * A010051(a(n)+3) = 1. - Reinhard Zumkeller, Nov 17 2015

Crossrefs

Programs

  • Haskell
    a087695 n = a087695_list !! (n-1)
    a087695_list = filter
       (\x -> a010051' (x - 3) == 1 && a010051' (x + 3) == 1) [2, 4 ..]
    -- Reinhard Zumkeller, Nov 17 2015
    
  • Maple
    ZL:=[]:for p from 1 to 600 do if (isprime(p) and isprime(p+6) ) then ZL:=[op(ZL),(p+(p+6))/2]; fi; od; print(ZL); # Zerinvary Lajos, Mar 07 2007
  • Mathematica
    lst={};Do[If[PrimeQ[n-3]&&PrimeQ[n+3], AppendTo[lst, n]], {n, 10^3}];lst (* Vladimir Joseph Stephan Orlovsky, Sep 08 2008 *)
    Select[Range[600],AllTrue[#+{3,-3},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 06 2015 *)
  • PARI
    p=2; q=3; forprime(r=5,1e3, if(q-p<7 && (q-p==6 || r-p==6), print1(p+3", ")); p=q; q=r) \\ Charles R Greathouse IV, May 22 2018

Formula

a(n) = A046117(n) - 3.

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 *)

A087696 Numbers n such that n + 5 and n - 5 are both prime.

Original entry on oeis.org

8, 12, 18, 24, 36, 42, 48, 66, 78, 84, 102, 108, 132, 144, 162, 168, 186, 228, 234, 246, 276, 288, 312, 342, 354, 378, 384, 414, 426, 438, 444, 462, 504, 552, 582, 612, 636, 648, 678, 696, 714, 738, 756, 792, 816, 834, 858, 882, 924, 942, 972
Offset: 1

Views

Author

Zak Seidov, Sep 27 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[5,1000],AllTrue[#+{5,-5},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 08 2014 *)
  • PARI
    isok(n) = isprime(n-5) && isprime(n+5); \\ Michel Marcus, Sep 02 2019

A087680 Numbers n such that n + 4 and n - 4 are both prime.

Original entry on oeis.org

7, 9, 15, 27, 33, 57, 63, 75, 93, 105, 135, 153, 177, 195, 237, 267, 273, 363, 393, 405, 435, 453, 483, 495, 567, 573, 597, 603, 657, 687, 705, 723, 747, 765, 825, 915, 933, 987, 1017, 1035, 1065, 1113, 1167, 1197, 1227, 1233, 1287, 1293, 1323, 1377, 1443
Offset: 1

Views

Author

Zak Seidov, Sep 27 2003

Keywords

Comments

All terms > 7 (prime) are divisible by 3. Also note that n-4 and n+4 are not necessarily consecutive primes. First case when n-4 and n+4 are consecutive primes is for n=93 with n-4=89 and n+4=97. - Zak Seidov, Apr 22 2015

Crossrefs

Programs

  • Maple
    ZL:=[]:for p from 1 to 1444 do if (isprime(p) and isprime(p+8) ) then ZL:=[op(ZL),(p+(p+8))/2]; fi; od; print(ZL); # Zerinvary Lajos, Mar 07 2007
  • Mathematica
    f[n_]:=PrimeQ[n-4]&&PrimeQ[n+4]; lst={};Do[If[f[n],AppendTo[lst,n]],{n,3,8!,2}];lst (* Vladimir Joseph Stephan Orlovsky, Oct 09 2009 *)
    Select[Prime[Range[250]],PrimeQ[#+8]&]+4 (* Harvey P. Dale, May 21 2023 *)

Formula

a(n) = A023202(n) + 4. - Michel Marcus, Apr 22 2015

Extensions

More terms from Ray Chandler, Oct 26 2003
Showing 1-10 of 12 results. Next