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

A198292 Irregular triangle with row n being A045917(n) copies of n.

Original entry on oeis.org

2, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28
Offset: 2

Views

Author

Jason Kimberley, Oct 03 2012

Keywords

Examples

			Triangle begins:
2;
3;
4;
5, 5;
6;
7, 7;
8, 8;
9, 9;
10, 10;
11, 11, 11;
		

Crossrefs

This triangle has the same dimensions as both A182138 and A184995.

Programs

A045919 Partial sum of Goldbach numbers A045917.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 8, 10, 12, 14, 17, 20, 23, 25, 28, 30, 34, 38, 40, 43, 47, 50, 54, 59, 63, 66, 71, 74, 78, 84, 87, 92, 98, 100, 105, 111, 116, 121, 128, 132, 137, 145, 150, 154, 163, 167, 172
Offset: 1

Views

Author

Keywords

Comments

If the Goldbach conjecture is false then a(n)=a(n+1) for some n.

References

  • C. Clawson, Mathematical mysteries, Plenum Press 1996, p. 241.

Crossrefs

Programs

  • Mathematica
    Table[Sum[Sum[(PrimePi[2 k - i] - PrimePi[2 k - i - 1]) (PrimePi[i] - PrimePi[i - 1]), {i, k}], {k, n}], {n, 100}] (* Wesley Ivan Hurt, Apr 07 2018 *)

Formula

a(n) = Sum_{k=1..n} Sum_{i=1..k} A010051(i) * A010051(2k-i). - Wesley Ivan Hurt, Apr 07 2018

A254713 All numbers k such that the number of distinct parts of all A045917(k) Goldbach partitions of 2k is prime.

Original entry on oeis.org

4, 5, 6, 7, 11, 13, 17, 19, 23, 29, 31, 53, 59, 61, 67, 73, 83, 89, 97, 101, 103, 109, 113, 127, 131, 139, 151, 157, 163, 173, 179, 191, 193, 199, 223, 227, 229, 251, 263, 271, 307, 313, 337, 347, 353, 359, 367, 379, 389, 401, 449, 479, 521, 523, 577, 587, 599, 601, 607, 613, 631, 643
Offset: 1

Views

Author

Ivan N. Ianakiev, Feb 06 2015

Keywords

Comments

Conjecture: a(k) is prime for k > 3. Tested for k up to 3*10^4.

Examples

			For k = 4, 2k = 8. The number of the distinct Goldbach parts of 8 (3 and 5) is prime, therefore 4 is in the sequence.
5 is in the sequence because the 2 = A045917(5) Goldbach partitions of 10 are 5 + 5 and 3 + 7, and there are 3 distinct parts, namely 3, 5 and 7. - _Wolfdieter Lang_, Feb 23 2015
		

Crossrefs

Programs

  • Mathematica
    lstIn={};lstFin={};
    goldPart[x_]:=Module[{h=x/2},While[h>1,If[And[PrimeQ[h],PrimeQ[x-h]],AppendTo[lstIn,{h,x-h}]];h--];
    lstFin=Length[Union[Flatten[lstIn]]];lstIn={};lstFin];
    a254713=Flatten[Position[PrimeQ[goldPart/@Range[2,2002,2]],True]]

Extensions

Edited. Wolfdieter Lang, Feb 23 2015

A343185 Numbers k such that 2*k is a multiple of A045917(k).

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 19, 30, 33, 34, 35, 36, 40, 44, 45, 46, 56, 60, 70, 76, 80, 92, 100, 112, 114, 128, 130, 140, 145, 148, 182, 184, 209, 210, 221, 228, 238, 247, 270, 276, 286, 297, 324, 344, 372, 399, 408, 410, 425, 429, 437, 444, 460, 468, 475, 504, 506, 507, 510
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Apr 18 2021

Keywords

Examples

			a(4) = 5 is a term because 2*5 = 10 is a multiple of A045917(5) = 2.
		

Crossrefs

Cf. A045917.

