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.

Previous Showing 11-15 of 15 results.

A161725 Primes p such that also p+30 and p-30 are primes.

Original entry on oeis.org

37, 41, 43, 53, 59, 67, 71, 73, 83, 97, 101, 109, 127, 137, 167, 181, 193, 197, 211, 227, 241, 263, 281, 307, 337, 367, 379, 389, 409, 419, 431, 449, 461, 479, 491, 571, 577, 587, 601, 617, 631, 643, 647, 661, 739, 757, 827, 853, 857, 907, 911, 937, 941, 967
Offset: 1

Views

Author

Keywords

Examples

			The prime p=37 is in the sequence because 37-30=7 and 37+30=67 are also primes.
		

Crossrefs

Programs

  • Mathematica
    q=6*5; lst={}; Do[p=Prime[n]; If[PrimeQ[p-q] && PrimeQ[p+q], AppendTo[lst,p]], {n, 5000}]; lst

Extensions

Definition edited by Emeric Deutsch, Jun 28 2009

A268914 Minimum difference between two distinct primes whose sum is 2*prime(n), n>4.

Original entry on oeis.org

12, 12, 12, 24, 12, 24, 24, 12, 24, 48, 12, 12, 24, 36, 12, 24, 12, 36, 48, 36, 60, 24, 12, 12, 60, 48, 48, 36, 60, 24, 36, 24, 12, 72, 60, 12, 24, 36, 84, 60, 60, 84, 24, 120, 60, 96, 12, 24, 60, 24, 12, 12, 24, 84, 12, 24, 108, 48, 48, 84, 72, 72, 36, 60, 72, 36, 12, 84, 60, 12, 60, 72, 60, 48, 36, 24, 60, 24, 24, 48, 36, 48, 36, 168, 36, 48
Offset: 5

Views

Author

Barry Cherkas, Feb 15 2016

Keywords

Comments

If p>4 is prime, any two primes that add to 2p must be equidistant from p. If p is congruent to 1 Mod 3, then p+2 and p-4 are divisible by 3. Alternatively, if p is congruent to 2 Mod 3, the p-2 and p+4 are divisible by 3. Thus, the equidistant pairs (p-2,p+2) and (p-4,p+4) cannot be primes that add to 2p. On the other hand, adding or subtracting any multiple of 6 will be congruent to the same congruence class as p and may be prime. Thus, the minimal difference between distinct primes that add to p must be a multiple of 12.
Extrapolating from computational evidence for all primes up to 10^9, we conjecture: For each multiple of 12 there are infinitely many primes p such that p-6k and p+6k are prime and 12k is the minimal difference for two distinct primes whose sum is 2p.

Examples

			For n=5, 2*prime(5)=2*11=5+17 and 17-5=12.
