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-4 of 4 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}
    

A092938 a(n) = least prime p such that 2*prime(n) - p is prime.

Original entry on oeis.org

2, 3, 3, 3, 3, 3, 3, 7, 3, 5, 3, 3, 3, 3, 5, 3, 5, 13, 3, 3, 7, 7, 3, 5, 3, 3, 7, 3, 7, 3, 3, 5, 3, 7, 5, 19, 3, 13, 3, 29, 5, 3, 3, 3, 5, 19, 3, 3, 5, 19, 3, 11, 3, 3, 5, 3, 17, 19, 7, 5, 3, 17, 7, 3, 7, 3, 3, 13, 3, 7, 5, 17, 7, 3, 7, 5, 5, 7, 5, 7, 11, 3, 3, 3, 19, 3, 11, 3, 3, 7, 5, 5, 3, 5, 7, 23, 5, 3
Offset: 1

Views

Author

Amarnath Murthy, Mar 23 2004

Keywords

Comments

a(n) = least prime p such that prime(n) = (p+q)/2, where q is also prime.
a(n) <= prime(n). Conjecture: a(n) = prime(n) only for n = 1 and 2.

Examples

			2*prime(8) = 38; 38 - 2 = 36, 38 - 3 = 35, 38 - 5 = 33 are composite, but 38 - 7 = 31 is prime. Hence a(8) = 7.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local pn,p;
       pn:= ithprime(n);
       p:= 1;
       do
         p:= nextprime(p);
         if isprime(2*pn-p) then return p fi
       od
    end proc:
    map(f, [$1..100]); # Robert Israel, Jul 31 2020
  • Mathematica
    a[n_] := Module[{p, q = Prime[n]}, For[p = 2, True, p = NextPrime[p], If[PrimeQ[2q-p], Return[p]]]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 07 2023 *)
  • PARI
    {for(n=1, 98, k=2*prime(n); p=2; while(!isprime(k-p), p=nextprime(p+1)); print1(p,","))} \\ Klaus Brockhaus, Dec 23 2006

Extensions

Edited and extended by Klaus Brockhaus, Dec 23 2006

A092940 a(n) = largest prime p such that 2*prime(n) - p is prime.

Original entry on oeis.org

2, 3, 7, 11, 19, 23, 31, 31, 43, 53, 59, 71, 79, 83, 89, 103, 113, 109, 131, 139, 139, 151, 163, 173, 191, 199, 199, 211, 211, 223, 251, 257, 271, 271, 293, 283, 311, 313, 331, 317, 353, 359, 379, 383, 389, 379, 419, 443, 449, 439, 463, 467, 479, 499, 509, 523
Offset: 1

Views

Author

Amarnath Murthy, Mar 23 2004

Keywords

Comments

a(n) = largest prime p such that prime(n) = (p+q)/2, where q is also prime.
prime(n) <= a(n) < 2*prime(n).
Conjecture: a(n) = prime(n) only for n = 1 and 2.

Examples

			2*prime(18) = 122; the primes smaller than 122 are 113, 109, 107, ... in descending order. 122 - 113 = 9 is not prime, but 122 - 109 = 13 is prime, hence a(18) = 109.
		

Crossrefs

Programs

  • PARI
    {for(n=1,56,k=2*prime(n);q=2;while(!isprime(p=k-q),q=nextprime(q+1));print1(p,","))} \\ Klaus Brockhaus, Dec 23 2006

Formula

a(n) = 2*prime(n) - A092938(n).

Extensions

Edited and extended by Klaus Brockhaus, Dec 23 2006

A283814 Irregular triangle read by rows in which n-th row lists the numbers m such that 2*prime(m) can be represented as the sum of two primes in exactly n ways.

Original entry on oeis.org

1, 2, 3, 4, 8, 5, 6, 11, 7, 9, 10, 18, 12, 13, 14, 15, 22, 16, 17, 19, 21, 23, 24, 25, 27, 29, 30, 34, 38, 46, 20, 28, 42, 26, 31, 32, 36, 37, 40, 50, 41, 43, 58, 33, 35, 39, 45, 47, 52, 53, 59, 44, 48, 49, 65, 51, 61, 62, 55, 57, 60, 66, 67, 70, 85, 54, 56, 63, 68, 72, 73, 75, 77, 79, 64, 76, 78, 80, 81, 83
Offset: 1

Views

Author

Zak Seidov, Mar 17 2017

Keywords

Comments

From b116619.txt it seems that the sequence is correct at least for first 677 terms (first 100 rows of triangle). But as it is usual in number theory better consider this sequence as conjectured.
Lengths of first 100 rows of triangle (see a283814.txt): {2,3,3,4,5,5,8,3,7,3,8,4,3,7,8,1,10,7,6,9,3,7,6,3,4,7,13,4,6,7,7,9,7,8,8,3,8,8,5,5,5,11,5,10,3,6,8,10,5,8,5,9,6,9,6,7,10,6,6,6,8,5,7,12,11,6,8,6,9,4,12,6,8,5,5,5,11,10,13,7,7,10,9,7,4,9,7,5,4,8,7,6,10,7,6,10,6,10,6,6}.

Examples

			3rd row is {5,6,11} because only the 5th, 6th and 11th primes can be represented as the sum of 2 primes in exactly 3 ways:
n=3: 2*prime(5) = 2*11 = 22 = 3 + 19 = 5 + 17 = 11 + 11,
2*prime(6) = 2*13 = 26 = 3 + 23 = 7 + 19 = 13 + 13,
2*prime(11) = 2*31 = 62 = 3 + 59 = 7 + 19 = 19 + 43 = 31 + 31.
		

Crossrefs

Cf. A116619 (number of ways of representing 2*prime(n) as the sum of two primes).

Programs

  • Mathematica
    A116619=Table[Count[PrimeQ[2*Prime[n]-Prime[Range[n]]],True],{n,1000}];
    Flatten[Position[A116619,#]& /@ Range[100]]
Showing 1-4 of 4 results.