Programs

  • Maple
    P:= select(isprime, [2,seq(i,i=3..2000,2)]):
    filter:= proc(n) local k1, k2;
       k1:= ListTools:-BinaryPlace(P,n+1);
       k2:= ListTools:-BinaryPlace(P,2*n+1);
       2*n mod nops(convert(P[1..k1],set) intersect map(t -> 2*n-t, convert(P[k1..k2],set))) = 0
    end proc:
    select(filter, [$2..1000]);

A350455 T(n,k) is the k-th semiprime whose sum of prime factors equals 2n, triangle T(n,k), n>=2, 1<=k<=A045917(n), read by rows.

Original entry on oeis.org

4, 9, 15, 21, 25, 35, 33, 49, 39, 55, 65, 77, 51, 91, 57, 85, 121, 95, 119, 143, 69, 133, 169, 115, 187, 161, 209, 221, 87, 247, 93, 145, 253, 289, 155, 203, 299, 323, 217, 361, 111, 319, 391, 185, 341, 377, 437, 123, 259, 403, 129, 205, 493, 529, 215, 287, 407
Offset: 2

Views

Author

Alois P. Heinz, Dec 31 2021

Keywords

Comments

Assuming Goldbach's conjecture, no row is empty.

Examples

			Triangle T(n,k) begins:
    4;
    9;
   15;
   21,  25;
   35     ;
   33,  49;
   39,  55;
   65,  77;
   51,  91;
   57,  85, 121;
   95, 119, 143;
   69, 133, 169;
  115, 187     ;
  161, 209, 221;
   87, 247     ;
   93, 145, 253, 289;
  155, 203, 299, 323;
  ...
		

Crossrefs

Column k=1 gives A073046.
Last elements of rows give A102084.
Row sums give A228553.
Row products give A337568.
Row lengths give A045917.

Programs

  • Maple
    T:= n-> seq(`if`(andmap(isprime, [h, 2*n-h]), h*(2*n-h), [][]), h=2..n):
    seq(T(n), n=2..30);

A239282 a(n) = A045917(n)*prime(n).

Original entry on oeis.org

0, 3, 5, 7, 22, 13, 34, 38, 46, 58, 93, 111, 123, 86, 141, 106, 236, 244, 134, 213, 292, 237, 332, 445, 388, 303, 515, 321, 436, 678, 381, 655, 822, 278, 745, 906, 785, 815, 1169, 692, 895, 1448, 955, 772, 1773, 796, 1055, 1561, 681, 1374, 1864, 1195, 1446, 2008
Offset: 1

Views

Author

Raghavendra Ugare, Mar 14 2014

Keywords

Crossrefs

Programs

  • Mathematica
    (*Returns the various ways a number (presumed to be even) can be split as a sum of 2 Primes.*)
    getGoldBachSplits[n_Integer] := Module[{i, splits = {}, a, b},
      (
       For[i = 1,
        Prime[i] < n,
        i++,
        a = Prime[i] ;
        b = n - Prime[i];
        If[PrimeQ[b],
         If[MemberQ[splits, {b, a}], Null,
          AppendTo[splits, {a, b}]],
         Null];
        ]; (*End For-loop...*)
       splits
       )
      ]
    (* Now we generate our series...*)
    series[n_] :=
    Module[{}, (Table[Prime[i]*Length[getGoldBachSplits[2 i]], {i, 2, n}])]

A245629 Numbers n such that A000203(2*n) divides 2*n*A045917(n).

Original entry on oeis.org

1, 14, 42, 60, 336, 1638, 2160, 4064, 4130, 4464, 5148, 6678, 7900, 9856, 12192, 13144, 16464, 23220, 24206, 26001, 28665, 44460, 49680, 53464, 105656, 117800, 125685, 158160, 159489, 168597, 173060, 232128, 276080, 309504, 320580, 372384, 475488, 542430, 580072, 613500, 699112, 708900, 787644, 834561, 843200, 885456, 914872, 1215396
Offset: 1

Views

Author

Ivan N. Ianakiev, Jul 27 2014

Keywords

Comments

Conjecture: 14 is the only natural number n for which A000203(2*n) equals 2*n*A045917(n).
Conjecture above is confirmed for n < 10^5. - Derek Orr, Jul 27 2014

