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 81-90 of 172 results. Next

A237885 a(n) is the number of ways that 4n can be written as p+q (p>q) with p, q, (p-q)/2, 4n-(p-q)/2 all prime numbers.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 2, 0, 0, 2, 0, 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 1, 1, 0, 4, 0, 0, 2, 0, 1, 1, 0, 1, 2, 0, 0, 2, 0, 0, 3, 0, 0, 2, 0, 1, 1, 0, 0, 2, 0, 0, 1, 0, 0, 5, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 3, 0, 0, 2, 0, 1, 3, 0, 0, 3, 1, 0, 3
Offset: 1

Views

Author

Lei Zhou, Feb 14 2014

Keywords

Comments

2n=q+(p-q)/2; 6n=p+(4n-(p-q)/2).
Number of ways that 2*n can be written as a+b with aRobert Israel, Jun 07 2022

Examples

			When n=4, 4n=16, 16=13+3, (13-3)/2=5, 16-5=11, all four numbers {3, 5, 11, 13} are prime numbers.  There is no other such four number set with this property, so a(4)=1;
When n=30, 4n=120.
  120=113+7, (113-7)/2=53, 120-53=67.  Set 1: {7, 53, 67, 113}.
  120=109+11, (109-11)/2=49=7*7, X
  120=107+13, (107-13)/2=47, 120-47=73. Set 2: {13, 47, 73, 107}.
  120=103+17, (103-17)/2=43, 120-43=77=7*11, X
  120=101+19, (101-19)/2=41, 120-41=79. Set 3: {19, 41, 79, 101}.
  120=97+23, (97-23)/2=37, 120-37=83. Set 4: {23, 37, 83, 97}.
  120=89+31, (89-31)/2=29, 120-29=91=7*13, X
  120=83+37, same with Set 4.
  120=79+41, same with Set 3.
  120=73+47, same with Set 2.
  120=67+53, same with Set 1.
  120=61+59, (61-59)/2=1, X
  So four acceptable sets have been found, and therefore a(30)=4.
		

Crossrefs

Programs

  • Maple
    N:= 100: # for a(1)..a(N)
    V:= Vector(N):
    P:= select(isprime, [seq(i,i=3..2*N,2)]):
    nP:= nops(P):
    for i from 1 to nP do
      p:= P[i];
      for j from i+1 to nP do
        q:= P[j];
        if p+q > 2*N then break fi;
        r:= (p+q)/2;
        if isprime(p+2*q) and isprime(2*p+q) then
          V[r]:= V[r]+1
        fi
      od
    od:
    convert(V,list); # Robert Israel, Jun 08 2022
  • Mathematica
    Table[qn = 4*n; p = 2*n - 1; ct = 0; While[p = NextPrime[p]; p < qn, q = qn - p; If[PrimeQ[q] && PrimeQ[(p - q)/2] && PrimeQ[qn - (p - q)/2], ct++]]; ct/2, {n, 1, 87}]4*n-1
  • PARI
    a(n)=my(s);forprime(p=2,n,if(isprime(2*n-p) && isprime(2*n+p) && isprime(4*n-p), s++)); s \\ Charles R Greathouse IV, Mar 15 2015

A243485 Sum of all the products formed by multiplying the corresponding smaller and larger parts of the Goldbach partitions of n.

Original entry on oeis.org

0, 0, 0, 4, 6, 9, 10, 15, 14, 46, 0, 35, 22, 82, 26, 94, 0, 142, 34, 142, 38, 263, 0, 357, 46, 371, 0, 302, 0, 591, 58, 334, 62, 780, 0, 980, 0, 578, 74, 821, 0, 1340, 82, 785, 86, 1356, 0, 1987, 94, 1512, 0, 1353, 0, 2677, 106, 1421, 0, 2320, 0, 4242, 118
Offset: 1

Author

Wesley Ivan Hurt, Jun 05 2014

Keywords

Comments

a(n) is even for odd n.
If Goldbach's conjecture is true, a(n) > 0 for all even n > 2.
Sum of the areas of the distinct rectangles with prime length and width such that L + W = n, W <= L. For example, a(16) = 94; the two rectangles are 3 X 13 and 5 X 11, and the sum of their areas is 3*13 + 5*11 = 94. - Wesley Ivan Hurt, Oct 28 2017

Crossrefs

