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 61-70 of 109 results. Next

A002126 Number of solutions to n=p+q where p and q are primes or zero.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Arises in studying the Goldbach conjecture.

References

  • P. A. MacMahon, Properties of prime numbers deduced from the calculus of symmetric functions, Proc. London Math. Soc., 23 (1923), 290-316. [Coll. Papers, Vol. II, pp. 354-382] [The sequence N_{n,2}]
  • 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

Programs

  • PARI
    (a(n) = sum(k=0, n, zp(k)*zp(n-k))); {zp(n) = if( n==0, 1, isprime(n))}; /* Michael Somos, Jul 26 1999 */

Formula

G.f.: (1 + Sum_i x^prime(i))^2. [Corrected by T. D. Noe, Dec 05 2006]

Extensions

a(54) corrected by Paul Zimmermann, Mar 15 1996
Better description from Michael Somos, Jul 26 1999

A056636 Conjecturally largest even integer which is the sum of two primes in at most n ways.

Original entry on oeis.org

2, 12, 68, 128, 152, 188, 332, 398, 398, 488, 632, 692, 692, 992, 992, 992, 1112, 1112, 1412, 1412, 1448, 1718, 1718, 1718, 1718, 2048, 2252, 2252, 2672, 2672, 2672, 2936, 2936, 2936, 2978, 3092, 3092, 3218, 3272, 3296, 3632, 3632, 3754, 4022, 4058, 4412
Offset: 0

Views

Author

Brian Galebach, Aug 17 2000

Keywords

Comments

The Goldbach conjecture is that every even number >= 4 is the sum of two primes.

Examples

			a(1) is 12 because it is the largest even integer having only 1 distinct way to express it as the sum of two primes (7+5) and a(0) < 12.
a(8) = 398 because it is the largest number in A000954 for n <= 8.
		

Crossrefs

Formula

a(n) = max({A000954(i),i=0..n}). - Robert Israel, Mar 21 2016

A083339 a(n) is the number of distinct prime factors of n that occur in partitions into two primes when n is even and into three primes when n is odd.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Apr 24 2003

Keywords

Comments

Number of distinct prime factors of n that occur in prime-partitions confirming Goldbach's conjectures. (The original name of this sequence.)
Conjecture: Apart from k=2, A070826(k): 1, 3, 15, 105, 1155, 15015, 255255, gives the positions of records (each equal to k-1). This follows from the conjectured formula. - Antti Karttunen, Sep 14 2017

Examples

			For n = 14 = 2*7 = 3 + 11 = 7 + 7, only one factor of 14 occurs, thus a(14) = 1.
For n = 15 = 3*5 = 2 + 2 + 11 = 3 + 5 + 7 = 5 + 5+ 5, both factors of 15 occur, thus a(15) = 2.
For n = 105 = 3*5*7, with 35 different partitions into three primes, the partition 97 + 5 + 3 contains the prime factors 3 and 5, while the partition 79 + 19 + 7 contains 7, thus all three prime factors of 115 occur and a(115) = 3.
For n = 1155 = 3*5*7*11, among 891 different partitions into three primes, the following four partitions: 1129 + 23 + 3 = 1129 + 19 + 7 = 1109 + 41 + 5 = 1103 + 41 + 11 each have either 3, 5, 7 or 11 as one of their parts, thus a(1155) = 4.
		

Crossrefs

