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.

A277581 Goldbach's problem extended to squares of nonnegative differences of primes: smallest integer >= ((A112823(n) - A234345(n))^2)/n for n >= 2.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Oct 21 2016

Keywords

Comments

Where A112823(n) + A234345(n) = 2n and A112823(n) <= A234345(n) (or nonnegative differences of primes). If n is prime, then a(n) = 0.
Conjecture: 1 <= a(n) <= m for all n, where m is largest value of a(n), i.e., the sequence of records in a(n) {1, 5, 15, 20, ..., m} is finite.

Examples

			a(8) = 5 because ((A112823(8) - A234345(8))^2)/8 = ((5 - 11)^2)/8 < 5, where 5(prime) + 11(prime) = 2*8;
a(9) = 2 because ((A112823(9) - A234345(9))^2)/9 = ((7 - 11)^2)/9 < 2, where 7(prime) + 11(prime) = 2*9;
a(10) = 4 because ((A112823(10) - A234345(10))^2)/10 = ((7 - 13)^2)/10 < 4, where 7(prime) + 13(prime) = 2*10.
		

Crossrefs

Cf. A112823 (2 together with A002374), A234345, A277583 (Goldbach's problem extended to squares of prime gaps >= 2).

A002374 Largest prime <= n in any decomposition of 2n into a sum of two odd primes.

Original entry on oeis.org

3, 3, 5, 5, 7, 5, 7, 7, 11, 11, 13, 11, 13, 13, 17, 17, 19, 17, 19, 13, 23, 19, 19, 23, 23, 19, 29, 29, 31, 23, 29, 31, 29, 31, 37, 29, 37, 37, 41, 41, 43, 41, 43, 31, 47, 43, 37, 47, 43, 43, 53, 47, 43, 53, 53, 43, 59, 59, 61, 53, 59, 61, 59, 61, 67, 53, 67, 67, 71, 71, 73, 59
Offset: 3

Views

Author

Keywords

Comments

Sequence A112823 is identical except that it is very naturally extended to a(2) = 2, i.e., the word "odd" is dropped from the definition. - M. F. Hasler, May 03 2019

References

  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 80.
  • N. Pipping, Neue Tafeln für das Goldbachsche Gesetz nebst Berichtigungen zu den Haussnerschen Tafeln, Finska Vetenskaps-Societeten, Comment. Physico Math. 4 (No. 4, 1927), pp. 1-27.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Essentially the same as A112823. - Franklin T. Adams-Watters, Jan 25 2010

Programs

  • Mathematica
    nmax = 74; a[n_] := (k = 0; While[k < n && (!PrimeQ[n-k] || !PrimeQ[n+k]), k++]; If[k == n, n+1, n-k]); Table[a[n], {n, 3, nmax}](* Jean-François Alcover, Nov 14 2011, after Jason Kimberley *)
    lp2n[n_]:=Max[Select[Flatten[Select[IntegerPartitions[2n,{2}],AllTrue[ #, PrimeQ]&]],#<=n&]]; Array[lp2n,80,2] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jun 08 2018 *)
  • PARI
    a(n)=forstep(k=n,1,-1, if(isprime(k) && isprime(2*n-k), return(k))) \\ Charles R Greathouse IV, Feb 07 2017
    
  • PARI
    A002374(n)=forprime(q=n, 2*n, isprime(2*n-q)&&return(2*n-q)) \\ M. F. Hasler, May 03 2019

Formula

a(n) = n - A047160(n) = A112823(n) (for n >= 3). - Jason Kimberley, Aug 31 2011

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Sep 21 2000

A325142 a(n) = k if (n - k, n + k) is the centered Goldbach partition of 2n if it exists and -1 otherwise.

Original entry on oeis.org

-1, -1, 0, 0, 1, 0, 1, 0, 3, 2, 3, 0, 1, 0, 3, 2, 3, 0, 1, 0, 3, 2, 9, 0, 5, 6, 3, 4, 9, 0, 1, 0, 9, 4, 3, 6, 5, 0, 9, 2, 3, 0, 1, 0, 3, 2, 15, 0, 5, 12, 3, 8, 9, 0, 7, 12, 3, 4, 15, 0, 1, 0, 9, 4, 3, 6, 5, 0, 15, 2, 3, 0, 1, 0, 15, 4, 3, 6, 5, 0, 9, 2, 15, 0
Offset: 0

Views

Author

Peter Luschny, May 02 2019

Keywords

Comments

Let N = 2*n = p + q where p and q are primes. We call such a pair (p, q) a Goldbach partition of N. A centered Goldbach partition is the Goldbach partition of the form (n - k, n + k) where k >= 0 is minimal. If N has a centered Goldbach partition then a(n) is this k and otherwise -1.
According to Goldbach's conjecture, any even N = 2n > 2 has a Goldbach partition, which is necessarily of the form p = n - k, q = n + k: namely, with n = (p+q)/2 and k = (q-p)/2. - M. F. Hasler, May 02 2019

Examples

			a(162571) = 78 because 325142 = 162493 + 162649 and there is no k, 0 <= k < 78, such that (162571 - k, 162571 + k) is a Goldbach partition of 325142.
		

Crossrefs

Programs

  • Maple
    a := proc(n) local k; for k from 0 to n do
    if isprime(n + k) and isprime(n - k) then return k fi od: -1 end:
    seq(a(n), n=0..83);
  • Mathematica
    a[n_] := Module[{k}, For[k = 0, k <= n, k++, If[PrimeQ[n+k] && PrimeQ[n-k], Return[k]]]; -1]; Table[a[n], {n, 0, 83}] (* Jean-François Alcover, Jul 06 2019, from Maple *)
  • PARI
    a(n) = for(k=0, n, if(ispseudoprime(n+k) && ispseudoprime(n-k), return(k))); -1 \\ Felix Fröhlich, May 02 2019
    
  • PARI
    apply( A325142(n)=-!forprime(p=n,2*n, isprime(n*2-p)&&return(p-n)), [0..99]) \\ M. F. Hasler, May 02 2019

Formula

a(n) = n - A112823(n) = A234345(n) - n (= n - A002374(n) for n > 2). - M. F. Hasler, May 02 2019
a(n) = A047160(n) = A066285(n)/2 for n >= 2. - Alois P. Heinz, Jun 01 2020

A338777 a(n) = Product_{k in GB(2*n)} k, where GB(n) is the set of primes which are Goldbach-associated with n.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 5, 7, 5, 35, 7, 55, 385, 91, 11, 1001, 13, 187, 1547, 133, 187, 2717, 91, 391, 24871, 247, 253, 55913, 247, 5423, 2800733, 589, 4301, 164749, 31, 124729, 2442583, 14911, 11339, 4075291, 9139, 300817, 2629420651, 10621, 20213, 116883421171, 7657
Offset: 0

Views

Author

Peter Luschny, Nov 08 2020

Keywords

Comments

For an integer n >= 0 we say a prime p is gb-associated with n if sqrt(n) < p <= n/2 and no prime q which is <= sqrt(n) divides p*(p - n). Let GB(n) be the set of integers which are gb-associated with n. Then a(n) = Product_{k in GB(2*n)} k.
If a(n) != 1 for n >= 3 then Goldbach's conjecture is true. In this case m = max(GB(2*n)) exists and P = (2*n - m, m) is a Goldbach partition of 2*n (cf. A234345).

Examples

			m:  GB(m)  -> Product(GB)
0:   []    -> 1
2:   []    -> 1
4:   []    -> 1
6:   [3]   -> 3
8:   [3]   -> 3
10:  [5]   -> 5
...
90:  [11, 17, 19, 23, 29, 31, 37, 43] -> 116883421171
92:  [13, 19, 31]                     -> 7657
94:  [11, 23, 41, 47]                 -> 487531
96:  [13, 17, 23, 29, 37, 43]         -> 234524537
98:  [19, 31, 37]                     -> 21793
100: [11, 17, 29, 41, 47]             -> 10450121
		

Crossrefs

Programs

  • SageMath
    def gb_associated(n):
        r = isqrt(n)
        A = prime_range(2, r + 1)
        B = prime_range(r + 1, n // 2 + 1)
        return [p for p in B if all((p * (p - n) % q) != 0 for q in A)]
    def A338777(n):
        return prod(gb_associated(2*n))
    print([A338777(n) for n in range(47)])

A242189 a(n) is the smallest prime number such that every even number from 6 to 2n can be written as the sum of two primes less than or equal to a(n).

Original entry on oeis.org

3, 5, 5, 7, 7, 11, 11, 13, 13, 13, 13, 17, 17, 19, 19, 19, 19, 23, 23, 31, 31, 31, 31, 31, 31, 37, 37, 37, 37, 41, 41, 41, 41, 41, 41, 47, 47, 47, 47, 47, 47, 47, 47, 61, 61, 61, 61, 61, 61, 61, 61, 61, 67, 67, 67, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 83
Offset: 3

Views

Author

Lei Zhou, May 06 2014

Keywords

Comments

The two primes stated in the name can be equal.

Examples

			n=3, 2*3=6=3+3. Since 3 is the smallest prime needed, a(3)=3.
n=4, 2*3=6=3+3, 2*4=8=5+3, Since 5 is the smallest prime needed, a(4)=5.
...
n=14, we need to consider the even numbers from 6 to 2*14=28, while trying to minimize the larger prime number used to decompose such even numbers. 6=3+3; 8=5+3; 10=5+5; 12=7+5; 14=7+7; 16=11+5; 18=11+7; 20=13+7; 22=11+11; 24=13+11; 26=13+13; 28=17+11. The maximum prime number used is 17. So a(14)=17.
		

Crossrefs

Programs

  • Maple
    f:= proc(m) local p,p0;
       p0:= m/2; if p0::even then p0:= p0+1 fi;
       for p from p0 by 2 do if isprime(p) and isprime(m-p) then return p fi od
    end proc:
    R:= 3: m:= 3:
    for i from 8 to 200 by 2 do
      v:= f(i);
      if v > m then R:= R,v; m:= v
      else R:= R,m
      fi
    od:
    R; # Robert Israel, Oct 10 2024
  • Mathematica
    a = {2}; Table[found = 0; While[la = Length[a]; xx = 1; Do[yy = 0; Do[If[MemberQ[a, i*2 - a[[j]]], yy = 1], {j, 1, la}]; If[yy == 0, xx = 0], {i, 3, n}]; If[xx == 1, found = 1]; found == 0, AppendTo[a, NextPrime[Last[a]]]]; Last[a], {n, 3, 68}]

Formula

a(n) = max_{3 <= i <= n} A234345(i). - Robert Israel, Oct 10 2024

Extensions

Name corrected by Robert Israel, Oct 10 2024
Showing 1-5 of 5 results.