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

A317745 Square array T(n,k) (n >= 1, k >= 1) read by antidiagonals: first row and column are A085090, other entries equal sum of entries in first row and first column.

Original entry on oeis.org

0, 3, 3, 5, 6, 5, 7, 8, 8, 7, 0, 10, 10, 10, 0, 11, 3, 12, 12, 3, 11, 13, 14, 5, 14, 5, 14, 13, 0, 16, 16, 7, 7, 16, 16, 0, 17, 3, 18, 18, 0, 18, 18, 3, 17, 19, 20, 5, 20, 11, 11, 20, 5, 20, 19, 0, 22, 22, 7, 13, 22, 13, 7, 22, 22, 0, 23, 3, 24, 24, 0, 24, 24, 0, 24, 24, 3, 23
Offset: 1

Views

Author

Fred Daniel Kline, Aug 05 2018

Keywords

Comments

This is related to Goldbach's conjecture, since entries for which the leftmost entry and the top entry are both nonzero are the sums of two primes.
The successive antidiagonals may also be regarded as the rows of a triangle, having A085090 as outside diagonals.

Examples

			Beginning of the array. All elements are equal to topmost value plus leftmost value.
   0  3  5  7  0 11 13  0 17 19  0 23
   3  6  8 10  3 14 16  3 20 22  3
   5  8 10 12  5 16 18  5 22 24
   7 10 12 14  7 18 20  7 24
   0  3  5  7  0 11 13  0
  11 14 16 18 11 22 24
  13 16 18 20 13 24
   0  3  5  7  0
  17 20 22 24
  19 22 24
   0  3
  23
		

Crossrefs

Cf. A085090.

Programs

  • Mathematica
    i[n_] := If[PrimeQ[2 n - 1], 2 n - 1, 0]; A085090 = Array[i, 82];
    r[k_] := Table[A085090[[j]] + A085090[[k - j + 1]], {j, 1, k}];
    a = Array[r, 12] // Flatten,
  • PARI
    a085090(n) = if (isprime(p=2*n-1), p, 0);
    row(n) = vector(n, k, a085090(k) + a085090(n-k+1));
    tabl(nn) = for (n=1, nn, print(row(n))); \\ Michel Marcus, Aug 09 2018

Formula

T(n, k) = A085090(n) + A085090(k).

Extensions

Edited by N. J. A. Sloane, Sep 09 2018

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

A098090 Numbers k such that 2k-3 is prime.

Original entry on oeis.org

3, 4, 5, 7, 8, 10, 11, 13, 16, 17, 20, 22, 23, 25, 28, 31, 32, 35, 37, 38, 41, 43, 46, 50, 52, 53, 55, 56, 58, 65, 67, 70, 71, 76, 77, 80, 83, 85, 88, 91, 92, 97, 98, 100, 101, 107, 113, 115, 116, 118, 121, 122, 127, 130, 133, 136, 137, 140, 142, 143, 148, 155, 157, 158
Offset: 1

Views

Author

Douglas Winston (douglas.winston(AT)srupc.com), Sep 14 2004

Keywords

Comments

Supersequence of A063908.
Left edge of the triangle in A065305. - Reinhard Zumkeller, Jan 30 2012

Crossrefs

Numbers n such that 2n+k is prime: A005097 (k=1), A067076 (k=3), A089038 (k=5), A105760 (k=7), A155722 (k=9), A101448 (k=11), A153081 (k=13), A089559 (k=15), A173059 (k=17), A153143 (k=19).
Numbers n such that 2n-k is prime: A006254 (k=1), this sequence (k=3), A089253 (k=5), A089192 (k=7), A097069 (k=9), A097338 (k=11), A097363 (k=13), A097480 (k=15), A098605 (k=17), A097932 (k=19).

Programs

Formula

Half of p + 3, where p is a prime greater than 2.
A122845(a(n), 3) = 3; a(n) = A113935(n+1)/2. - Reinhard Zumkeller, Sep 14 2006

A101264 a(n) = 1 if 2*n + 1 is prime, otherwise a(n) = 0.

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Giovanni Teofilatto, Dec 18 2004