Examples

			A000203(2*14) = 56, which divides 2*14*A045917(14), which is also 56. So 14 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Length@ Select[ 2n - Prime@ Range@ PrimePi@ n, PrimeQ]; fQ[n_] := Mod[ 2n*f[n], DivisorSigma[1, 2n]] == 0; k = 1; lst = {}; While[k < 1250001, If[ fQ@ k, AppendTo[lst, k]; Print@ k]; k++]; lst (* Robert G. Wilson v, Aug 07 2014 *)
  • PARI
    for(n=1,10^7,my(s);forprime(p=2,n,s+=isprime(2*n-p));d=divisors(2*n);if(2*n*s%(sum(i=1,#d,d[i]))==0,print1(n,", "))) \\ Derek Orr, Jul 27 2014

Extensions

a(18)-a(24) from Derek Orr, Jul 27 2014
a(25)-a(48) from Robert G. Wilson v, Aug 07 2014

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

A061358 Number of ways of writing n = p+q with p, q primes and p >= q.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Apr 28 2001

Keywords

Comments

For an odd number n, a(n) = 0 if n-2 is not a prime, otherwise a(n) = 1.
For n > 1, a(2n) is at least 1, according to Goldbach's conjecture.
a(A014092(n)) = 0; a(A014091(n)) > 0; a(A067187(n)) = 1. - Reinhard Zumkeller, Nov 22 2004
Number of partitions of n into two primes.
Number of unordered ways of writing n as the sum of two primes.
a(2*n) = A068307(2*n+2). - Reinhard Zumkeller, Aug 08 2009
4*a(n) is the total number of divisors of all primes p and q such that n = p+q and p >= q. - Wesley Ivan Hurt, Mar 05 2016
Indices where a(n) = 0 correspond to A164376 UNION A025584. - Bill McEachen, Jan 31 2024

Examples

			a(22) = 3 because 22 can be written as 3+19, 5+17 and 11+11.
		

Crossrefs

Programs

  • Magma
    [#RestrictedPartitions(n,2,{p:p in PrimesUpTo(1000)}):n in [0..100] ] // Marius A. Burtea, Jan 19 2019
  • Maple
    g:=sum(sum(x^(ithprime(i)+ithprime(j)),i=1..j),j=1..30): gser:=series(g,x=0,110): seq(coeff(gser,x,n),n=0..105); # Emeric Deutsch, Apr 03 2006
  • Mathematica
    a[n_] := Length[Select[n - Prime[Range[PrimePi[n/2]]], PrimeQ]]; Table[a[n], {n, 0, 100}] (* Paul Abbott, Jan 11 2005 *)
    With[{nn=110},CoefficientList[Series[Sum[x^(Prime[i]+Prime[j]),{j,nn},{i,j}],{x,0,nn}],x]] (* Harvey P. Dale, Aug 17 2017 *)
    Table[Count[IntegerPartitions[n,{2}],?(AllTrue[#,PrimeQ]&)],{n,0,110}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale, Jul 03 2021 *)
  • PARI
    a(n)=my(s);forprime(q=2,n\2,s+=isprime(n-q));s \\ Charles R Greathouse IV, Mar 21 2013
    
  • Python
    from sympy import primerange, isprime, floor
    def a(n):
        s=0
        for q in primerange(2, n//2 + 1): s+=isprime(n - q)
        return s
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 30 2017
    

Formula

G.f.: Sum_{j>0} Sum_{i=1..j} x^(p(i)+p(j)), where p(k) is the k-th prime. - Emeric Deutsch, Apr 03 2006
A065577(n) = a(10^n).
From Wesley Ivan Hurt, Jan 04 2013: (Start)
a(n) = Sum_{i=1..floor(n/2)} A010051(i) * A010051(n-i).
a(n) = Sum_{i=1..floor(n/2)} floor((A010051(i) + A010051(n-i))/2). (End)
a(n) + A062610(n) + A062602(n) = A004526(n). - R. J. Mathar, Sep 10 2021
a(n) = Sum_{k=floor((n-1)^2/4)+1..floor(n^2/4)} c(A339399(2k-1)) * c(A339399(2k)), where c = A010051. - Wesley Ivan Hurt, Jan 19 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001
Comments edited by Zak Seidov, May 28 2014

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
Showing 1-10 of 109 results. Next