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-10 of 31 results. Next

A005843 The nonnegative even numbers: a(n) = 2n.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120
Offset: 0

Views

Author

Keywords

Comments

-2, -4, -6, -8, -10, -12, -14, ... are the trivial zeros of the Riemann zeta function. - Vivek Suri (vsuri(AT)jhu.edu), Jan 24 2008
If a 2-set Y and an (n-2)-set Z are disjoint subsets of an n-set X then a(n-2) is the number of 2-subsets of X intersecting both Y and Z. - Milan Janjic, Sep 19 2007
A134452(a(n)) = 0; A134451(a(n)) = 2 for n > 0. - Reinhard Zumkeller, Oct 27 2007
Omitting the initial zero gives the number of prime divisors with multiplicity of product of terms of n-th row of A077553. - Ray Chandler, Aug 21 2003
A059841(a(n))=1, A000035(a(n))=0. - Reinhard Zumkeller, Sep 29 2008
(APSO) Alternating partial sums of (a-b+c-d+e-f+g...) = (a+b+c+d+e+f+g...) - 2*(b+d+f...), it appears that APSO(A005843) = A052928 = A002378 - 2*(A116471), with A116471=2*A008794. - Eric Desbiaux, Oct 28 2008
A056753(a(n)) = 1. - Reinhard Zumkeller, Aug 23 2009
Twice the nonnegative numbers. - Juri-Stepan Gerasimov, Dec 12 2009
The number of hydrogen atoms in straight-chain (C(n)H(2n+2)), branched (C(n)H(2n+2), n > 3), and cyclic, n-carbon alkanes (C(n)H(2n), n > 2). - Paul Muljadi, Feb 18 2010
For n >= 1; a(n) = the smallest numbers m with the number of steps n of iterations of {r - (smallest prime divisor of r)} needed to reach 0 starting at r = m. See A175126 and A175127. A175126(a(n)) = A175126(A175127(n)) = n. Example (a(4)=8): 8-2=6, 6-2=4, 4-2=2, 2-2=0; iterations has 4 steps and number 8 is the smallest number with such result. - Jaroslav Krizek, Feb 15 2010
For n >= 1, a(n) = numbers k such that arithmetic mean of the first k positive integers is not integer. A040001(a(n)) > 1. See A145051 and A040001. - Jaroslav Krizek, May 28 2010
Union of A179082 and A179083. - Reinhard Zumkeller, Jun 28 2010
a(k) is the (Moore lower bound on and the) order of the (k,4)-cage: the smallest k-regular graph having girth four: the complete bipartite graph with k vertices in each part. - Jason Kimberley, Oct 30 2011
For n > 0: A048272(a(n)) <= 0. - Reinhard Zumkeller, Jan 21 2012
Let n be the number of pancakes that have to be divided equally between n+1 children. a(n) is the minimal number of radial cuts needed to accomplish the task. - Ivan N. Ianakiev, Sep 18 2013
For n > 0, a(n) is the largest number k such that (k!-n)/(k-n) is an integer. - Derek Orr, Jul 02 2014
a(n) when n > 2 is also the number of permutations simultaneously avoiding 213, 231 and 321 in the classical sense which can be realized as labels on an increasing strict binary tree with 2n-1 nodes. See A245904 for more information on increasing strict binary trees. - Manda Riehl Aug 07 2014
It appears that for n > 2, a(n) = A020482(n) + A002373(n), where all sequences are infinite. This is consistent with Goldbach's conjecture, which states that every even number > 2 can be expressed as the sum of two prime numbers. - Bob Selcoe, Mar 08 2015
Number of partitions of 4n into exactly 2 parts. - Colin Barker, Mar 23 2015
Number of neighbors in von Neumann neighborhood. - Dmitry Zaitsev, Nov 30 2015
Unique solution b( ) of the complementary equation a(n) = a(n-1)^2 - a(n-2)*b(n-1), where a(0) = 1, a(1) = 3, and a( ) and b( ) are increasing complementary sequences. - Clark Kimberling, Nov 21 2017
Also the maximum number of non-attacking bishops on an (n+1) X (n+1) board (n>0). (Cf. A000027 for rooks and queens (n>3), A008794 for kings or A030978 for knights.) - Martin Renner, Jan 26 2020
Integer k is even positive iff phi(2k) > phi(k), where phi is Euler's totient (A000010) [see reference De Koninck & Mercier]. - Bernard Schott, Dec 10 2020
Number of 3-permutations of n elements avoiding the patterns 132, 213, 312 and also number of 3-permutations avoiding the patterns 213, 231, 321. See Bonichon and Sun. - Michel Marcus, Aug 20 2022
a(n) gives the y-value of the integral solution (x,y) of the Pellian equation x^2 - (n^2 + 1)*y^2 = 1. The x-value is given by 2*n^2 + 1 (see Tattersall). - Stefano Spezia, Jul 24 2025