Keywords

Comments

Inverse Mobius transform of the sequence, after dropping a(0), yields A086668. - R. J. Mathar, Jan 25 2009
If we drop a(0) then we may describe the sequence as: for all numbers k(n) [k(n) = 4 ceiling(n/2) + (-1)^n] congruent to -1 or +1 (mod 4) starting with k(n) = {3,5,7,9,11,...}, a(k(n)) is 1 if k(n) is prime and 0 if k(n) is composite. - Daniel Forgues, Mar 01 2009

Examples

			a(1) = 1 because 2*1+1 = 3 is prime;
a(2) = 1 because 2*2+1 = 5 is prime;
a(3) = 1 because 2*3+1 = 7 is prime;
a(4) = 0 because 2*4+1 = 9 is composite.
		

References

  • D. H. Lehmer, "Computer Technology Applied to the Theory of Numbers," from Studies in Number Theory, ed. William J. LeVeque. Englewood Cliffs, New Jersey: Prentice Hall (1969): 138.

Crossrefs

Bisection (odd n) of A010051.
If we drop a(0), equals absolute value of A156707. - Daniel Forgues, Mar 01 2009

Programs

  • Magma
    [IsPrime(2*n+1) select 1 else 0: n in [1..100]]; // Marius A. Burtea, Aug 25 2019
    
  • Maple
    with(numtheory): a:= proc(n) if isprime(2*n+1)=true then 1 else 0 fi end:
    seq(a(n), n=0..80); # Ridouane Oudra, Aug 25 2019
  • Mathematica
    Table[If[PrimeQ[2n + 1], 1, 0], {n, 0, 104}] (* Ray Chandler, Jan 09 2005 *)
    Table[Boole[PrimeQ[n]], {n, 1, 209, 2}] (* Alonso del Arte, Sep 25 2012 *)
  • PARI
    first(n) = {my(res = vector(n)); forprime(p = 3, 2*n - 1, res[p \ 2] = 1); res} \\ David A. Corneth, Aug 25 2019

Formula

a(n) = A057427(A085090(n+1)). - Reinhard Zumkeller, Sep 14 2006
For n > 0, a(n) = (2n-1)! mod (2n+1). - Thomas Ordowski, Jul 23 2016
a(n) = pi(2*n+1) - pi(2*n), where pi(n) = A000720(n). - Ridouane Oudra, Aug 25 2019

Extensions

Corrected by Ray Chandler, Jan 09 2005

A122845 Triangle read by rows, 3<=k<=n: T(n,k) = smallest prime p such that 2*k-p and 2*n-p are prime, T(n,k) = 0 if no such p exists.

Original entry on oeis.org

3, 3, 3, 3, 3, 3, 0, 5, 5, 5, 3, 3, 3, 7, 3, 3, 3, 3, 5, 3, 3, 0, 5, 5, 5, 7, 5, 5, 3, 3, 3, 7, 3, 3, 7, 3, 3, 3, 3, 5, 3, 3, 5, 3, 3, 0, 5, 5, 5, 7, 5, 5, 7, 5, 5, 3, 3, 3, 7, 3, 3, 7, 3, 3, 7, 3, 0, 5, 5, 5, 11, 5, 5, 17, 5, 5, 23, 5, 0, 0, 7, 7, 7, 11, 7, 7, 11, 7, 7, 11, 7, 3, 3, 3, 0, 3, 3, 13, 3, 3, 13
Offset: 3

Views

Author

Reinhard Zumkeller, Sep 14 2006

Keywords

Crossrefs

Cf. A098090.

Programs

  • Mathematica
    T[n_, k_] := Module[{p}, For[p = 2, p < 2n && p < 2k, p = NextPrime[p], If[PrimeQ[2n - p] && PrimeQ[2k - p], Return[p]]]; 0];
    Table[T[n, k], {n, 3, 16}, {k, 3, n}] // Flatten (* Jean-François Alcover, Sep 22 2021 *)

Formula

