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

A071681 Number of ways to represent the n-th prime as arithmetic mean of two other primes.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 31 2002

Keywords

Comments

Conjecture: a(n)>0 for n>2.
a(A137700(n))=n and a(m)<>n for m < A137700(n), A000040(A137700(n))=A126204(n). - Reinhard Zumkeller, Feb 07 2008
The conjecture follows from a slightly strengthened version of Goldbach's conjecture: that every even number > 6 is the sum of two distinct primes. - T. D. Noe, Jan 10 2011 [Corrected by Barry Cherkas and Robert Israel, May 21 2015]
a(n) = A116619(n) + 1. - Reinhard Zumkeller, Mar 27 2015
Number of primes q < prime(n), such that 2*prime(n) - q is prime. - Dmitry Kamenetsky, May 27 2023

Examples

			a(7)=3 as prime(7) = 17 = (3+31)/2 = (5+29)/2 = (11+23)/2 and 2*17-p is not prime for the other primes p < 17: {2,7,13}.
		

Crossrefs

Programs

  • Haskell
    a071681 n = sum $ map a010051' $
       takeWhile (> 0) $ map (2 * a000040 n -) $ drop n a000040_list
    -- Reinhard Zumkeller, Mar 27 2015
  • Mathematica
    f[n_] := Block[{c = 0, k = PrimePi@n - 1}, While[k > 0, If[ PrimeQ[2n - Prime@k], c++ ]; k-- ]; c]; Table[ f@ Prime@n, {n, 84}] (* Robert G. Wilson v, Mar 22 2007 *)
  • PARI
    A071681(n)={s=2*prime(n);a=0;for(i=1,n-1,a=a+isprime(s-prime(i)));a}
    

A136244 Least positive integer k such that 2k can be expressed as the sum of two primes in exactly n ways.

Original entry on oeis.org

1, 2, 5, 11, 17, 24, 30, 39, 42, 45, 57, 72, 60, 84, 90, 117, 123, 144, 120, 105, 162, 150, 180, 237, 165, 264, 288, 195, 231, 240, 210, 285, 255, 336, 396, 378, 438, 357, 399, 345, 519, 315, 504, 465, 390, 480, 435, 462, 450, 567, 717, 420, 495, 651, 540, 615, 759, 525, 570, 693, 645
Offset: 0

Views

Author

K. B. Subramaniam (shunya_1950(AT)yahoo.co.in), Dec 24 2007

Keywords

Comments

It appears that 2, 3, 4, 6 are the only numbers k such that 2k can be expressed as the sum of two primes in only one way.
Except when n = 1, a(n) = A258713(n). The first 11 terms of this sequence are the same as the initial terms of A053033. If a(n) exists for all n then A053033 is a subsequence. - Andrew Howroyd, Jan 28 2020

Examples

			a(3) = 11: 22 = 3 + 19 = 5 + 17 = 11 + 11. Also 22 is the least number which could be expressed as the sum of two prime numbers in exactly three ways.
		

Crossrefs

Programs

  • PARI
    a(n, lim=oo)={for(i=1, lim, my(s=0); forprime(p=2, i, s+=isprime(2*i-p)); if(s==n, return(i))); -1} \\ Andrew Howroyd, Jan 28 2020

Formula

From Andrew Howroyd, Jan 28 2020: (Start)
a(n) = A023036(n) / 2.
A045917(a(n)) = n. (End)

Extensions

a(0)=1 prepended, a(5) corrected and a(7) and beyond from Andrew Howroyd, Jan 28 2020

A137700 Smallest k such that the k-th prime has exactly n distinct representations as arithmetic mean of two primes.

Original entry on oeis.org

1, 3, 5, 7, 12, 16, 24, 20, 26, 41, 33, 44, 51, 55, 54, 79, 64, 74, 69, 88, 121, 92, 101, 109, 113, 116, 124, 155, 152, 137, 144, 140, 160, 174, 165, 209, 197, 195, 201, 200, 206, 218, 251, 238, 229, 239, 230, 244, 236, 267, 295, 281, 299, 301, 307, 312, 313, 325
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 07 2008

Keywords

Comments

A071681(a(n))=n and A071681(m)<>n for mA000040(a(n))=A126204(n).

Extensions

Corrected description suggested by Zak Seidov, May 16 2008

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]

A157478 a(n) is the least prime p such that p is greater than any previous term and is representable as the arithmetic mean of two other primes in exactly n different ways.

Original entry on oeis.org

5, 11, 17, 37, 53, 89, 107, 127, 179, 197, 223, 233, 257, 263, 401, 409, 421, 449, 457, 661
Offset: 1

Views

Author

Keywords

Comments

A number p is representable as the arithmetic mean of two other primes in n ways if there are n values of k such that p + k and p - k are both prime.
If the restriction that a(n) must be greater than previous terms is removed then the sequence would be A126204. - Andrew Howroyd, Jan 12 2020
The next term if it exists > 10^6. - Andrew Howroyd, Jan 12 2020

Examples

			a(1) = 5 because 5+-2 are primes.
a(2) = 11 because 11+-6, 11+-8 are primes.
a(3) = 17 because 17+-6, 17+-12, 17+=14 are primes.
a(4) = 37 because 37+-6, 37+-24, 37+-30, 37+-34 are primes.
a(5) = 53 because 53+-6, 53+-30, 53+-36, 53+-48, 53+-50 are primes.
		

Crossrefs

Cf. A126204.

Programs

  • Mathematica
    q=1;lst={};Do[p=Prime[n];i=0;Do[If[PrimeQ[p-k]&&PrimeQ[p+k],i++;],{k,2,p,2}];If[i==q,AppendTo[lst,p];q++ ],{n,2*5!}];lst
  • PARI
    a(n, lim=oo)={my(v=vector(n),r=1); forprime(p=5, lim, my(k=0); forprime(q=3, p-2, k+=isprime(2*p-q)); if(k==r, if(r==n, return(p)); r++))} \\ Andrew Howroyd, Jan 12 2020

Extensions

Definition clarified by Andrew Howroyd, Jan 12 2020
Showing 1-5 of 5 results.