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

A129758 Smallest prime p such that there are primes q and r with the property that p, q and r form an arithmetic progression and their sum is the same as three times the (n+2)-nd prime number.

Original entry on oeis.org

3, 3, 5, 7, 11, 7, 17, 17, 19, 31, 29, 19, 41, 47, 47, 43, 61, 59, 67, 61, 59, 71, 67, 89, 97, 101, 79, 89, 103, 113, 107, 127, 131, 139, 151, 127, 137, 167, 167, 163, 149, 163, 167, 157, 199, 163, 197, 181, 227, 227, 211, 239, 251, 257, 257, 229, 271, 269
Offset: 1

Views

Author

Giovanni Teofilatto, May 15 2007

Keywords

Comments

The same selection rule as in A078497 applies: if there is more than one prime triple (p,q=p+d,r=q+d) with p+q+r=A001748(n), take p from the triple with minimum d. - R. J. Mathar, May 19 2007

Examples

			3 + 5 + 7 = 15, which is three times the (1+2)th prime number. Thus a(1) = 3.
		

Crossrefs

Programs

  • Maple
    A129758 := proc(n) local p3, i,d,r,p; p3 := ithprime(n) ; i := n+1 ; while true do r := ithprime(i) ; d := r-p3 ; p := p3-d ; if isprime(p) then RETURN(p) ; fi ; i := i+1 ; od ; RETURN(-1) ; end: for n from 3 to 60 do printf("%d, ",A129758(n)) ; od ; # R. J. Mathar, May 19 2007
  • Mathematica
    a[n_]:=Module[{},k=1; While[Not[PrimeQ[Prime[n+1]-k] && PrimeQ[Prime[n+1]+k]], k++ ]; Prime[n + 1] - k]; Table[a[n], {n, 2, 60}]

Formula

A078497(n)-prime(n)=prime(n)-a(n)=d. - R. J. Mathar, May 19 2007
Conjecture: Limit_{N->oo} (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} prime(n+2)) = 1. - Alain Rocchelli, May 01 2024

Extensions

Edited and extended by R. J. Mathar, Giovanni Teofilatto and Stefan Steinerberger, May 19 2007

A222590 Greatest prime representable as the arithmetic mean of two other primes in n different ways, or 0 if no such prime exists.

Original entry on oeis.org

3, 19, 31, 61, 79, 83, 199, 181, 229, 271, 277, 313, 293, 439, 389, 401, 499, 619, 601, 709, 859, 643, 787, 811, 743, 823, 1039, 1009, 1321, 1021, 1279, 1213, 1249, 1489, 1483, 1301, 1609, 1621, 1459, 1753, 1559, 1877, 2011, 2029, 1741, 1901, 2087, 2239, 2207
Offset: 0

Views

Author

Robert G. Wilson v, Feb 25 2013

Keywords

Comments

a(6681) is probably the only such term which equals zero.

Examples

			There are only two primes which are not the arithmetic mean of two other primes and they are 2 and 3. Therefore a(0)=3.
There are only three primes which are the arithmetic mean of two other primes in just one way. They are 5 = (3+7)/2, 7 = (3+11)/2, and 19 = (7+31)/2. Therefore a(1)=19.
There are only three primes which are the arithmetic mean of two other primes in just two ways. They are 11 = (3+19)/2 = (5+17)/2, 13 = (3+23)/2 = (7+19)/2, and 31 = (3+59)/2 = (19+43)/2. Therefore a(2)=31, etc.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{c = 0, k = 2, p = Prime@ n}, While[k + 1 < p, If[PrimeQ[p - k] && PrimeQ[p + k], c++ ]; k += 2]; c]; t = Table[0, {1000}]; Do[a = f@ n; If[a < 1001, t[[a + 1]] = Prime@ n; Print[{a, Prime@ n}]], {n, 5000}]; Take[t, 50]

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

