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-7 of 7 results.

A088766 a(n) = (A087681(n)-1)/2.

Original entry on oeis.org

5, 6, 8, 11, 12, 17, 18, 23, 26, 32, 33, 36, 38, 47, 51, 53, 66, 71, 72, 78, 86, 92, 93, 102, 108, 116, 117, 122, 128, 131, 137, 138, 143, 171, 176, 186, 197, 201, 207, 212, 213, 218, 227, 236, 242, 246, 248, 257, 281, 296, 303, 306, 312, 318, 323, 326, 333, 366
Offset: 1

Views

Author

Ray Chandler, Oct 26 2003

Keywords

Comments

Numbers k such that 2*k + 1 - 6 and 2*k + 1 + 6 are sexy primes. [Jonathan Vos Post, Feb 14 2011]

Examples

			1002 is in the sequence because 2*1002 + 1 - 6 = 1999 is prime, and 2*1002 + 1 + 6 = 2011 is prime.
		

Crossrefs

Programs

  • Magma
    [n-1: n in [3..400] |IsPrime(2*n+5) and IsPrime(2*n-7)]; // Vincenzo Librandi, May 20 2017
  • Mathematica
    Select[Range[3, 1000], PrimeQ[2 # + 5] && PrimeQ[2 # - 7] &] - 1 (* Vincenzo Librandi, May 20 2017 *)

Formula

{k such that 2*k + 1 - 6 is in A023201} = {k such that 2*k + 1 + 6 is in A046117}.

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

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
    

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

A164566 Primes p such that 7*p-6 and 7*p+6 are also prime numbers.

Original entry on oeis.org

5, 11, 19, 31, 41, 61, 71, 109, 151, 211, 229, 269, 379, 419, 431, 439, 479, 619, 641, 709, 739, 809, 839, 971, 1009, 1069, 1229, 1259, 1319, 1361, 1439, 1451, 1499, 1531, 1579, 1669, 1801, 1879, 1889, 2011, 2111, 2239, 2269, 2381, 2411, 2551, 2579, 2591
Offset: 1

Views

Author

Keywords

Comments

Primes of the form A087681(k)/7, any index k.

Examples

			For p=5, both 7*5-6=29 and 7*5+6=41 are prime,
for p=11, both 7*11-6=71 and 7*11+6=83 are prime.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(3000) | IsPrime(7*p-6) and IsPrime(7*p+6)]; // Vincenzo Librandi, Apr 09 2013
    
  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[7*p-6]&&PrimeQ[7*p+6],AppendTo[lst,p]], {n,6!}];lst
    Select[Prime[Range[700]], And @@ PrimeQ/@{7 # + 6, 7 # - 6}&] (* Vincenzo Librandi, Apr 09 2013 *)
  • PARI
    is(n)=isprime(n) && isprime(7*n-6) && isprime(7*n+6) \\ Charles R Greathouse IV, Mar 28 2017

Formula

A136052 INTERSECT A023225. [R. J. Mathar, Aug 20 2009]

Extensions

Examples rephrased by R. J. Mathar, Aug 20 2009

A164567 Primes p such that 5*p-6 and 5*p+6 are prime numbers.

Original entry on oeis.org

5, 7, 13, 19, 29, 37, 41, 47, 79, 83, 97, 103, 149, 163, 211, 257, 293, 313, 359, 379, 401, 421, 449, 509, 523, 541, 547, 601, 643, 653, 673, 691, 701, 733, 821, 853, 883, 911, 929, 937, 1009, 1129, 1171, 1217, 1367, 1381, 1423, 1511, 1567, 1619, 1637, 1787
Offset: 1

Views

Author

Keywords

Comments

Primes of the form A087681(k)/5, any k [R. J. Mathar, Sep 17 2009]

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[5*p-6]&&PrimeQ[5*p+6],AppendTo[lst,p]], {n,6!}];lst
    Select[Prime[Range[300]],AllTrue[5#+{6,-6},PrimeQ]&] (* Harvey P. Dale, Jun 09 2022 *)

A108403 Numbers n such that n^2-6 and n^2+6 are both prime.

Original entry on oeis.org

5, 25, 65, 145, 355, 605, 985, 1075, 1295, 1465, 1565, 1675, 1915, 2345, 2425, 2585, 2755, 3005, 3155, 3785, 4595, 4625, 4975, 5225, 5465, 5665, 5905, 5915, 6115, 6295, 6305, 6415, 6485, 7235, 7775, 8185, 9065, 9275, 9415, 9755, 9835, 10145, 10195
Offset: 1

Views

Author

John L. Drost, Jul 04 2005

Keywords

Comments

All members of the sequence are divisible by 5 as if n is 1 or 4 mod 5 then n^2-6 is divisible by 5 and if n is 2 or 3 mod 5 then n^2+6 is divisible by 5.

Examples

			a(2)=25 since 25^2 - 6 = 619 and 25^2 + 6 = 631 are both prime.
		

Crossrefs

Cf. A087681 (with n instead of n^2), A108701 (with 2 instead of 6).

Programs

  • Magma
    [n: n in [2..100000] | IsPrime(n^2-6) and IsPrime(n^2+6)] // Vincenzo Librandi, Nov 13 2010
  • Mathematica
    pQ[n_]:=Module[{n2=n^2},And@@PrimeQ[{n2-6,n2+6}]]; Select[5Range[2100], pQ]  (* Harvey P. Dale, Nov 06 2011 *)
Showing 1-7 of 7 results.