Examples

			G.f. = 2*x + 4*x^2 + 6*x^3 + 8*x^4 + 10*x^5 + 12*x^6 + 14*x^7 + 16*x^8 + ...
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 2.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 28.
  • J.-M. De Koninck and A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 529a pp. 71 and 257, Ellipses, 2004, Paris.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 256.

Crossrefs

a(n)=2*A001477(n). - Juri-Stepan Gerasimov, Dec 12 2009
Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), A027383 (k=3), A062318 (k=4), A061547 (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), this sequence (g=4), A002522 (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 30 2011
Cf. A231200 (boustrophedon transform).

Programs

Formula

G.f.: 2*x/(1-x)^2.
E.g.f.: 2*x*exp(x). - Geoffrey Critzer, Aug 25 2012
G.f. with interpolated zeros: 2x^2/((1-x)^2 * (1+x)^2); e.g.f. with interpolated zeros: x*sinh(x). - Geoffrey Critzer, Aug 25 2012
Inverse binomial transform of A036289, n*2^n. - Joshua Zucker, Jan 13 2006
a(0) = 0, a(1) = 2, a(n) = 2a(n-1) - a(n-2). - Jaume Oliver Lafont, May 07 2008
a(n) = Sum_{k=1..n} floor(6n/4^k + 1/2). - Vladimir Shevelev, Jun 04 2009
a(n) = A034856(n+1) - A000124(n) = A000217(n) + A005408(n) - A000124(n) = A005408(n) - 1. - Jaroslav Krizek, Sep 05 2009
a(n) = Sum_{k>=0} A030308(n,k)*A000079(k+1). - Philippe Deléham, Oct 17 2011
Digit sequence 22 read in base n-1. - Jason Kimberley, Oct 30 2011
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Vincenzo Librandi, Dec 23 2011
a(n) = 2*n = Product_{k=1..2*n-1} 2*sin(Pi*k/(2*n)), n >= 0 (undefined product := 1). See an Oct 09 2013 formula contribution in A000027 with a reference. - Wolfdieter Lang, Oct 10 2013
From Ilya Gutkovskiy, Aug 19 2016: (Start)
Convolution of A007395 and A057427.
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2)/2 = (1/2)*A002162 = (1/10)*A016655. (End)
From Bernard Schott, Dec 10 2020: (Start)
Sum_{n>=1} 1/a(n)^2 = Pi^2/24 = A222171.
Sum_{n>=1} (-1)^(n+1)/a(n)^2 = Pi^2/48 = A245058. (End)

A002375 From Goldbach conjecture: number of decompositions of 2n into an unordered sum of two odd primes.

Original entry on oeis.org

0, 0, 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

A weaker form of this conjecture, the ternary form, was proved by Helfgott (see link below). - T. D. Noe, May 14 2013
The Goldbach conjecture is that for n >= 3, this sequence is always positive.
This has been checked up to at least 10^18 (see A002372).
With the exception of the n=2 term, identical to A045917.
The conjecture has been verified up to 3 * 10^17 (see MathWorld link). - Dmitry Kamenetsky, Oct 17 2008
Languasco and Zaccagnini proved that, where Lambda is the von Mangoldt function, and R(n) = Sum_{i + j = n} Lambda(i)*Lambda(j) is the counting function for the Goldbach numbers, and for N >= 2 and assume the Riemann hypothesis (RH) holds, then Sum_{n = 1..N} R(n) = (N^2)/2 - 2*Sum_{rho} ((N^(rho+1))/(rho*(rho+1))) + O(N * log^3 N).
If 2n is the sum of two distinct primes, then neither prime divides 2n. - Christopher Heiling, Feb 28 2017

