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

A304484 a(n) = A033270(n)*A033270(2n), where A033270 counts the odd primes.

Original entry on oeis.org

0, 0, 2, 3, 6, 8, 15, 15, 18, 21, 28, 32, 40, 40, 45, 50, 60, 60, 77, 77, 84, 91, 104, 112, 112, 112, 120, 120, 135, 144, 170, 170, 170, 180, 180, 190, 220, 220, 220, 231, 252, 264, 286, 286, 299, 299, 322, 322, 336, 336, 350, 364, 390, 405, 420, 420, 435, 435, 464, 464
Offset: 1

Views

Author

Jason Kimberley, May 15 2018

Keywords

Crossrefs

Cf. A304483 = A000720(n)*A000720(2n).

Programs

  • Magma
    A033270:=func; A:=[A033270(n):n in[1..120]]; [A[n]*A[2*n]:n in[1..#A div 2]];
    
  • Mathematica
    Array[(PrimePi@ # - Boole[# > 1]) (PrimePi[2 #] - Boole[2 # > 1]) &, 60] (* Michael De Vlieger, May 27 2018 *)
  • PARI
    a033270(n) = max(primepi(n)-1, 0);
    a(n) = a033270(n)*a033270(2*n);

A000720 pi(n), the number of primes <= n. Sometimes called PrimePi(n) to distinguish it from the number 3.14159...

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Partial sums of A010051 (characteristic function of primes). - Jeremy Gardiner, Aug 13 2002
pi(n) and prime(n) are inverse functions: a(A000040(n)) = n and A000040(n) is the least number m such that A000040(a(m)) = A000040(n). A000040(a(n)) = n if (and only if) n is prime. - Jonathan Sondow, Dec 27 2004
See the additional references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
A lower bound that gets better with larger N is that there are at least T prime numbers less than N, where the recursive function T is: T = N - N*Sum_{i=0..T(sqrt(N))} A005867(i)/A002110(i). - Ben Paul Thurston, Aug 23 2010
Number of partitions of 2n into exactly two parts with the smallest part prime. - Wesley Ivan Hurt, Jul 20 2013
Equivalent to the Riemann hypothesis: abs(a(n) - li(n)) < sqrt(n)*log(n)/(8*Pi), for n >= 2657, where li(n) is the logarithmic integral (Lowell Schoenfeld). - Ilya Gutkovskiy, Jul 05 2016
The second Hardy-Littlewood conjecture, that pi(x) + pi(y) >= pi(x + y) for integers x and y with min{x, y} >= 2, is known to hold for (x, y) sufficiently large (Udrescu 1975). - Peter Luschny, Jan 12 2021

Examples

			There are 3 primes <= 6, namely 2, 3 and 5, so pi(6) = 3.
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, p. 8.
  • Raymond Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; p. 129.
  • Florian Cajori, A History of Mathematical Notations, Dover edition (2012), par. 409.
  • Richard Crandall and Carl Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 5.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Theorems 6, 7, 420.
  • G. J. O. Jameson, The Prime Number Theorem, Camb. Univ. Press, 2003. [See also the review by D. M. Bressoud (link below).]
  • Władysław Narkiewicz, The Development of Prime Number Theory, Springer-Verlag, 2000.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 132-133, 157-184.
  • József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Section VII.1. (For inequalities, etc.).
  • 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).
  • Gerald Tenenbaum and Michel Mendès France, Prime Numbers and Their Distribution, AMS Providence RI, 1999.
  • V. Udrescu, Some remarks concerning the conjecture pi(x + y) <= pi(x) + pi(y), Rev. Roumaine Math. Pures Appl. 20 (1975), 1201-1208.

Crossrefs

Closely related:
A099802: Number of primes <= 2n.
A060715: Number of primes between n and 2n (exclusive).
A035250: Number of primes between n and 2n (inclusive).
A038107: Number of primes < n^2.
A014085: Number of primes between n^2 and (n+1)^2.
A007053: Number of primes <= 2^n.
A036378: Number of primes p between powers of 2, 2^n < p <= 2^(n+1).
A006880: Number of primes < 10^n.
A006879: Number of primes with n digits.
A033270: Number of odd primes <= n.
A065855: Number of composites <= n.
For lists of large values of a(n) see, e.g., A005669(n) = a(A002386(n)), A214935(n) = a(A205827(n)).
Related sequences:
Primes (p) and composites (c): A000040, A002808, A065855.
Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.

Programs

  • Haskell
    a000720 n = a000720_list !! (n-1)
    a000720_list = scanl1 (+) a010051_list  -- Reinhard Zumkeller, Sep 15 2011
    
  • Magma
    [ #PrimesUpTo(n): n in [1..200] ];  // Bruno Berselli, Jul 06 2011
    
  • Maple
    with(numtheory); A000720 := pi; [ seq(A000720(i),i=1..50) ];
  • Mathematica
    A000720[n_] := PrimePi[n]; Table[ A000720[n], {n, 1, 100} ]
    Array[ PrimePi[ # ]&, 100 ]
    Accumulate[Table[Boole[PrimeQ[n]],{n,100}]] (* Harvey P. Dale, Jan 17 2015 *)
  • PARI
    A000720=vector(100,n,omega(n!)) \\ For illustration only; better use A000720=primepi
    
  • PARI
    vector(300,j,primepi(j)) \\ Joerg Arndt, May 09 2008
    
  • Python
    from sympy import primepi
    for n in range(1,100): print(primepi(n), end=', ') # Stefano Spezia, Nov 30 2018
  • Sage
    [prime_pi(n) for n in range(1, 79)]  # Zerinvary Lajos, Jun 06 2009
    

Formula

The prime number theorem gives the asymptotic expression a(n) ~ n/log(n).
For x > 1, pi(x) < (x / log x) * (1 + 3/(2 log x)). For x >= 59, pi(x) > (x / log x) * (1 + 1/(2 log x)). [Rosser and Schoenfeld]
For x >= 355991, pi(x) < (x / log(x)) * (1 + 1/log(x) + 2.51/(log(x))^2 ). For x >= 599, pi(x) > (x / log(x)) * (1 + 1/log(x)). [Dusart]
For x >= 55, x/(log(x) + 2) < pi(x) < x/(log(x) - 4). [Rosser]
For n > 1, A138194(n) <= a(n) <= A138195(n) (Tschebyscheff, 1850). - Reinhard Zumkeller, Mar 04 2008
For n >= 33, a(n) = 1 + Sum_{j=3..n} ((j-2)! - j*floor((j-2)!/j)) (Hardy and Wright); for n >= 1, a(n) = n - 1 + Sum_{j=2..n} (floor((2 - Sum_{i=1..j} (floor(j/i)-floor((j-1)/i)))/j)) (Ruiz and Sondow 2000). - Benoit Cloitre, Aug 31 2003
a(n) = A001221(A000142(n)). - Benoit Cloitre, Jun 03 2005
G.f.: Sum_{p prime} x^p/(1-x) = b(x)/(1-x), where b(x) is the g.f. for A010051. - Franklin T. Adams-Watters, Jun 15 2006
a(n) = A036234(n) - 1. - Jaroslav Krizek, Mar 23 2009
From Enrique Pérez Herrero, Jul 12 2010: (Start)
a(n) = Sum_{i=2..n} floor((i+1)/A000203(i)).
a(n) = Sum_{i=2..n} floor(A000010(n)/(i-1)).
a(n) = Sum_{i=2..n} floor(2/A000005(n)). (End)
Let pf(n) denote the set of prime factors of an integer n. Then a(n) = card(pf(n!/floor(n/2)!)). - Peter Luschny, Mar 13 2011
a(n) = -Sum_{p <= n} mu(p). - Wesley Ivan Hurt, Jan 04 2013
a(n) = (1/2)*Sum_{p <= n} (mu(p)*d(p)*sigma(p)*phi(p)) + sum_{p <= n} p^2. - Wesley Ivan Hurt, Jan 04 2013
a(1) = 0 and then, for all k >= 1, repeat k A001223(k) times. - Jean-Christophe Hervé, Oct 29 2013
a(n) = n/(log(n) - 1 - Sum_{k=1..m} A233824(k)/log(n)^k + O(1/log(n)^{m+1})) for m > 0. - Jonathan Sondow, Dec 19 2013
a(n) = A001221(A003418(n)). - Eric Desbiaux, May 01 2014
a(n) = Sum_{j=2..n} H(-sin^2 (Pi*(Gamma(j)+1)/j)) where H(x) is the Heaviside step function, taking H(0)=1. - Keshav Raghavan, Jun 18 2016
a(A014076(n)) = (1/2) * (A014076(n) + 1) - n + 1. - Christopher Heiling, Mar 03 2017
From Steven Foster Clark, Sep 25 2018: (Start)
a(n) = Sum_{m=1..n} A143519(m) * floor(n/m).
a(n) = Sum_{m=1..n} A001221(m) * A002321(floor(n/m)) where A002321() is the Mertens function.
a(n) = Sum_{m=1..n} |A143519(m)| * A002819(floor(n/m)) where A002819() is the Liouville Lambda summatory function and |x| is the absolute value of x.
a(n) = Sum_{m=1..n} A137851(m)/m * H(floor(n/m)) where H(n) = Sum_{m=1..n} 1/m is the harmonic number function.
a(n) = Sum_{m=1..log_2(n)} A008683(m) * A025528(floor(n^(1/m))) where A008683() is the Moebius mu function and A025528() is the prime-power counting function.
(End)
Sum_{k=2..n} 1/a(k) ~ (1/2) * log(n)^2 + O(log(n)) (de Koninck and Ivić, 1980). - Amiram Eldar, Mar 08 2021
a(n) ~ 1/(n^(1/n)-1). - Thomas Ordowski, Jan 30 2023
a(n) = Sum_{j=2..n} floor(((j - 1)! + 1)/j - floor((j - 1)!/j)) [Mináč, unpublished] (see Ribenboim, pp. 132-133). - Stefano Spezia, Apr 13 2025
a(n) = n - 1 - Sum_{k=2..floor(log_2(n))} pi_k(n), where pi_k(n) is the number of k-almost primes <= n. - Daniel Suteu, Aug 27 2025

Extensions

Additional links contributed by Lekraj Beedassy, Dec 23 2003
Edited by M. F. Hasler, Apr 27 2018 and (links recovered) Dec 21 2018

A065091 Odd primes.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277
Offset: 1

Views

Author

Labos Elemer, Nov 12 2001

Keywords

Comments

Rayes et al. prove that the a(n)-th Chebyshev-T polynomial, divided by x, is irreducible over the integers.
Odd primes can be written as a sum of no more than two consecutive positive integers. Powers of 2 do not have a representation as a sum of k consecutive positive integers (other than the trivial n=n, for k=1). See A111774. - Jaap Spies, Jan 04 2007
Intersection of A005408 and A000040. - Reinhard Zumkeller, Oct 14 2008
Primes which are the sum of two consecutive numbers. - Juri-Stepan Gerasimov, Nov 07 2009
The arithmetic mean of divisors of p^3, (1+p)(1+p^2)/4, for odd primes p is an integer. - Ctibor O. Zizka, Oct 20 2009
Primes == -+ 1 (mod 4). - Juri-Stepan Gerasimov, Apr 27 2010
a(n) = A053670(A179675(n)) and a(n) <> A053670(m) for m < A179675(n). - Reinhard Zumkeller, Jul 23 2010
Triads of the form <2*a(n+1), a(n+1), 3*a(n+1)> like <6,3,9>, <10,5,15>, <14,7,21> appear in the EKG sequence A064413, see Theorem (3) there. - Paul Curtz, Feb 13 2011.
Complement of A065090; abs(A151763(a(n))) = 1. - Reinhard Zumkeller, Oct 06 2011
Right edge of the triangle in A065305. - Reinhard Zumkeller, Jan 30 2012
Numbers with two odd divisors. - Omar E. Pol, Mar 24 2012
Odd prime p divides some (2^k + 1) or (2^k - 1), (k>0, minimal, cf. A003558) depending on the parity of A179480((p+1)/2) = r. This is a consequence of the Quasi-order theorem and corollaries, [Hilton and Pederson, pp. 260-264]: 2^k == (-1)^r mod b, b odd; and b divides 2^k - (-1)^r, where p is a subset of b. - Gary W. Adamson, Aug 26 2012
Subset of the arithmetic numbers (A003601). - Wesley Ivan Hurt, Sep 27 2013
Odd primes p satisfy the identity: p = (product(2*cos((2*k+1)*Pi/(2*p)), k=0..(p-3)/2))^2. This follows from C(2*p, 0) = (-1)^((p-1)/2)*p, n>=2, with the minimal polynomial C(k,x) of rho(k) := 2*cos(Pi/k). See A187360 for C and the W. Lang link on the field Q(rho(n)), eqs. (20) and (37). - Wolfdieter Lang, Oct 23 2013
Numbers m > 1 such that m^2 divides (2m-1)!! + m. - Thomas Ordowski, Nov 28 2014
Numbers m such that m divides 2*(m-3)! + 1. - Thomas Ordowski, Jun 20 2015
Numbers m such that (2m-3)!! == m (mod m^2). - Thomas Ordowski, Jul 24 2016
Odd numbers m such that ((m-3)!!)^2 == +-1 (mod m). - Thomas Ordowski, Jul 27 2016
Primes of the form x^2 - y^2. - Thomas Ordowski, Feb 27 2017
Conjecture: a(n) is the smallest odd number m > prime(n) such that Sum_{k=1..prime(n)-1} k^(m-1) == prime(n)-1 (mod m). This is an extension of the Agoh-Giuga conjecture. - Thomas Ordowski, Aug 01 2018
Numbers k > 1 such that either Phi(k,x) == 1 (mod k) or Phi(k,x) == k (mod k^2) holds, where Phi(k,x) is the k-th cyclotomic polynomial. - Jianing Song, Aug 02 2018

References

  • Paulo Ribenboim, The little book of big primes, Springer 1991, p. 106.

Crossrefs

Cf. A000040, A033270, union of A002144 and A002145.
Cf. A230953 (boustrophedon transform).

Programs

  • Haskell
    a065091 n = a065091_list !! (n-1)
    a065091_list = tail a000040_list  -- Reinhard Zumkeller, Jan 30 2012
    
  • Magma
    [NthPrime(n): n in [2..100]]; // Vincenzo Librandi, Jun 21 2015
    
  • Maple
    A065091 := proc(n) RETURN(ithprime(n+1)) end:
  • Mathematica
    Prime[Range[2, 33]] (* Vladimir Joseph Stephan Orlovsky, Aug 22 2008 *)
  • PARI
    forprime(p=3, 200, print1(p, ", ")) \\ Felix Fröhlich, Jun 30 2014
    
  • Python
    from sympy import prime
    def A065091(n): return prime(n+1) # Chai Wah Wu, Jul 13 2024
  • Sage
    def A065091_list(limit):  # after Minác's formula
        f = 3; P = [f]
        for n in range(3, limit, 2):
            if (f+1)>n*(f//n)+1: P.append(n)
            f = f*n
        return P
    A065091_list(100)  # Peter Luschny, Oct 17 2013
    

Formula

a(n) = A000040(n+1). - M. F. Hasler, Oct 26 2013

Extensions

More terms from Francisco Salinas (franciscodesalinas(AT)hotmail.com), Jan 05 2002
Edited (moved contributions from A000040 to here) by M. F. Hasler, Oct 26 2013

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

A046927 Number of ways to express 2n+1 as p+2q where p and q are primes.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is related to a conjecture of Lemoine (also sometimes called Levy's conjecture, although Levy was anticipated by Lemoine 69 years earlier). - Zhi-Wei Sun, Jun 10 2008
The conjecture states that any odd number greater than 5 can be written as p+2q where p and q are primes.
It can be conjectured that 1, 3, 5, 59 and 151 are the only odd integers n such that n + 2p and n + 2q both are composite for all primes p,q with n = p + 2q. (Following an observation from V. Shevelev, cf. link to SeqFan list.) - M. F. Hasler, Apr 10 2017

References

  • L. E. Dickson, "History of the Theory of Numbers", Vol. I (Amer. Math. Soc., Chelsea Publ., 1999); see p. 424.

Crossrefs

Cf. A194831 (records), A194830 (positions of records).

Programs

  • Mathematica
    a[n_] := (ways = 0; Do[p = 2k + 1; q = n-k; If[PrimeQ[p] && PrimeQ[q], ways++], {k, 1, n}]; ways); Table[a[n], {n, 0, 91}] (* Jean-François Alcover, Dec 05 2012 *)
    Table[Count[FrobeniusSolve[{1, 2}, 2 n + 1], {?PrimeQ}], {n, 0, 91}] (* Jan Mangaldan, Apr 08 2013 *)
  • PARI
    a(n)=my(s);n=2*n+1;forprime(p=2,n\2,s+=isprime(n-2*p));s \\ Charles R Greathouse IV, Jul 17 2013

Formula

For n >= 1, a(n) = Sum_{3<=p<=n+1, p prime} A((2*n + 1 - p)/2) + Sum_{2<=q<=(n+1)/2, q prime} B(2*n + 1 - 2*q) - A((n+1)/2)*B(n+1) - a(n-1) - ... - a(0), where A(n) = A000720(n), B(n) = A033270(n). - Vladimir Shevelev, Jul 12 2013

Extensions

Additional references from Zhi-Wei Sun, Jun 10 2008

A155216 Number of decompositions of positive even numbers 2n into unordered sums of a prime and a prime or semiprime (Chen's partitions).

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Jan 22 2009

Keywords

Comments

According to Chen's result, the terms of this sequence are positive, at least for sufficiently large n.

References

  • J. R. Chen, On the representation of a large even integer as the sum of a prime and the product of at most two primes, Kexue Tongbao, 17(1966), 385-386.
  • J. R. Chen, On the representation of a larger even integer as the sum of a prime and the product of at most two primes, Sci. Sinica, 16(1973), 157-176.
  • P. M. Ross, On Chen's theorem that each large even number has the form (p1+p2) or (p1+p2p3), J. London Math. Soc. (2) 10(1975), 500-506.

Crossrefs

Programs

  • Maple
    A155216 := proc(n) local a,p,q,twon ; twon := 2*n ; a := 0 ; for i from 1 do p := ithprime(i) ; if ithprime(i) > twon then break; end if; q := twon -ithprime(i) ; if isprime(q) and q>= p then a := a+1 ; end if; end do: for i from 1 do p := ithprime(i) ; if ithprime(i) > twon then break; end if; q := twon -ithprime(i) ; if isA001358(q) then a := a+1 ; end if; end do: return a; end proc: seq(A155216(n),n=1..80) ; # R. J. Mathar, Jul 26 2010
  • Mathematica
    a[n_] := Module[{k = 0, p, q}, For[i = 1, True, i++, p = Prime[i]; If[p > 2n, Break[]]; q = 2n - Prime[i]; If[PrimeQ[q] && q >= p, k++]]; For[i = 1, True, i++, p = Prime[i]; If[p > 2n, Break[]]; q = 2n - Prime[i]; If[ PrimeOmega[q] == 2, k++]]; k];
    Array[a, 80] (* Jean-François Alcover, Nov 28 2017, after R. J. Mathar *)

Formula

For n >= 2, a(n) = Sum_{3<=p<=n, p prime} A(2*n - p) + Sum_{t<=2*n, t odd semiprime} A(2*n - t) + A(n) - binomial(A(n),2) + delta(n) - a(n-1) - ... - a(1), where A(n) = A033270(n), delta(n) = 1, if n is prime, and delta(n) = 2, if n is a composite number. - Vladimir Shevelev, Jul 11 2013

Extensions

Terms beyond a(21) from R. J. Mathar, Jul 26 2010

A304483 a(n) = pi(n)*pi(2n), where pi is A000720: the prime counting function.

Original entry on oeis.org

0, 2, 6, 8, 12, 15, 24, 24, 28, 32, 40, 45, 54, 54, 60, 66, 77, 77, 96, 96, 104, 112, 126, 135, 135, 135, 144, 144, 160, 170, 198, 198, 198, 209, 209, 220, 252, 252, 252, 264, 286, 299, 322, 322, 336, 336, 360, 360, 375, 375, 390, 405, 432, 448, 464, 464, 480, 480, 510
Offset: 1

Views

Author

Jason Kimberley, May 13 2018

Keywords

Crossrefs

Programs

A369777 Primes that do not divide any 3-Carmichael numbers.

Original entry on oeis.org

2, 1223, 1487, 4007, 4547, 7823, 9839, 10259, 11483, 11807, 11909, 13259, 13967, 14207, 15629, 15803, 16139, 16889, 18287, 19583, 23039, 23879, 24359, 25349, 29339, 30707, 32027, 34883, 36929, 38747, 39113, 39119, 42787, 43223, 44207, 46829, 47189, 49003, 49019, 49157, 53093, 56267, 56909
Offset: 1

Views

Author

Max Alekseyev, Jan 31 2024

Keywords

Comments

An odd prime p is a term if and only if A290481(A033270(p)) = 0.

Crossrefs

Subsequence of A051663.

A290484 Odd prime numbers that are factors of only one 3-Carmichael number.

Original entry on oeis.org

3, 11, 59, 197, 389, 467, 479, 503, 563, 719, 839, 887, 1523, 1907, 2087, 2339, 2837, 3167, 3989, 4229, 4259, 4643, 4679, 4787, 4903, 4919, 5417, 5849, 5879, 6299, 7307, 7331, 7577, 7583, 8117
Offset: 1

Views

Author

Amiram Eldar, Aug 03 2017

Keywords

Comments

Beeger proved in 1950 that if p < q < r are primes such that p*q*r is a 3-Carmichael number, then q < 2p^2 and r < p^3. Therefore there is a finite number of 3-Carmichael numbers which divisible by a given prime.
An odd prime p is a term if and only if A290481(A033270(p)) = 1. - Max Alekseyev, Jan 31 2024

Examples

			59 is in the sequence since it is a prime factor of only one 3-Carmichael number: 178837201 = 59 * 1451 * 2089.
		

References

  • N. G. W. H. Beeger, "On composite numbers n for which a^n == 1 (mod n) for every a prime to n", Scripta Mathematica, Vol. 16 (1950), pp. 133-135.

Crossrefs

Cf. A065091 (Odd primes), A087788 (3-Carmichael numbers), A051663, A290481, A369777.

Extensions

a(1)-a(12) were calculated using Pinch's tables of Carmichael numbers (see links).
a(13)-a(35) from Max Alekseyev, Jan 31 2024

A327247 Number of odd prime powers <= n (with exponents > 0).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Sep 14 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Boole[OddQ[k] && PrimePowerQ[k]], {k, 1, n}], {n, 1, 75}]
  • PARI
    a(n) = {sum(k=2, primepi(n), logint(n, prime(k)))} \\ Andrew Howroyd, Sep 14 2019

Formula

a(n) = A025528(n) - A000523(n).
Showing 1-10 of 10 results.