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

A001031 Goldbach conjecture: a(n) = number of decompositions of 2n into sum of two primes (counting 1 as a prime).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of decompositions of 2*n into sum of two noncomposite numbers. - Omar E. Pol, Dec 12 2024

Examples

			1 is counted as a prime, so a(1)=1 since 2=1+1, a(2)=2 since 4=2+2=3+1, ..
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 9.
  • Deshouillers, J.-M.; te Riele, H. J. J.; and Saouter, Y.; New experimental results concerning the Goldbach conjecture. Algorithmic number theory (Portland, OR, 1998), 204-215, Lecture Notes in Comput. Sci., 1423, Springer, Berlin, 1998.
  • Apostolos Doxiadis: Uncle Petros and Goldbach's Conjecture, Faber and Faber, 2001
  • R. K. Guy, Unsolved problems in number theory, second edition, Springer-Verlag, 1994.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 79.
  • 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).
  • M. L. Stein and P. R. Stein, Tables of the Number of Binary Decompositions of All Even Numbers Less Than 200,000 into Prime Numbers and Lucky Numbers. Report LA-3106, Los Alamos Scientific Laboratory of the University of California, Los Alamos, NM, Sep 1964.

Crossrefs

Programs

  • Haskell
    a001031 n = sum (map a010051 gs) + fromEnum (1 `elem` gs)
       where gs = map (2 * n -) $ takeWhile (<= n) a008578_list
    -- Reinhard Zumkeller, Aug 28 2013
    
  • Mathematica
    nn = 10^2; ps = Boole[PrimeQ[Range[2*nn]]]; ps[[1]] = 1; Table[Sum[ps[[i]] ps[[2*n - i]], {i, n}], {n, nn}] (* T. D. Noe, Apr 11 2011 *)
  • PARI
    a(n)=my(s); forprime(p=2,n, if(isprime(2*n-p), s++)); if(isprime(2*n-1), s+1, s) \\ Charles R Greathouse IV, Feb 06 2017

Formula

Not very efficient: a(n) = (Sum_{i=1..n} (pi(i) - pi(i-1))*(pi(2*n-i) - pi(2*n-i-1))) + (pi(2*n-1) - pi(2*n-2)) + floor(1/n). - Wesley Ivan Hurt, Jan 06 2013
a(n) = floor((A096139(n)+1)/2). - Reinhard Zumkeller, Aug 28 2013

Extensions

More terms from Ray Chandler, Sep 19 2003

A341982 Number of ways to write n as an ordered sum of 2 primes (counting 1 as a prime).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Feb 24 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; series(`if`(n=0, 1, x*add(
          `if`(j=1 or isprime(j), b(n-j), 0), j=1..n)), x, 3)
        end:
    a:= n-> coeff(b(n), x, 2):
    seq(a(n), n=2..88);  # Alois P. Heinz, Feb 24 2021
  • Mathematica
    nmax = 88; CoefficientList[Series[(x + Sum[x^Prime[k], {k, 1, nmax}])^2, {x, 0, nmax}], x] // Drop[#, 2] &

Formula

G.f.: ( x + Sum_{k>=1} x^prime(k) )^2.

A347744 Number of compositions (ordered partitions) of n into at most 2 prime parts (counting 1 as a prime).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Sep 11 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@Flatten[Permutations/@IntegerPartitions[n,2,Join[{1},Prime@Range@PrimePi@n]],1],{n,0,80}] (* Giorgos Kalogeropoulos, Sep 12 2021 *)
  • PARI
    { a(n) = local(s(n) = if(n<2,1,isprime(n))); if(n==0,1,sum(i=1,n,s(i)*s(n-i))); } \\ Christian Krause, Dec 06 2022
Showing 1-3 of 3 results.