Programs

  • Maple
    with(numtheory): A243485:=n->add(i*(n-i)*(pi(i)-pi(i-1))*(pi(n-i)-pi(n-i-1)), i=1..floor(n/2)): seq(A243485(n), n=1..100); # Wesley Ivan Hurt, Oct 29 2017
  • Mathematica
    Table[Sum[i*(n - i)*Floor[2/PrimeOmega[i (n - i)]], {i, 2, n/2}], {n,
      50}]

Formula

a(n) = Sum_{i=2..n/2} i*(n-i) * A064911(i*(n-i)).
a(n) = Sum_{i=1..floor(n/2)} i * (n-i) * A010051(i) * A010051(n-i). - Wesley Ivan Hurt, Oct 29 2017

A256555 Number of ways to write n as the sum of two (unordered) distinct elements of the set {floor(p/3): p is prime}.

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Apr 01 2015

Keywords

Comments

Conjecture: For any integer m > 2, every positive integer can be written as the sum of two distinct elements of the set {floor(p/m): p is prime}.
Note that Goldbach's conjecture essentially asserts that any integer n > 1 can be written as floor(p/2) + floor(q/2) with p and q prime.

Examples

			 a(4) = 2 since 4 = 0 + 4 = 1 + 3 with 0,1,3,4 elements of the set {floor(p/3): p is prime}. Note that floor(2/3) = 0, floor(3/3) = 1, floor(11/3) = 3 and floor(13/3) = 4.
		

Crossrefs

Programs

  • Mathematica
    S[n_]:=Union[Table[Floor[Prime[k]/3], {k,1,PrimePi[3n+2]}]]
    L[n_]:=Length[S[n]]
    Do[r=0;Do[If[Part[S[n],x]>=n/2,Goto[cc]];
    If[MemberQ[S[n], n-Part[S[n],x]]==True,r=r+1]; Continue,{x,1,L[n]}];Label[cc];Print[n," ",r];Continue, {n,1,100}]

A261628 Least prime p such that n-(p*n'-1) and n+(p*n'-1) are both prime where n' = (3+(-1)^n)/2, or 0 if no such prime p exists.

Original entry on oeis.org

0, 0, 0, 0, 3, 0, 5, 2, 3, 2, 7, 3, 7, 2, 3, 2, 7, 3, 13, 2, 3, 5, 7, 3, 7, 2, 5, 5, 13, 7, 13, 5, 5, 2, 7, 3, 7, 5, 3, 2, 13, 3, 31, 2, 3, 17, 7, 3, 13, 2, 11, 5, 7, 7, 13, 2, 5, 11, 13, 7, 19, 5, 5, 2, 7, 3, 7, 11, 3, 2, 13, 13, 7, 17, 5, 2, 7, 3, 19, 5
Offset: 1

Author

Zhi-Wei Sun, Aug 27 2015

Keywords

Comments

Conjecture: 0 < a(n) < sqrt(2*n)*log(5*n) for all n > 6.
See also A261627.
Verified up to 10^9. - Mauro Fiorentini, Jul 05 2023
Conjecture verified for n < 1.2 * 10^12. Also, the 5 inside the log function can probably be replaced by 4.26. - Jud McCranie, Aug 26 2023

Examples

			a(43) = 31 since 31, 43-(31-1) = 13 and 43+(31-1) = 73 are all prime.
a(72) = 13 since 13, 72-(2*13-1) = 47 and 72+(2*13-1) = 97 are all prime.
		

Crossrefs

Programs

  • Mathematica
    Do[Do[If[PrimeQ[n-(3+(-1)^n)/2*Prime[k]+1]&&PrimeQ[n+(3+(-1)^n)/2*Prime[k]-1],Print[n," ",Prime[k]];Goto[aa]],{k,1,PrimePi[2n/(3+(-1)^n)]}];Print[n," ",0];Label[aa];Continue,{n,1,80}]

A276034 a(n) is the number of decompositions of 2n into an unordered sum of two primes in A274987.

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 3, 2, 1, 2, 2, 2, 1, 2, 1, 0, 2, 1, 1, 2, 2, 3, 3, 2, 2, 2, 2, 3, 2, 1, 2, 4, 3, 1, 5, 3, 2, 5, 1, 2, 2, 2, 5, 2, 3, 4, 5, 3, 2, 5, 2, 1, 4, 0, 1, 5, 3, 1, 3, 5, 4, 4, 3, 2, 4, 3, 3, 4, 2, 3, 7, 2, 2, 3, 2, 2, 2
Offset: 1