A359556 Number of ways to represent the average of the n-th twin prime pair as arithmetic mean of the averages of two other twin prime pairs.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 6, 1, 2, 0, 1, 3, 4, 2, 3, 0, 7, 2, 3, 1, 4, 4, 1, 3, 6, 5, 1, 1, 3, 4, 6, 1, 11, 6, 7, 3, 6, 2, 10, 5, 4, 4, 6, 4, 2, 1, 7, 1, 4, 5, 4, 4, 4, 8, 7, 2, 3, 4, 3, 3, 10, 9, 3, 5, 21, 17, 5, 12, 5, 2, 3, 3, 18, 13, 4, 19, 11, 15, 5
Offset: 1

Views

Author

Tamas Sandor Nagy, Jan 05 2023

Keywords

Examples

			a(4) = 1 because 18, the average of the 4th twin prime pair (17, 19), can be expressed in one way only as the arithmetic mean of the averages of two other twin prime pairs. These are (5, 7) and (29, 31) with their averages 6 and 30: (6 + 30)/2 = 36/2 = 18.
a(7) = 2 because 60, the average of the 7th twin prime pair (59, 61), can be expressed in two ways as the arithmetic mean of the averages of two other twin prime pairs. Firstly, by the averages 12 and 108 of the twin prime pairs (11, 13) and (107, 109), since (12 + 108)/2 = 120/2 = 60. Secondly, by the averages 18 and 102 of the twin prime pairs (17, 19) and (101, 103), as (18 + 102)/2 = 120/2 = 60 also.
a(15) = 0 because 198, the average of the 15th twin prime pair (197, 199), cannot be expressed as the arithmetic mean of the averages of any other two twin prime pairs.
		

Crossrefs

Programs

  • Mathematica
    means = Select[2*Range[3500], PrimeQ[# - 1] && PrimeQ[# + 1] &]; Count[(Plus @@@ Subsets[means, {2}])/2, #] & /@ Select[means, # < Max[means]/2 &] (* Amiram Eldar, Jan 06 2023 *)

Extensions

More terms from Amiram Eldar, Jan 06 2023

A086712 Number of times the n-th prime power can be written as an arithmetic mean of two other prime powers.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 4, 3, 4, 6, 6, 5, 5, 7, 8, 5, 6, 6, 7, 6, 8, 6, 8, 8, 7, 8, 10, 10, 9, 8, 9, 14, 8, 10, 11, 10, 12, 8, 11, 8, 12, 13, 12, 11, 11, 13, 13, 13, 13, 13, 11, 11, 14, 11, 13, 16, 12, 16, 14, 15, 16, 17, 13, 16, 15, 12, 18, 27, 15, 19, 18, 17, 15, 16, 15, 13, 18, 17, 15
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 01 2003

Keywords

Examples

			n=7, A000961(7)=8=2^3: (3+13)/2=(A000961(3)+A000961(10))/2, (5+11)/2=(A000961(5)+A000961(9))/2 and (7+3^2)/2=(A000961(6)+A000961(8))/2: therefore a(7)=3.
		

Crossrefs

A137670 Prime numbers p such that p-b < p-a < p < p+a < p+b are prime for some a and b.

Original entry on oeis.org

17, 23, 29, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313
Offset: 1

Views

Author

Vladimir Joseph Stephan Orlovsky, Apr 27 2008; corrected May 02 2008

Keywords

Comments

It seems highly likely that all primes other than 2,3,5,7,19 are in this sequence. There are no further exceptions to 4 billion. - Charles R Greathouse IV, Apr 19 2010

Crossrefs

Cf. A071681.

Programs

  • Mathematica
    s=""; q=1; For[i=2, i<10^2, p=Prime[i]; For[a=2, aq&&PrimeQ[p-c]&&PrimeQ[p+c], (*Print[p, ":", a, ", ", b, ", ", c]; *)s=s<>ToString[p]<>", "; q=p]; c=c+2]]; b=b+2]]; a=a+2]; i++ ]; Print[s]

Extensions

New name from Charles R Greathouse IV, Apr 19 2010
Previous Showing 11-16 of 16 results.