T(A098090(n),3) = 2*A098090(n) - A085090(A098090(n)-1) = 3.

A308754 a(0) = 0, a(n) = a(n-1) + 1 if 2*n + 3 is prime, otherwise a(n) = a(n-1).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

It appears that A000040(a(n)) ~ 2*n as n tends to infinity. (See Mar 12 2012 note from Vladimir Shevelev in A060308.)

Examples

			a(0) = 0 (by definition).
a(1) = 1 = a(0) + 1, because 2*1 + 3 is prime;
a(2) = 2 = a(1) + 1, because 2*2 + 3 is prime;
a(3) = 2 = a(2),     because 2*3 + 3 is not prime;
a(4) = 3 = a(3) + 1, because 2*4 + 3 is prime.
		

Crossrefs

Programs

  • BASIC
    ' p(n) contains the prime sequence except for 2. p(0)=3
    ' output in the a(n) sequence for 0 <= n <= maxterm
    ip = -1
    For n = 0 To maxterm
       If (2 * n + 3) = p(ip+1) Then
          ip = ip + 1
       End If
       a(n) = ip
    Next n
    
  • Magma
    [#PrimesUpTo(2*n + 4) - 2: n in [0..80] ]; // Vincenzo Librandi, Aug 01 2019
  • Mathematica
    a[0] = 0; a[n_] := a[n] = a[n - 1] + Boole@PrimeQ[2 n + 3]; Array[a, 100, 0] (* Amiram Eldar, Jul 06 2019 *)

Formula

a(n) = a(n-1) + A101264(n+1), n > 0.
a(n) = A000720(2 * (n+2)) - 2.
a(n) = A099801(n+1) - 2.
a(n) = n - A210469(n+2).
A000040(a(n) + 2) = A060265(n+2).
A000040(a(n) + 2) = A060308(n+2).
A000040(a(n) + 2) = A085090(n+2), if 2*n + 3 is prime, otherwise 0.

A354836 Triangle T(n,k) where, if n-k and n+k are prime, T(n,k) = n+k is the greater term of a Goldbach partition of 2n into two odd primes, or zero otherwise.

Original entry on oeis.org

3, 0, 5, 5, 0, 7, 0, 7, 0, 0, 7, 0, 0, 0, 11, 0, 0, 0, 11, 0, 13, 0, 0, 11, 0, 13, 0, 0, 0, 0, 0, 13, 0, 0, 0, 17, 11, 0, 0, 0, 0, 0, 17, 0, 19, 0, 13, 0, 0, 0, 17, 0, 19, 0, 0, 13, 0, 0, 0, 0, 0, 19, 0, 0, 0, 23, 0, 0, 0, 17, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 17, 0, 19, 0, 0, 0, 23, 0, 0, 0, 0
Offset: 3

Views

Author

Jean-François Alcover, Jun 12 2022

Keywords

Comments

This sequence has the same structure as A354805, which could be considered as sort of its characteristic function.

Examples

			Triangle begins:
    3;
    0, 5;
    5, 0, 7;
    0, 7, 0, 0;
    7, 0, 0, 0,11;
    0, 0, 0,11, 0,13;
    0, 0,11, 0,13, 0, 0;
    0, 0, 0,13, 0, 0, 0,17;
   11, 0, 0, 0, 0, 0,17, 0,19;
   ...
Example: for n=11, row {11,0,0,0,0,0,17,0,19}, when stripped of its zeros and subtracted from 2n=22, gives the partitions {{11,11},{17,5},{19,3}}.
		

Crossrefs

Cf. A085090 (main diagonal), A061397 (column k=0 prepended with (0,2)), A145091 (column k=1 prepended with (0,2,3,0)), A354805.

Programs

  • Mathematica
    nmin = 3; nmax = 16;
    T[n_ /; n >= nmin, k_ /; k >= 0] := If[PrimeQ[n-k] && PrimeQ[n+k], n+k, 0];
    Table[T[n, k], {n, nmin, nmax}, {k, 0, n - nmin}] // Flatten
Showing 1-8 of 8 results.