Author

Lei Zhou, Nov 15 2016

Keywords

Comments

The two primes are allowed to be the same.
It is conjectured that the primes in A274987 (a subset of all primes) are sufficient to decomposite even numbers into two primes in A274987 when n > 958.
This sequence provides a very tight alternative of the Goldbach conjecture for all positive integers, in which indices of zero terms form a complete sequence {1, 2, 16, 26, 64, 97, 107, 122, 146, 167, 194, 391, 451, 496, 707, 856, 958}.
There is no more zero terms of a(n) tested up to n = 100000.

Examples

			A274987 = {3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 59, 61, 73, 79, 83, 89, 101, 103, 109, ...}.
For n=3, 2n=6 = 3+3, one case of decomposition, so a(3)=1;
for n=4, 2n=8 = 3+5, one case of decomposition, so a(4)=1;
...
for n=17, 2n=34 = 3+31 = 11+23 = 17+17, three cases of decompositions, so a(17)=3.
		

Programs

  • Mathematica
    p = 3; sp = {p}; a = Table[m = 2*n; l = Length[sp]; While[sp[[l]] < m, While[p = NextPrime[p]; cp = 2*3^(Floor[Log[3, 2*p - 1]]) - p; ! PrimeQ[cp]]; AppendTo[sp, p]; l++]; ct = 0; Do[If[(2*sp[[i]] <= m) && (MemberQ[sp, m - sp[[i]]]), ct++], {i, 1, l}]; ct, {n, 1, 87}]

A276520 a(n) is the number of decompositions of n into unordered form p + c*q, where p, q are terms of A274987, c=1 for even n-s and c=2 for odd n-s.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 1, 1, 2, 1, 1, 2, 2, 1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 0, 3, 3, 1, 2, 4, 1, 3, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 1, 3, 0, 2, 2, 0, 1, 3, 1, 3, 2, 0, 2, 3, 3, 3, 3, 3, 2, 3, 2, 2, 2, 2, 2, 3, 3, 2, 2, 4, 1, 2, 2, 3, 4, 4, 3, 4
Offset: 1

Author

Lei Zhou, Nov 11 2016

Keywords

Comments

p=q is allowed.
It is conjectured that the primes p, q in A274987 (a subset of all primes) are sufficient to decomposite all numbers into p and c*q (c=1 when n is even, 2 when c is odd) when n > 2551.
This sequence provides a very tight alternative of the Goldbach conjecture for all positive integers, in which indices of zero terms form a complete sequence {1, 2, 3, 4, 5, 7, 32, 52, 55, 61, 128, 194, 214, 244, 292, 334, 388, 782, 902, 992, 1414, 1571, 1712, 1916, 2551}.
There are no more zero terms of a(n) up to n = 100000.

Examples

			A274987 = {3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 59, 61, 73, 79, 83, 89, 101, 103, 109, ...}
For n=6, 6 = 3+3, one case of decomposition, so a(6)=1;
For n=7, 7 < 3+2*3=9, no eligible case could be found, so a(7)=0;
...
For n=17, 17 = 3+2*7 = 7+2*5 = 11+2*3, three cases of decompositions, so a(17)=3.
		

Programs

  • Mathematica
    p = 3; sp = {p}; Table[l = Length[sp]; While[sp[[l]] < n, While[p = NextPrime[p]; cp = 2*3^(Floor[Log[3, 2*p - 1]]) - p; ! PrimeQ[cp]]; AppendTo[sp, p]; l++]; c = 2 - Mod[n + 1, 2]; ct = 0; Do[If[MemberQ[sp, n - c*sp[[i]]], If[c == 1, If[(2*sp[[i]]) <= n, ct++], ct++]], {i, 1, l}]; ct, {n, 1, 87}]

A279103 Number of Goldbach partitions (p,q) of 2n such that there exists a prime r in p < r < q that does not appear as a part in any Goldbach partition of p+q = 2n.

Original entry on oeis.org

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

Author

Wesley Ivan Hurt, Dec 06 2016

Keywords

Crossrefs

Formula

a(n) = A002375(n) - A278700(n).
a(n) = Sum_{i=3..n} (A010051(i) * A010051(2n-i) * (1 - Product_{k=i..n} (1 - abs(A010051(k) - A010051(2n-k))))).