Programs

  • Mathematica
    Table[Count[Union@ Flatten@ Select[IntegerPartitions[n, {2 + Boole[OddQ@ n]}], AllTrue[#, PrimeQ] &], p_ /; Divisible[n, p]], {n, 105}] (* Michael De Vlieger, Sep 16 2017 *)

Formula

If n is even, a(n) = A010051(n/2), if n is an odd prime, a(n) = 0, and for odd composites (conjecturally), a(n) = A001221(n). - Antti Karttunen, Sep 14 2017

Extensions

Name edited and two further examples added by Antti Karttunen, Sep 14 2017

A109679 Smallest even number which is the unordered sum of two primes in more ways than any previous even number.

Original entry on oeis.org

2, 4, 10, 22, 34, 48, 60, 78, 84, 90, 114, 120, 168, 180, 210, 300, 330, 390, 420, 510, 630, 780, 840, 990, 1050, 1140, 1260, 1470, 1650, 1680, 1890, 2100, 2310, 2730, 3150, 3570, 3990, 4200, 4410, 4620, 5250, 5460, 6090, 6510, 6930, 7980, 8190, 9030, 9240
Offset: 1

Views

Author

Gilmar Rodriguez Pierluissi (gilmarlily(AT)yahoo.com), Aug 30 2005

Keywords

Comments

Record value of A023036 or A045917.
a(n)== 0 (mod 30) for n > 13.

Crossrefs

Essentially the same as A082917. Cf. A082918, A002375, A023036, A045917, A000954.

Programs

  • Mathematica
    f[n_] := Length[ Select[n - Prime@ Range@ PrimePi[n/2], PrimeQ]]; t = {}; mxm = -1; Do[ If[ f[n] > mxm, AppendTo[t, n]; mxm = f[n]], {n, 2, 9000, 2}]; t

Extensions

Edited and extended by Robert G. Wilson v, Sep 08 2005
Changed offset from 0 to 1 by Vincenzo Librandi, Apr 18 2013

A137820 Record indices of the ratio A002375(n) / n (Goldbach conjecture related).

Original entry on oeis.org

3, 4, 6, 14, 16, 19, 31, 34, 64, 163, 166, 199, 316, 496, 706, 859, 1024, 1126, 1321, 1336, 2206, 2539, 2644, 2719, 2734, 2974, 3646, 3754, 3931, 4021, 4801, 6826, 7894, 8431, 8506, 9109, 9623, 9904, 10084, 10174, 10321, 10639, 11749, 11839, 13894, 13954, 16174
Offset: 1

Views

Author

M. F. Hasler, Feb 23 2008

Keywords

Comments

The sequence lists indices n for which A002375(n)/n is less than for all previous indices n > 2, or equivalently, assuming that A002375(n) > 0 for all n > 2 (Goldbach conjecture), values for which n/A002375(n) is greater than for all previous indices n > 2.
We do not consider indices n = 1 and n = 2, for which the sequence A002375(n) (= number of prime {p,q} such that 2n = p+q) is zero.
Note also that A045917 = A002375 except for n = 2; since we exclude n < 3, one can equivalently replace one of these two with the other in the definition.
In A002375, an upper bound for A002375(n) is given; however, the Goldbach conjecture is A002375(n) > 0 for all n > 2, thus rather connected to the question of a lower bound. This sequence lists values of n for which A002375(n) is particularly low.
If the conjecture is wrong, then this sequence A137820 is finite: It will end with the counterexample n such that A002375(n) = 0, i.e., 2n cannot be written as the sum of 2 primes.
Conjecture: All terms of this sequence are of the form 2^i, 2^i*p, or 2^i*p*q where i >= 0 and p and q not necessarily distinct odd primes. - Craig J. Beisel, Jun 15 2020

Crossrefs

Cf. A002375 (number of ways to write 2n as sum of two primes).

Programs

  • PARI
    m=1;for(n=3,10^4,n*m<=A002375(n)&&next;m=A002375(n)/n;print1(n", "))

Formula

A137820(k+1) = min { n>2 | A002375(n)/n < A002375(A137820(k))/A137820(k) }.

A186201 Consider all ways of writing 2n = p + q where p, q are primes, p <= n and q >= n; let s1(n) = sum of the p's and s2(n) = sum of the q's; the sequence lists the integers 2n for which s1(n) divides s2(n).

Original entry on oeis.org

4, 6, 16, 18, 20, 32, 52, 72, 102, 180, 3212
Offset: 1

Views

Author

J. M. Bergot, Feb 14 2011

Keywords

Comments

This is a list of values of 2n such that A185297(n) divides A187129(n). - N. J. A. Sloane, Mar 10 2011
I have some fast code for counting Goldbach partitions. I made a slight change so that it sums the partitions instead. Using this new program, I did not find any additional terms < 10^7. - T. D. Noe, Mar 10 2011

Examples

			For 2n=52, the partitions are (5,47), (11,41) and (23,29).  The lesser sum of primes is 5+11+23=39 and the greater sum of primes is 29+41+47=117, with 39|117 for quotient 3.
For the 2n listed, the values of (s1(n), s2(n)/s1(n)) are (2,1), (3,1), (8,3), (12,2), (10,3), (16,3), (39,3), (108,3), (204,3), (630,3), (35332,3).
		

Crossrefs

Programs

  • Mathematica
    okQ[n_] := Module[{p, q}, p = Select[Prime[Range[PrimePi[n]]], PrimeQ[2 n - #] &]; q = 2 n - p; Mod[Plus @@ q, Plus @@ p] == 0]; 2*Select[Range[2, 10000], okQ]
  • PARI
    isok(n) = if (!(n%2), my(s1=0, s2=0); forprime(p=1, n/2, if (isprime(n-p), s1 += p; s2 += n-p)); s1 && !(s2 % s1));
    for (n=1, 10000, if (isok(2*n), print1(2*n, ", "))) \\ Michel Marcus, Mar 13 2023

A193262 Number of representations of 2*p_n as sum of two primes p,q such that p*q-2 is prime (p_n is the n-th prime).

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Aug 04 2011

Keywords

Comments

Sequence arising in connection with conjecture in comment to A192189.
Conjecture: There exists n_0, such that, for n>n_0, a(n)>0.

Examples

			a(4)=2 since 2*p(4) = 14 = 3+11 = 7+7, and 3*11-2 = 31, 7*7-2 = 47 are prime.
		

Crossrefs

Cf. A045917.

Programs

  • Maple
    a:= proc(n) local t, s, p, q;
          t:= 2*ithprime(n);
          s:= 0;
          p:= 2;
          do q:= t-p;
             if q
  • Mathematica
    a[n_] := Module[{t = 2 Prime[n], s = 0, p = 2, q}, While[True, q = t - p; If[q < p, Break[]]; If[PrimeQ[q] && PrimeQ[p q - 2], s++]; p = NextPrime[p]]; s];
    Array[a, 100] (* Jean-François Alcover, Nov 11 2020, after Alois P. Heinz *)
  • PARI
    A193262(n,c=0)={ n=2*prime(n); forprime(p=1,n/2,isprime(n-p) || next; isprime(p*(n-p)-2) & c++);c}  \\ M. F. Hasler, Aug 06 2011

A254687 Number of decompositions of 2n into sums of two primes p1 < p2 such that p2-p1-1 is also a prime.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Feb 05 2015

Keywords

Comments

a(n)=0 for n = 1, 2, 3, 4, 6, 18, 79. It is conjectured that there is not any other n for which a(n)=0.

Examples

			n=5, 2n=10=3+7. 7-3-1=3 is prime, so a(5)=1;
n=6, 2n=12=5+7. 7-5-1=1 is not prime, so a(6)=0;
...
n=21, 2n=42=5+37=11+31=13+29=19+23. 37-5-1=31 is prime, 31-11-1=19 is prime, 29-13-1=15 is composite, 23-19-1=3 is prime: three primes in the form of p2-p1-1 found, so a(21)=3.
		

Crossrefs

Programs

  • Mathematica
    Table[e = 2 n; ct = 0; p1 = 1; While[p1 = NextPrime[p1]; p1 < n, p2 = e - p1; If[PrimeQ[p2], If[PrimeQ[Abs[p2 - p1 - 1]], ct++]]]; ct, {n, 1, 100}]
  • Python
    from sympy import isprime, nextprime
    def A254687(n):
        y, x, n2 = 0, 2, 2*n
        while x < n:
            if isprime(n2-x) and isprime(n2-2*x-1):
                y += 1
            x = nextprime(x)
        return y # Chai Wah Wu, Feb 18 2015

A254688 Number of decompositions of 2n into sums of two primes p1 < p2 such that p2-p1+1 is also a prime.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Feb 05 2015

Keywords

Comments

a(n)=0 for n = 1, 2, 3, 7, 19, 31, 139. It is conjectured that there is not any other n for which a(n)=0.

Examples

			n=4, 2n=8=3+5. 5-3+1=3 is prime, so a(4)=1;
n=7, 2n=14=3+11. 11-3+1=9 is not prime, so a(7)=0;
...
n=18 2n=36=5+31=7+29=13+23=17+19. 31-5+1=27 is composite, 29-7+1=23 is prime, 23-13+1=11 is prime, 19-17+1=3 is prime: three primes in the form of p2-p1+1 found, so a(18)=3.
		

Crossrefs

Programs

  • Mathematica
    Table[e = 2 n; ct = 0; p1 = 1; While[p1 = NextPrime[p1]; p1 < n, p2 = e - p1; If[PrimeQ[p2], If[PrimeQ[p2 - p1 + 1], ct++]]]; ct, {n, 1, 100}]
  • Python
    from sympy import isprime, nextprime
    def A254688(n):
        y, x, n2 = 0, 2, 2*n
        while x < n:
            if isprime(n2-x) and isprime(n2-2*x+1):
                y += 1
            x = nextprime(x)
        return y # Chai Wah Wu, Feb 18 2015

A322006 a(n) = number of primes of the form p = n - q, where q is a prime or semiprime.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Jan 06 2019

Keywords

Comments

Related to Chen's theorem (Chen 1966, 1973) which states that every sufficiently large even number is the sum of a prime and another prime or semiprime. Yamada (2015) has proved that this holds for all even numbers larger than exp(exp(36)).
In terms of this sequence, Chen's theorem with Yamada's bound is equivalent to say that a(2*n) > 0 for all n > 1.7 * 10^1872344071119348 (exponent ~ 1.8*10^15).
Sequence A322007(n) = a(2n) lists the bisection corresponding to even numbers only.
A235645 lists the number of decompositions of 2n into a prime p and a prime or semiprime q; this is less than a(2n) because p + q and q + p is the same decomposition (if q is a prime), but this sequence will count the two distinct primes 2n - q and 2n - p (if q <> p).

Examples

			a(4) = 1 is the first nonzero term corresponding to 4 = 2 + 2 or, rather, to the prime 2 = 4 - 2.
a(5) = 2 because the primes 2 = 5 - 3 and 3 = 5 - 2 are of the required form n - q where q = 3 resp. q = 2 are primes.
a(6) = 2 because the primes 2 = 6 - 4 and 3 = 6 - 3 are of the required form n - q, since q = 4 is a semiprime and q = 3 is a prime.
		

References

  • Chen, J. R. (1966). "On the representation of a large even integer as the sum of a prime and the product of at most two primes". Kexue Tongbao. 11 (9): 385-386.
  • Chen, J. R. (1973). "On the representation of a larger even integer as the sum of a prime and the product of at most two primes". Sci. Sinica. 16: 157-176.

Crossrefs

Programs

  • PARI
    A322006(n,s=0)={forprime(p=2,n-2,bigomega(n-p)<3&&s++);s}
Previous Showing 61-70 of 109 results. Next