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

A045917 From Goldbach problem: number of decompositions of 2n into unordered sums of two primes.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Note that A002375 (which differs only at the n = 2 term) is the main entry for this sequence.
The graph of this sequence is called Goldbach's comet. - David W. Wilson, Mar 19 2012
This is the row length sequence of A182138, A184995 and A198292. - Jason Kimberley, Oct 03 2012
The Goldbach conjecture states that a(n) > 0 for n >= 2. - Wolfdieter Lang, May 14 2016
With the second Maple program, the command G(2n) yields all the unordered pairs of prime numbers having sum 2n; caveat: a pair {a,a} is listed as {a}. Example: G(26) yields {{13}, {3,23}, {7,19}}. The command G(100000) yields 810 pairs very fast. - Emeric Deutsch, Jan 03 2017
Conjecture: Let p denote any prime in any decomposition of 2n. 4 and 6 are the only numbers n such that 2n + p is prime for every p. - Ivan N. Ianakiev, Apr 06 2017
Conjecture: For all m >= 0, there exists at least one possible value of n such that a(n) = m. - Ahmad J. Masad, Jan 06 2018
The previous conjecture is related to the sequence A053033. - Ahmad J. Masad, Dec 09 2019
Conjecture: For each k >= 0, there exists a minimum sufficiently large number r that depends on k such that for each n >= r, a(n) > k. - Ahmad J. Masad, Jan 08 2020
Conjecture: If the previous conjecture is true, then for each m >= 0, the number of terms that are equal to (m+1) is larger than the number of terms that are equal to m. - Ahmad J. Masad, Jan 08 2020
Also, the number of equidistant prime pairs in Goldbach's Prime Triangle for integers n > 2. An equidistant prime pair is a pair of not necessarily different prime numbers (p1, p2) that have the same distance d >= 0 from an integer n, i.e., so that p1 = n - d and p2 = n + d. - Jörg Winkelmann, Mar 05 2025

References

  • Calvin C. Clawson, "Mathematical Mysteries, the beauty and magic of numbers," Perseus Books, Cambridge, MA, 1996, Chapter 12, pages 236-257.
  • H. Halberstam and H. E. Richert, 1974, "Sieve methods", Academic press, London, New York, San Francisco.

Crossrefs

Cf. A002375 (the main entry for this sequence (which differs only at the n=2 term)).
Cf. A023036 (first appearance of n), A000954 (last (assumed) appearance of n).