A279792 Number of Goldbach partitions (p,q) of 2n such that 0 < |p-q| < n.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 0, 1, 2, 1, 0, 2, 1, 1, 2, 1, 1, 2, 0, 2, 3, 1, 1, 2, 2, 1, 2, 1, 1, 4, 1, 2, 3, 1, 2, 3, 1, 2, 2, 1, 2, 4, 0, 2, 5, 1, 1, 3, 2, 3, 4, 3, 1, 4, 3, 3, 5, 2, 1, 6, 1, 2, 5, 1, 3, 4, 2, 2, 4, 4, 3, 6, 3, 3, 7, 2, 4, 6, 1, 4, 5, 2, 2, 5, 4, 3, 5, 3, 2, 6
Offset: 1

Author

Wesley Ivan Hurt, Dec 18 2016

Keywords

Crossrefs

Programs

  • Maple
    with(numtheory): A279792:=n->add( (pi(i)-pi(i-1)) * (pi(2*n-i)-pi(2*n-i-1)) * signum(floor(n/(2*(n-i)))), i=3..n-1): seq(A279792(n), n=1..100);
  • Mathematica
    Table[Sum[Boole[PrimeQ@ i] Boole[PrimeQ[2 n - i]] Sign@ Floor[n/(2 (n - i))], {i, 3, n - 1}], {n, 90}] (* Michael De Vlieger, Dec 21 2016 *)

Formula

a(n) = Sum_{i=3..n-1} A010051(i) * A010051(2n-i) * sign(floor(n/(2*(n-i)))).

A303603 a(n) is the maximum distance between primes in Goldbach partitions of 2n, or 2n if there are no Goldbach partitions of 2n.

Original entry on oeis.org

0, 0, 0, 2, 4, 2, 8, 10, 8, 14, 16, 14, 20, 18, 16, 26, 28, 26, 24, 34, 32, 38, 40, 38, 44, 42, 40, 50, 48, 46, 56, 58, 56, 54, 64, 62, 68, 70, 68, 66, 76, 74, 80, 78, 76, 86, 84, 82, 60, 94, 92, 98, 100, 98, 104, 106, 104, 110, 108, 106, 96, 102, 100, 90, 124, 122, 128, 126, 124, 134, 136, 134, 132
Offset: 1

Author

Marcin Barylski, Apr 26 2018

Keywords

Comments

The Goldbach Strong Conjecture is true if and only if a(n) = 2n for some n.
Terms are always even numbers because primes present in Goldbach partitions of n > 4 are odd and n = 4 has just one partition (2+2) where difference is 0.
Conjecture: Only first terms are 0 and all further terms are bigger than 0. Excluding a(1), a(n) = 0 iff the only Goldbach partition of 2n is n+n.

Examples

			a(1) = 0 for coherence with other related sequences.
a(2) = 0 because 2 * 2 = 4 = 2 + 2 and max_diff = 2 - 2 = 0.
a(8) = 10 because 2 * 8 = 16 = 5 + 11 = 3 + 13 and max_diff = 13 - 3 = 10.
		

Crossrefs

Cf. A002372, A002375, A047949, A066285 (minimum distance), A305883.

Programs

  • Mathematica
    a[1]=a[2]=0;
    a[n_]:=Module[{p=3},While[PrimeQ[2*n-p]!=True,p=NextPrime[p]];2*(n-p)];
    a/@Range[73] (* Ivan N. Ianakiev, Jun 27 2018 *)
  • PARI
    a(n) = if (n==1, 0, forprime(p=2, , if (isprime(2*n-p), return (2*n-2*p)))); \\ Michel Marcus, Jul 02 2018

Formula

a(n) = 2 * A047949(n) if A047949(n) > 0 for n >= 2; a(n) = 2n if A047949(n) = -1. - Alois P. Heinz, Jun 01 2020

A350399 a(n) is the number of prime pairs (p,q) with p <= q, p+q = 2*n, and p*q mod (2*n) prime.

Original entry on oeis.org

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

Author

J. M. Bergot and Robert Israel, Dec 28 2021

Keywords

Comments

Conjecture: a(n) > 0 for n >= 3.
a(n) <= A002375(n) with equality for n in A350398.

Examples

			a(7) = 2 because there are 2 such pairs, namely 14 = 3+13 = 7+7 with 3*13 == 5 (mod 14) and 7*7 == 7 (mod 14).
		

Crossrefs

Programs

Previous Showing 81-90 of 172 results. Next