Examples

			2 and 4 are not the sum of 2 odd primes, so a(1) = a(2) = 0; 6 = 3 + 3 (one way, so a(3) = 1); 8 = 3 + 5 (so a(4) = 1); 10 = 3 + 7 = 5 + 5 (so a(5) = 2); etc.
		

References

  • Calvin C. Clawson, "Mathematical Mysteries, the beauty and magic of numbers," Perseus Books, Cambridge, MA, 1996, Chapter 12, Pages 236-257.
  • Apostolos K. Doxiadis, Uncle Petros and Goldbach's Conjecture, Bloomsbury Pub. PLC USA, 2000.
  • D. A. Grave, Traktat z Algebrichnogo Analizu (Monograph on Algebraic Analysis). Vol. 2, p. 19. Vidavnitstvo Akademiia Nauk, Kiev, 1938.
  • H. Halberstam and H. E. Richert, 1974, "Sieve methods", Academic press, London, New York, San Francisco.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 80.
  • N. V. Maslova, On the coincidence of Grünberg-Kegel graphs of a finite simple group and its proper subgroup, Proceedings of the Steklov Institute of Mathematics April 2015, Volume 288, Supplement 1, pp 129-141; Original Russian Text: Trudy Instituta Matematiki i Mekhaniki UrO RAN, 2014, Vol. 20, No. 1.
  • 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

See also A061358. Cf. A002372 (ordered sums), A002373, A002374, A045917.
A023036 is (essentially) the first appearance of n and A000954 is the last (assumed) appearance of n.
Cf. A065091, A010051, A001031 (a weaker form of the conjecture).