Programs

  • Haskell
    a045917 n = sum $ map (a010051 . (2 * n -)) $ takeWhile (<= n) a000040_list
    -- Reinhard Zumkeller, Sep 02 2013
    
  • Magma
    [#RestrictedPartitions(2*n,2,Set(PrimesInInterval(1,2*n))):n in [1..100]]; // Marius A. Burtea, Jan 23 2020
  • Maple
    A045917 := proc(n)
        local a,i ;
        a := 0 ;
        for i from 1 to n do
            if isprime(i) and isprime(2*n-i) then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Jul 01 2013
    # second Maple program:
    G := proc (n) local g, j: g := {}: for j from 2 to (1/2)*n do if isprime(j) and isprime(n-j) then g := `union`(g, {{n-j, j}}) end if end do: g end proc: seq(nops(G(2*n)), n = 1 .. 98); # Emeric Deutsch, Jan 03 2017
  • Mathematica
    f[n_] := Length[Select[2n - Prime[Range[PrimePi[n]]], PrimeQ]]; Table[ f[n], {n, 100}] (* Paul Abbott, Jan 11 2005 *)
    nn = 10^2; ps = Boole[PrimeQ[Range[1,2*nn,2]]]; Join[{0,1}, Table[Sum[ps[[i]] ps[[n-i+1]], {i, Ceiling[n/2]}], {n, 3, nn}]] (* T. D. Noe, Apr 13 2011 *)
  • PARI
    a(n)=my(s);forprime(p=2,n,s+=isprime(2*n-p));s \\ Charles R Greathouse IV, Mar 27 2012
    
  • Python
    from sympy import isprime
    def A045917(n):
        x = 0
        for i in range(2,n+1):
            if isprime(i) and isprime(2*n-i):
                x += 1
        return x # Chai Wah Wu, Feb 24 2015
    

Formula

From Halberstam and Richert: a(n) < (8+0(1))*c(n)*n/log(n)^2 where c(n) = Product_{p>2} (1 - 1/(p-1)^2)*Product_{p|n, p>2} (p-1)/(p-2). It is conjectured that the factor 8 can be replaced by 2. - Benoit Cloitre, May 16 2002
a(n) = ceiling(A035026(n) / 2) = (A035026(n) + A010051(n)) / 2.
a(n) = Sum_{i=2..n} floor(2/Omega(i*(2*n-i))). - Wesley Ivan Hurt, Jan 24 2013
a(n) = A224709(n) + (primepi(2n-2) - primepi(n-1)) + primepi(n) + 1 - n. - Anthony Browne, May 03 2016
a(n) = A224708(2n) - A224708(2n+1) + A010051(n). - Anthony Browne, Jun 26 2016
a(n) = Sum_{k=n*(n-1)/2+2..n*(n+1)/2} A064911(A105020(k-1)). - Wesley Ivan Hurt, Sep 11 2021
a(n) = omega(A362641(n)) = omega(A362640(n)). - Wesley Ivan Hurt, Apr 28 2023

A224712 The number of unordered partitions {a, b} of n such that a or b is composite and the other is prime.

Original entry on oeis.org

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

Views

Author

J. Stauduhar, Apr 20 2013

Keywords

Examples

			For n = 6, in the set {{5, 1}, {4, 2}, {3, 3}}, {4, 2} is the only partition that satisfies the requirements, so a(6) = 1.
For n = 9, we have partitions {6, 3} and {5, 4}, so a(9) = 2.
		

Crossrefs

Cf. A062602 (allows 1 as well as composites), A224708 (a and b are both composite).

Programs

A224709 The number of unordered partitions {a,b} of the even numbers 2n such that a and b are composite.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 2, 3, 4, 4, 4, 6, 5, 6, 8, 7, 8, 10, 8, 10, 12, 11, 11, 14, 13, 13, 16, 14, 15, 19, 15, 18, 20, 17, 20, 22, 20, 21, 24, 22, 22, 27, 23, 24, 30, 25, 26, 30, 27, 30, 33, 30, 30, 34, 32, 33, 37, 33, 33, 41, 33, 36, 42, 36, 40, 43, 39, 40, 44
Offset: 1

Views

Author

J. Stauduhar, Apr 16 2013

Keywords

Comments

Conjecture: a(3n+9) > a(3n+8) and a(3n+10) < a(3n+9) for n>=1. - Anthony Browne, Jun 26 2016

Examples

			For n=6, 2*6=12 and the partitions of 12 are (1,11),(2,10),(3,9),(4,8),(5,7),(6,6). Of these, 2 are composite pairs, namely (4,8),(6,6) so a(6)=2.
		

Crossrefs

Subsequence of A224708.
Cf. A010051.

Programs

  • Mathematica
    Table[Count[Transpose@ {#, 2 n - #} &@ Range@ n, w_ /; Times @@ Boole@ Map[CompositeQ, w] > 0], {n, 69}] (* Michael De Vlieger, Jun 26 2016 *)
  • PARI
    a(n) = sum(k=1, n-1, (1-isprime(k+1))*(1-isprime(2*n-k-1))); \\ Michel Marcus, Apr 11 2022

Formula

a(n) = Sum_{k=1..n-1} (1-A010051(k+1))(1-A010051(2n-k-1)). - Anthony Browne, Jun 26 2016

A224710 The number of unordered partitions {a,b} of 2n-1 such that a and b are composite.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 5, 5, 6, 7, 7, 8, 8, 8, 9, 9, 10, 11, 11, 12, 13, 13, 13, 14, 15, 15, 16, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 23, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 28, 29, 30, 31, 32, 33, 33, 34, 34, 35, 36, 36
Offset: 1

Views

Author

J. Stauduhar, Apr 16 2013

Keywords

Comments

Except for the initial terms, the same sequence as A210469.

Examples

			n=7: 13 has a unique representation as the sum of two composite numbers, namely 13 = 4+9, so a(7)=1.
		

Crossrefs

Subsequence of A224708. Cf. A210469.

Programs

  • Mathematica
    Table[Length@ Select[IntegerPartitions[2 n - 1, {2}] /. n_Integer /; ! CompositeQ@ n -> Nothing, Length@ # == 2 &], {n, 71}] (* Version 10.2, or *)
    Table[If[n == 1, 0, n - 2 - PrimePi[2 n - 4]], {n, 71}] (* Michael De Vlieger, May 03 2016 *)

Formula

a(n) = n - 2 - primepi(2n-4) for n>1. - Anthony Browne, May 03 2016
a(A104275(n+2) + 1) = n. - Anthony Browne, May 25 2016

A024683 a(n) is the number of ways prime(n) is a sum of two composite numbers r,s satisfying r < s.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 2, 2, 4, 5, 6, 7, 8, 8, 10, 12, 13, 14, 15, 16, 17, 18, 20, 23, 24, 25, 25, 26, 26, 32, 33, 35, 36, 39, 40, 41, 43, 44, 46, 48, 49, 52, 53, 53, 54, 58, 63, 64, 65, 65, 67, 68, 71, 73, 75, 77, 78, 79, 80, 81, 84, 90, 91, 92, 92, 98, 100, 104, 105, 105, 107, 110, 112, 114
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A224708.

Programs

Formula

a(n) = Sum_{i=4..floor((prime(n)-1)/2)} c(i) * c(prime(n)-i), where c is the characteristic function of composite numbers (A066247) and prime(n) is the n-th prime (A000040). - Wesley Ivan Hurt, Sep 08 2020

A171691 Number of unordered partitions {k1, k2} of n such that k1 and k2 are nonnegative nonprimes A141468.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Dec 15 2009

Keywords

Examples

			a(1) = 1 because 1 = 0 + 1.
a(2) = 1 because 2 = 1 + 1.
a(3) = 0.
a(4) = 1 because 4 = 0 + 4.
a(5) = 1 because 5 = 1 + 4.
a(6) = 1 because 6 = 0 + 6.
a(7) = 1 because 7 = 1 + 6.
a(8) = 2 because 8 = 0 + 8 = 4 + 4.
		

Crossrefs

Programs

  • PARI
    a(n)={sum(i=0, n\2, (i<2 || !isprime(i)) && !isprime(n-i))} \\ Andrew Howroyd, Jan 05 2020

Extensions

Name clarified and terms a(55) and beyond from Andrew Howroyd, Jan 05 2020

A339927 Number of partitions of n into two composite parts with the same number of divisors.

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Dec 23 2020

Keywords

Examples

			a(18) = 2; 18 has two partitions into two composite parts that have the same number of divisors, (10,8) and (9,9).
		

Crossrefs

Programs

Formula

a(n) = Sum_{k=2..floor(n/2)} [d(k) = d(n-k)] * c(k) * c(n-k), where [ ] is the Iverson bracket, d(n) is the number of divisors of n (A000005), and c is the characteristic function of composite numbers (A066247).
Showing 1-7 of 7 results.