For n=6, 2*prime(6)=2*13=7+19 and 19-7=12.
...
For n=8, 2*prime(8)=2*19=7+31 and 31-7=24.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get a(5) .. a(N)
    p:= 7:
    for n from 5 to N do
      p:= nextprime(p);
      for k from 6 by 6 while not isprime(p+k) or not isprime(p-k) do od:
      A[n]:= 2*k
    od:
    seq(A[n],n=5..N); # Robert Israel, Mar 09 2016
  • Mathematica
    f[n_]:=Block[{p=Prime[n],k},k=p+6;
    While[!PrimeQ[k]||!PrimeQ[2p-k],k=k+6];2(k-p)];
    seq=Reap[Do[Sow[f[n]],{n,5,200}]][[2]][[1]];
    seq
    (*For large data sets (say, N>5000), replace 200 with N and the above algorithm is comparatively efficient.*)
    Table[2 SelectFirst[Range[#/2], Function[k, AllTrue[{#/2 + k, #/2 - k}, PrimeQ]]] &[2 Prime@ n], {n, 5, 120}] (* Michael De Vlieger, Mar 09 2016, Version 10 *)
  • PARI
    a(n) = {p = prime(n); d = 2; while (! (isprime(p-d) && isprime(p+d)),  d+=2); 2*d;} \\ Michel Marcus, Mar 17 2016

Formula

a(n) = 2*A078611(n+2).

A278869 Sophie Germain primes p such that p+6 and p-6 are primes.

Original entry on oeis.org

11, 23, 53, 173, 233, 593, 653, 1103, 1223, 2693, 2903, 2963, 4793, 5303, 6263, 6323, 7823, 9473, 10253, 11783, 12653, 13463, 15803, 20753, 25673, 27743, 27773, 29873, 31253, 33623, 38183, 38453, 39233, 40283, 41603, 44273, 44543, 54443, 54773, 59393, 60083, 62213
Offset: 1

Views

Author

K. D. Bajpai, Nov 29 2016

Keywords

Comments

Intersection of A005384 and A006489.
After a(1), all the terms are congruent to 3 mod 10.
A prime p is Sophie Germain prime if 2*p+1 is also prime.

Examples

			11 is in the list because: 2*11 + 1 = 23 (prime), hence 11 is Sophie Germain prime; also, 11 - 6 = 5 and 11 + 6 = 17 are both prime.
23 is in the list because: 2*23 + 1 = 47 (prime), hence 23 is Sophie Germain prime; also, 23 - 6 = 17 and 23 + 6 = 29 are both prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[20000]], PrimeQ[2 # + 1] && PrimeQ[# + 6] && PrimeQ[# - 6] &]
  • PARI
    forprime(p=1,10000, if(isprime(2*p+1) && isprime(p+6) && isprime(p-6), print1(p, ", ")))

A366867 Products of sexy prime triples: sphenic numbers with prime factorization (p - 6)*p*(p + 6).

Original entry on oeis.org

935, 1729, 4301, 11339, 49321, 102131, 146969, 298351, 386389, 1089019, 1221191, 3864241, 5171489, 12640949, 16965341, 18181979, 21243961, 43974269, 51881689, 178433279, 208506509, 223626691, 230324329, 270816731, 278421569, 393806449, 849244031, 932539661
Offset: 1

Views

Author

Matthew Goers, Oct 25 2023

Keywords

Examples

			5, 11, and 17 are primes p, p+6, p+12, called a sexy prime triple. 5*11*17 = 935, so 935 is a term.
7, 13, and 19 are the second set of sexy prime triples. 7*13*19=1729, so 1729 is the second term.
		

Crossrefs

Cf. A006489, A111192. Subsequence of A007304.

Programs

  • Mathematica
    (#*(#^2 - 36)) & /@ Select[Prime[Range[180]], PrimeQ[# - 6] && PrimeQ[# + 6] &] (* Amiram Eldar, Oct 27 2023 *)
  • PARI
    apply(x->x*(x-6)*(x+6), select(x->(isprime(x-6) && isprime(x) && isprime(x+6)), [1..1000])) \\ Michel Marcus, Oct 27 2023

Formula

a(n) = (A006489(n) - 6)*A006489(n)*(A006489(n) + 6).

A377014 a(n) is the number of primes p such that p - 6, p + 6 and 2*n - p are also primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 3, 2, 3, 4, 1, 3, 3, 0, 4, 4, 2, 2, 3, 3, 3, 6, 3, 4, 6, 0, 5, 5, 1, 6, 4, 3, 5, 6, 4, 3, 9, 3, 2, 8, 2, 4, 7, 2, 4, 3, 3, 5, 5, 6, 4, 9, 4, 4, 11, 2, 5, 10, 1, 4, 4, 4, 4, 4, 5, 2, 7, 4, 4, 9, 2, 5, 6, 0, 6, 7, 5, 3, 6, 5, 1, 10, 7, 4, 9, 2, 5, 9, 2, 6, 5, 4, 5, 4, 4
Offset: 1

Views

Author

Lei Zhou, Oct 12 2024

Keywords

Comments

Conjecture: a(n) = 0 only when n = 1, 2, 3, 4, 5, 6, 19, 31, 331, 499.

Examples

			a(7) = 1 since only when p = 11 are p - 6, p + 6 and 2n - p all prime.
a(12) = 3 from the cases when p is 11, 13 or 17:
  when p = 11, {p - 6, p + 6, 2n - p} = {5, 17, 13} are all prime;
  when p = 13, {p - 6, p + 6, 2n - p} = {7, 13, 19, 11} are all prime;
  when p = 17, {p - 6, p + 6, 2n - p} = {11, 17, 23, 7} are all prime.
a(19) = 0 since 2n = 38 = 7 + 31 = 19 + 19 = 31 + 7, and none of p = 7, 19, 31 can make p - 6 and p + 6 both prime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local i;
      nops(select(p -> andmap(isprime,[p,p-6,p+6, 2*n-p]), [seq(i,i=3..2*n,2)]))
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 13 2024
  • Mathematica
    m = 200; ps = {}; p = 7; While[p = NextPrime[p]; If[PrimeQ[p - 6] && PrimeQ[p + 6], AppendTo[ps, p]]; p < 2*m]; a = {}; Do[ct = 0; k = 0; While[k++; ps[[k]] < n, q = n - ps[[k]]; If[PrimeQ[q], ct++]]; AppendTo[a, ct]; If[ct == 0, AppendTo[b, n]], {n, 2, m, 2}]; a
Previous Showing 11-15 of 15 results.