Programs

  • Haskell
    a002375 n = sum $ map (a010051 . (2 * n -)) $ takeWhile (<= n) a065091_list
    -- Reinhard Zumkeller, Sep 02 2013
    
  • Magma
    A002375 := func; [A002375(n):n in[1..98]];
    
  • Maple
    A002375 := proc(n) local s, p; s := 0; p := 3; while p<2*n do s := s+x^p; p := nextprime(p) od; (coeff(s^2, x, 2*n)+coeff(s,x,n))/2 end; [seq(A002375(n), n=1..100)];
    a:=proc(n) local c,k; c:=0: for k from 1 to floor((n-1)/2) do if isprime(2*k+1)=true and isprime(2*n-2*k-1)=true then c:=c+1 else c:=c fi od end: A:=[0,0,seq(a(n),n=3..98)]; # Emeric Deutsch, Aug 27 2007
    g:=sum(sum(x^(ithprime(i)+ithprime(j)),i=2..j),j=2..50): seq(coeff(g,x,2*n), n =1..98); # Emeric Deutsch, Aug 27 2007
  • Mathematica
    f[n_] := Length[ Select[2n - Prime[ Range[2, PrimePi[n]]], PrimeQ]]; Table[ f[n], {n, 100}] (* Paul Abbott, Jan 11 2005 *)
    nn = 10^2; ps = Boole[PrimeQ[Range[1,2*nn,2]]]; Table[Sum[ps[[i]] ps[[n-i+1]], {i, Ceiling[n/2]}], {n, nn}] (* T. D. Noe, Apr 13 2011 *)
    Table[Count[IntegerPartitions[2n,{2}],?(AllTrue[#,PrimeQ]&&FreeQ[#,2]&)],{n,100}] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale, Mar 01 2018 *)
    j[n_] := If[PrimeQ[2 n - 1], 2 n - 1, 0]; A085090 = Array[j, 98];
    r[n_] := Table[A085090[[k]] + A085090[[n - k + 1]], {k, 1, n}];
    countzeros[l_List] := Sum[KroneckerDelta[0, k], {k, l}];
    Table[((x = n - 2 countzeros[A085090[[1 ;; n]]] + countzeros[r[n]]) +
    KroneckerDelta[OddQ[x], True])/2, {n, 1, 98}] (* Fred Daniel Kline, Aug 30 2018 *)
  • MuPAD
    A002375 := proc(n) local s,p; begin s := 0; p := 3; repeat if isprime(2*n-p) then s := s+1 end_if; p := nextprime(p+2); until p>n end_repeat; s end_proc:
    
  • PARI
    A002375(n)=sum(i=2,primepi(n),isprime(2*n-prime(i))) /* ...i=1... gives A045917 */
    
  • PARI
    apply( {A002375(n,s=0,N=2*n)=forprime(p=n, N-3, isprime(N-p)&&s++);s}, [1..100]) \\ M. F. Hasler, Jan 03 2023
    
  • Python
    from sympy import primerange, isprime
    def A002375(n): return sum(1 for p in primerange(3,n+1) if isprime((n<<1)-p)) # Chai Wah Wu, Feb 20 2025
  • Sage
    def A002375(n):
        P = primes(3, n+1)
        M = (2*n - p for p in P)
        F = [k for k in M if is_prime(k)]
        return len(F)
    [A002375(n) for n in (1..98)] # Peter Luschny, May 19 2013
    

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. Is a(n) > n/log(n)^2 for n large enough? - Benoit Cloitre, May 20 2002
a(n) = ceiling(A002372(n)/2). - Emeric Deutsch, Jul 14 2004
G.f.: Sum_{j>=2} Sum_{i=2..j} x^(p(i) + p(j)), where p(k) is the k-th prime. - Emeric Deutsch, Aug 27 2007
Not very efficient: a(n) = (Sum_{i=1..n} (pi(i) - pi(i-1)) * (pi(2n-i) - pi(2n-i-1))) - floor(2/n)*floor(n/2). - Wesley Ivan Hurt, Jan 06 2013
For n >= 2, a(n) = Sum_{3 <= p <= n, p is prime} A(2*n - p) - binomial(A(n), 2) - a(n-1) - a(n-2) - ... - a(1), where A(n) = A033270(n) (see Example 1 in link of V. Shevelev). - Vladimir Shevelev, Jul 08 2013

Extensions

Beginning corrected by Paul Zimmermann, Mar 15 1996
More terms from James Sellers
Edited by Charles R Greathouse IV, Apr 20 2010

A002372 Goldbach conjecture: number of decompositions of 2n into ordered sums of two odd primes.

Original entry on oeis.org

0, 0, 1, 2, 3, 2, 3, 4, 4, 4, 5, 6, 5, 4, 6, 4, 7, 8, 3, 6, 8, 6, 7, 10, 8, 6, 10, 6, 7, 12, 5, 10, 12, 4, 10, 12, 9, 10, 14, 8, 9, 16, 9, 8, 18, 8, 9, 14, 6, 12, 16, 10, 11, 16, 12, 14, 20, 12, 11, 24, 7, 10, 20, 6, 14, 18, 11, 10, 16, 14, 15, 22, 11, 10, 24, 8, 16, 22, 9, 16, 20, 10
Offset: 1

Views

Author

Keywords

Comments

The weak form of this conjecture was proved by Helfgott (see link below). - T. D. Noe, May 14 2013
Goldbach conjectured in 1742 that for n >= 3, this sequence never vanishes. This is still unproved.
Number of different primes occurring when 2n is expressed as p1+q1 = ... = pk+qk where pk,qk are odd primes with pk <= qk. For example when n=5: 10 = 3+7 = 5+5, we can see 3 different primes so a(5) = 3. - Naohiro Nomoto, Feb 24 2002
Comments from Tomás Oliveira e Silva to Number Theory List, Feb 05 2005: With the help of Siegfied "Zig" Herzog of PSU, I was able to verify the Goldbach conjecture up to 2e17. Let 2n=p+q, with p and q prime be a Goldbach partition of 2n. In a minimal Goldbach partition p is as small as possible. The largest p of a minimal Goldbach partition found was 8443 and is needed for 2n=121005022304007026. Furthermore, the largest prime gap found was 1220-1; it occurs after the prime 80873624627234849.
Comments from Tomás Oliveira e Silva to Number Theory List, Apr 26 2007: With the help of Siegfried "Zig" Herzog, the NCSA and others, I have just finished the verification of the Goldbach conjecture up to 1e18. This took about 320 years of CPU time, including a double-check of the results up to 1e17. As expected, no counterexample to the conjecture was found. As side results, the number of twin primes up to 1e18 was also computed, as was the number of primes in each of the residue classes modulo 120. Also, the number of occurrences of each (observed) prime gap was also recorded.
For n > 2 we have a(n) = 2*A002375(n)-1 if n is prime and a(n) = 2*A002375(n) if n is composite. - Emeric Deutsch, Jul 14 2004
For n > 2, a(n) = 2*A002375(n) - A010051(n). - Jason Kimberley, Aug 31 2011
a(n) = Sum_{p odd prime < 2*n} A010051(2*n - p). - Reinhard Zumkeller, Oct 19 2011
There is an interesting similarity with square numbers: The number of divisors of n is odd iff n is square (A000290). The number of decompositions of 2n into ordered sums of two primes (equaling the number of the unique primes in all such decompositions) is odd iff n is prime. - Ivan N. Ianakiev, Feb 28 2015

Examples

			2 has no such decompositions, so a(1) = 0.
Idem for 4, whence a(2) = 0.
6 = 3+3, so a(3) = 1.
8 = 3+5 = 5+3, so a(4) = 2.
10 = 5+5 = 3+7 = 7+3, so a(5) = 3.
12 = 5+7 = 7+5; so a(6) = 2, etc.
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 9.
  • R. K. Guy, Unsolved problems in number theory, second edition, Springer-Verlag, 1994.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Section 2.8 (for Goldbach conjecture).
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 79, 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).
  • 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

Essentially identical to A035026.

Programs

  • Haskell
    a002372 n = sum $ map (a010051 . (2*n -)) $ takeWhile (< 2*n) a065091_list
    -- Reinhard Zumkeller, Oct 19 2011
    
  • Magma
    A002372 := func; [A002372(n):n in[1..82]]; // Jason Kimberley, Sep 01 2011
    
  • Maple
    a:=proc(n) local c,k; c:=0: for k from 1 to n do if isprime(2*k+1)=true and isprime(2*n-2*k-1)=true then c:=c+1 else c:=c fi od end: seq(a(n),n=1..82); # Emeric Deutsch, Jul 14 2004
  • Mathematica
    For[lst={}; n=1, n<=100, n++, For[cnt=0; i=1, i<=2n-1, i++ If[OddQ[i]&&PrimeQ[i]&&PrimeQ[2n-i], cnt++ ]]; AppendTo[lst, cnt]]; lst
    (* second program: *)
    A002372[n_] := Module[{i = 0}, Do[If[PrimeQ[2 n - Prime@p], i++], {p, 2, PrimePi[2 n - 3]}]; i]; Array[A002372, 82] (* JungHwan Min, Aug 24 2016 *)
    i[n_] := If[PrimeQ[2 n - 1], 2 n - 1, 0]; A085090 = Array[i, 82];
    r[n_] := Table[A085090[[k]] + A085090[[n - k + 1]], {k, 1, n}];
    countzeros[l_List] := Sum[KroneckerDelta[0, k], {k, l}];
    Table[n - 2 countzeros[A085090[[1 ;; n]]] + countzeros[r[n]],
    {n, 1, 82}] (* Fred Daniel Kline, Aug 13 2018 *)
    countPrimes[n_] := Sum[KroneckerDelta[True, PrimeQ[2 m - 1],
    PrimeQ[2 (n - m + 1) - 1]], {m, 1, n}]; Array[countPrimes, 82] (* Fred Daniel Kline, Oct 07 2018 *)
  • PARI
    isop(n) = (n % 2) && isprime(n);
    a(n) = n*=2; sum(i=1, n-1, isop(i)*isop(n-i)); \\ Michel Marcus, Aug 22 2014 and May 28 2020
    
  • Python
    from sympy import isprime, primerange
    def a(n): return sum([1 for p in primerange(3, 2*n-2) if isprime(2*n-p)])
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Apr 23 2017

Formula

a(n) = A010051(n) + 2*A061357(n), n > 2. - R. J. Mathar, Aug 19 2013

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jun 13 2002
Edited by M. F. Hasler, May 03 2019

A014092 Numbers that are not the sum of 2 primes.

Original entry on oeis.org

1, 2, 3, 11, 17, 23, 27, 29, 35, 37, 41, 47, 51, 53, 57, 59, 65, 67, 71, 77, 79, 83, 87, 89, 93, 95, 97, 101, 107, 113, 117, 119, 121, 123, 125, 127, 131, 135, 137, 143, 145, 147, 149, 155, 157, 161, 163, 167, 171, 173, 177, 179, 185, 187, 189, 191, 197, 203, 205, 207, 209
Offset: 1

Views

Author

Keywords

Comments

Suggested by the Goldbach conjecture that every even number larger than 2 is the sum of 2 primes.
Since (if we believe the Goldbach conjecture) all the entries > 2 in this sequence are odd, they are equal to 2 + an odd composite number (or 1).
Otherwise said, the sequence consists of 2 and odd numbers k such that k-2 is not prime. In particular there is no element from A006512, greater of a twin prime pair. - M. F. Hasler, Sep 18 2012
Values of k such that A061358(k) = 0. - Emeric Deutsch, Apr 03 2006
Values of k such that A073610(k) = 0. - Graeme McRae, Jul 18 2006

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Section 2.8 (for Goldbach conjecture).

Crossrefs

Cf. A010051, A000040, A051035 (composites).
Equivalent sequence for prime powers: A071331.
Numbers that can be expressed as the sum of two primes in k ways for k=0..10: this sequence (k=0), A067187 (k=1), A067188 (k=2), A067189 (k=3), A067190 (k=4), A067191 (k=5), A066722 (k=6), A352229 (k=7), A352230 (k=8), A352231 (k=9), A352233 (k=10).

Programs

  • Haskell
    a014092 n = a014092_list !! (n-1)
    a014092_list = filter (\x ->
       all ((== 0) . a010051) $ map (x -) $ takeWhile (< x) a000040_list) [1..]
    -- Reinhard Zumkeller, Sep 28 2011
    
  • Maple
    g:=sum(sum(x^(ithprime(i)+ithprime(j)),i=1..j),j=1..50): gser:=series(g,x=0,230): a:=proc(n) if coeff(gser,x^n)=0 then n else fi end: seq(a(n),n=1..225); # Emeric Deutsch, Apr 03 2006
  • Mathematica
    s1falsifiziertQ[s_]:= Module[{ip=IntegerPartitions[s, {2}], widerlegt=False},Do[If[PrimeQ[ip[[i,1]] ] ~And~ PrimeQ[ip[[i,2]] ], widerlegt = True; Break[]],{i,1,Length[ip]}];widerlegt]; Select[Range[250],s1falsifiziertQ[ # ]==False&] (* Michael Taktikos, Dec 30 2007 *)
    Join[{1,2},Select[Range[3,300,2],!PrimeQ[#-2]&]] (* Zak Seidov, Nov 27 2010 *)
    Select[Range[250],Count[IntegerPartitions[#,{2}],?(AllTrue[#,PrimeQ]&)]==0&] (* _Harvey P. Dale, Jun 08 2022 *)
  • PARI
    isA014092(n)=local(p,i) ; i=1 ; p=prime(i); while(pA014092(a), print(n," ",a); n++)) \\ R. J. Mathar, Aug 20 2006
    
  • Python
    from sympy import prime, isprime
    def ok(n):
        i=1
        x=prime(i)
        while xIndranil Ghosh, Apr 29 2017

Formula

Odd composite numbers + 2 (essentially A014076(n) + 2 ).
Equals {2} union A005408 \ A052147, i.e., essentially the complement of A052147 (or rather A048974) within the odd numbers A005408. - M. F. Hasler, Sep 18 2012

A020481 Least p with p, q both prime, p+q = 2n.

Original entry on oeis.org

2, 3, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 5, 7, 3, 3, 5, 7, 3, 5, 3, 3, 5, 3, 5, 7, 3, 5, 7, 3, 3, 5, 7, 3, 5, 3, 3, 5, 7, 3, 5, 3, 5, 7, 3, 5, 7, 19, 3, 5, 3, 3, 5, 3, 3, 5, 3, 5, 7, 13, 11, 13, 19, 3, 5, 3, 5, 7, 3, 3, 5, 7, 11, 11, 3, 3, 5, 7, 3, 5, 7, 3, 5, 3, 5, 7, 3, 5, 7, 3, 3, 5, 7, 11, 11, 3, 3, 5, 3, 3, 5, 7
Offset: 2

Views

Author

Keywords

Comments

Essentially the same as A002373, which does not have the a(2) term. - T. D. Noe, Sep 24 2007
a(n) = A171637(n,1). - Reinhard Zumkeller, Mar 03 2014
Conjecture: a(n) ~ O(n^1/2). - Jon Perry, Apr 29 2014

Crossrefs

Cf. A020482.

Programs

  • Haskell
    a020481 n = head [p | p <- a000040_list, a010051' (2 * n - p) == 1]
    -- Reinhard Zumkeller, Jul 07 2014, Mar 03 2014
    
  • Mathematica
    a[n_] := For[p = 2, True, p = NextPrime[p], If[PrimeQ[2n-p], Return[p]]];
    Table[a[n], {n, 2, 103}] (* Jean-François Alcover, Jul 31 2018  *)
  • PARI
    A020481(n) = {local(np);np=1;while(!isprime(2*n-prime(np)),np++);prime(np)} \\ Michael B. Porter, Dec 11 2009
    
  • PARI
    A020481(n)=forprime(p=1,n,isprime(2*n-p)&return(p)) \\ M. F. Hasler, Sep 18 2012
    
  • Python
    from sympy import isprime, primerange
    def A020481(n): return next(filter(lambda p:isprime((n<<1)-p),primerange(2*n))) # Chai Wah Wu, Nov 19 2024

Formula

a(n) = n - A047949(n). - Jason Kimberley, Oct 09 2012

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

A047160 For n >= 2, a(n) = smallest number m >= 0 such that n-m and n+m are both primes, or -1 if no such m exists.

Original entry on oeis.org

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, 5, 12, 3, 14, 9, 0, 7, 12, 9, 4, 15, 6, 7, 0, 9, 2, 3
Offset: 2

Views

Author

Keywords

Comments

I have confirmed there are no -1 entries through integers to 4.29*10^9 using PARI. - Bill McEachen, Jul 07 2008
From Daniel Forgues, Jul 02 2009: (Start)
Goldbach's Conjecture: for all n >= 2, there are primes (distinct or not) p and q s.t. p+q = 2n. The primes p and q must be equidistant (distance m >= 0) from n: p = n-m and q = n+m, hence p+q = (n-m)+(n+m) = 2n.
Equivalent to Goldbach's Conjecture: for all n >= 2, there are primes p and q equidistant (distance >= 0) from n, where p and q are n when n is prime.
If this conjecture is true, then a(n) will never be set to -1.
Twin Primes Conjecture: there is an infinity of twin primes.
If this conjecture is true, then a(n) will be 1 infinitely often (for which each twin primes pair is (n-1, n+1)).
Since there is an infinity of primes, a(n) = 0 infinitely often (for which n is prime).
(End)
If n is composite, then n and a(n) are coprime, because otherwise n + a(n) would be composite. - Jason Kimberley, Sep 03 2011
From Jianglin Luo, Sep 22 2023: (Start)
a(n) < primepi(n)+sigma(n,0);
a(n) < primepi(primepi(n)+n);
a(n) < primepi(n), for n>344;
a(n) = o(primepi(n)), as n->+oo. (End)
If -1 < a(n) < n-3, then a(n) is divisible by 3 if and only if n is not divisible by 3, and odd if and only if n is even. - Robert Israel, Oct 05 2023

Examples

			16-3=13 and 16+3=19 are primes, so a(16)=3.
		

Crossrefs

Programs

  • Haskell
    a047160 n = if null ms then -1 else head ms
                where ms = [m | m <- [0 .. n - 1],
                                a010051' (n - m) == 1, a010051' (n + m) == 1]
    -- Reinhard Zumkeller, Aug 10 2014
    
  • Magma
    A047160:=func;[A047160(n):n in[2..100]]; // Jason Kimberley, Sep 02 2011
    
  • Mathematica
    Table[k = 0; While[k < n && (! PrimeQ[n - k] || ! PrimeQ[n + k]), k++]; If[k == n, -1, k], {n, 2, 100}]
    smm[n_]:=Module[{m=0},While[AnyTrue[n+{m,-m},CompositeQ],m++];m]; Array[smm,100,2] (* Harvey P. Dale, Nov 16 2024 *)
  • PARI
    a(n)=forprime(p=n,2*n, if(isprime(2*n-p), return(p-n))); -1 \\ Charles R Greathouse IV, Jun 23 2017
  • UBASIC
    10 N=2// 20 M=0// 30 if and{prmdiv(N-M)=N-M,prmdiv(N+M)=N+M} then print M;:goto 50// 40 inc M:goto 30// 50 inc N: if N>130 then stop// 60 goto 20
    

Formula

a(n) = n - A112823(n).
a(n) = A082467(n) * A005171(n), for n > 3. - Jason Kimberley, Jun 25 2012

Extensions

More terms from Patrick De Geest, May 15 1999
Deleted a comment. - T. D. Noe, Jan 22 2009
Comment corrected and definition edited by Daniel Forgues, Jul 08 2009

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

A138479 a(n) = smallest prime p such that 2*n + p^2 is another prime, or 0 if no such prime exists.

Original entry on oeis.org

3, 3, 5, 3, 3, 5, 3, 5, 5, 3, 3, 7, 0, 3, 7, 3, 3, 5, 3, 7, 5, 3, 5, 5, 3, 3, 5, 0, 3, 7, 3, 3, 29, 0, 3, 5, 3, 5, 5, 3, 5, 5, 0, 3, 7, 3, 3, 19, 3, 3, 5, 3, 5, 7, 0, 5, 5, 0, 3, 11, 3, 5, 5, 3, 3, 5, 0, 11, 5, 3, 3, 7, 0, 3, 7, 0, 3, 5, 3, 11, 7, 3, 5, 5, 3, 3, 5, 0, 7, 7, 3, 3, 5, 3, 3, 7, 0, 11, 5, 0
Offset: 1

Views

Author

Philippe LALLOUET (philip.lallouet(AT)orange.fr), Mar 20 2008

Keywords

Comments

For numbers k such that a(k) = 0 see A138685.

Examples

			11=2+3^2 hence a(1)=3,
13=4+3^2 hence a(2)=3,
31=6+5^2 hence a(3)=5.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local p;
          if irem(n, 3)=1 and not isprime(2*n+9) then 0
        else p:=2;
             do p:= nextprime(p);
                if isprime(2*n+p^2) then return p fi
             od
          fi
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jun 16 2014
  • Mathematica
    a = {}; Do[ p = 0; While[ (! PrimeQ[ 2*n + Prime[ p + 1 ]2 ]) && (p < 1000), p++ ]; If[ p < 1000, AppendTo[ a, Prime[ p + 1 ] ], AppendTo[ a, 0 ] ], {n, 1, 150} ]; a (* Artur Jasinski, Mar 26 2008 *)
    a[n_]:=If[Mod[n,3]!=1,(For[m=1,!PrimeQ[2n+Prime[m]^2],m++ ]; Prime[m]),If[ !PrimeQ[2n+9],0,3]];Table[a[n],{n,100}] (* Farideh Firoozbakht, Mar 28 2008 *)

Extensions

More terms from Artur Jasinski and Farideh Firoozbakht, Mar 26 2008

A244408 Even numbers 2k such that the smallest prime p satisfying p+q=2k (q prime) is greater than or equal to sqrt(2k).

Original entry on oeis.org

4, 6, 8, 12, 18, 24, 30, 38, 98, 122, 126, 128, 220, 302, 308, 332, 346, 488, 556, 854, 908, 962, 992, 1144, 1150, 1274, 1354, 1360, 1362, 1382, 1408, 1424, 1532, 1768, 1856, 1928, 2078, 2188, 2200, 2438, 2512, 2530, 2618, 2642, 3458, 3818, 3848
Offset: 1

Views

Author

Jon Perry, Jun 27 2014

Keywords

Comments

a(74) = 63274 is probably the last term. Oliveira e Silva's work shows there are no more terms below 4*10^18. The largest p below that is p = 9781 for 2k = 3325581707333960528, where sqrt(2k) = 1823617752. - Jens Kruse Andersen, Jul 03 2014
The sequence definition is equivalent to: "Even integers k such that there exists a prime p with p = min{q: q prime and (k-q) prime} and k <= p^2" and therefore this is a member of the EGN-family (Cf. A307782). - Corinna Regina Böger, May 01 2019

Examples

			The smallest prime for 38 is 7, and 7 >= sqrt(38).
		

Crossrefs

Programs

  • Haskell
    a244408 n = a244408_list !! (n-1)
    a244408_list = map (* 2) $ filter f [2..] where
       f x = sqrt (fromIntegral $ 2 * x) <= fromIntegral (a020481 x)
    -- Reinhard Zumkeller, Jul 07 2014
  • PARI
    for(n=1, 50000, forprime(p=2, n, if(isprime(2*n-p), if(p>=sqrt(2*n), print1(2*n", ")); break))) \\ Jens Kruse Andersen, Jul 03 2014
    
Showing 1-10 of 31 results. Next