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.

Previous Showing 11-20 of 80 results. Next

A163639 The count of odd numbers from prime(n) up to the n-th odd nonprime, A014076(n).

Original entry on oeis.org

1, 4, 6, 8, 8, 8, 9, 9, 9, 9, 10, 8, 8, 8, 9, 7, 6, 8, 6, 6, 7, 5, 5, 3, 2, 2, 2, 3, 4, 3, 5, 6, 8, 8, 11, 10, 12, 12, 13, 15, 17, 15, 19, 18, 19, 18, 22, 27, 27, 27, 26, 28, 28, 32, 32, 32, 34, 34, 36, 37, 36, 40, 46, 47, 47, 47, 51, 52, 56, 54, 55, 57, 60, 61, 63, 63, 65, 67, 68, 69
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 02 2009

Keywords

Comments

The count includes these two odd numbers themselves and is conducted in both directions with a positive result independent of which of the two limits is larger.

Examples

			a(2)=4 counts the 4 numbers 3, 5, 7, and 9;
a(3)=6 counts the 6 numbers 5, 7, 9, 11, 13, and 15.
		

Crossrefs

Programs

  • Maple
    A014076 := proc(n) if n = 1 then 1; else for a from procname(n-1)+2 by 2 do if not isprime(a) then RETURN(a) ; fi; od: fi; end:
    A163639 := proc(n) if n = 1 then 1; else onpr := A014076(n) ; pr := ithprime(n) ; 1+(max(onpr,pr)-min(onpr,pr))/2 fi; end:
    seq(A163639(n),n=1..100) ; # R. J. Mathar, Aug 06 2009

Formula

a(n) = 1 + (M-m)/2, n > 1, where M = max(A000040(n), A014076(n)) and m = min(A000040(n), A014076(n)).

Extensions

Edited and corrected R. J. Mathar, Aug 06 2009

A172048 a(n) = A104275(n) + A014076(n).

Original entry on oeis.org

2, 14, 23, 32, 38, 41, 50, 53, 59, 68, 74, 77, 83, 86, 95, 98, 104, 113, 116, 122, 128, 131, 137, 140, 143, 149, 158, 167, 173, 176, 179, 182, 185, 188, 194, 200, 203, 212, 215, 218, 221, 230, 233, 239, 242, 248, 254, 257, 263, 266, 275, 278, 281, 284, 293
Offset: 1

Views

Author

Roger L. Bagula, Jan 24 2010

Keywords

Comments

Alternatively: the sequence of the numbers 3*k-1 for all nonprime 2*k-1, k >= 1.

Crossrefs

Programs

  • Mathematica
    Flatten[Table[If[PrimeQ[2*n - 1], {}, 3*n - 1], {n, 1, 100}]]

Extensions

The two equivalent definitions separated by the Assoc. Editors of the OEIS, Feb 02 2010

A256134 The absolute value of a(n) is the length of the n-th line segment of a labyrinth related to odd nonprimes (A014076) and odd primes (A065091) (see Comments lines for definition).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Mar 31 2015

Keywords

Comments

In order to construct this sequence we use the following rules:
We start with the diagram described in A256253 in which the regions in direction S-W represent the odd nonprimes (A014076) and the regions in direction N-E represent the odd primes (A065091).
The diagram must be modified such that the new diagram contains only one region of infinite length as shown in Example section, figure 1.
The absolute value of a(n) is the length of the n-th line segment in the walk into the mentioned diagram as shown in Example section, figure 2.
The sign of a(n) is the same as the sign of the precedent term in the sequence whose absolute value is 1.
The positive value of a(n) means that the line segment rotates in the direction of the clockwise.
The negative value of a(n) means that the line segment rotates counter to the clockwise.
A line segment of length x can be replaced be x toothpicks with nodes between their endpoints.
Also the sequence can be interpreted as an irregular array T(j,k), see Formula section and Example section.

Examples

			Written as an irregular array T(j,k) the sequence begins:
  -----------------------
   j/k:     1    2    3
  -----------------------
   1:                 1;
   2:       1,   1,  -1;
   3:      -2,  -2,   1;
   4:       3,   4;
   5:       4,   5;
   6:       5,   5,  -1;
   7:      -6,  -7;
   8:      -7,  -8;
   9:      -8,  -8,   1;
  10:       9,  10;
  11:      10,  11;
  12:      11,  12;
  13:      12,  12,  -1;
  14:     -13, -14;
  15:     -14, -14,   1;
  16:      15,  16;
  17:      16,  16;  -1;
  18:     -17, -18;
  19:     -18, -19:
  20:     -19, -20;
  ...
.           _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.          |  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  |   37
.          | |   |  _ _ _ _ _ _ _ _ _ _ _ _ _ _  | |   31
.          | | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _  | | |   29
.          | | | |   |  _ _ _ _ _ _ _ _ _ _  | | | |   23
.          | | | | | | |  _ _ _ _ _ _ _ _  | | | | |   19
.          | | | | | | |_ _ _ _ _ _ _ _  | | | | | |   17
.          | | | | | | |  _ _ _ _ _ _  | | | | | | |   13
.          | | | | | | | |  _ _ _ _  | | | | | | | |   11
.          | | | | | | | | |  _ _  | | | | | | | | |    7
.          | | | | | | | | |_ _  | | | | | | | | | |    5
.  A014076 | | | | | | | | |   | | | | | | | | | | |    3
.     1    | | | | | | | | |_|_ _| | | | | | | | | | A065091
.     9    | | | | | | | |_ _ _ _ _|_ _| | | | | | |
.    15    | | | | | | |_ _ _ _ _ _ _ _ _| | | | | |
.    21    | | | | | |_ _ _ _ _ _ _ _ _ _ _| | | | |
.    25    | | | | |_ _ _ _ _ _ _ _ _ _ _ _ _| | | |
.    27    | | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
.    33    | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| |
.    35    | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
.    39    |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.
Figure 1. Here the diagram described in A256253 was modified such that the new diagram contains only one region of infinite length.
.
Illustration of initial terms (n = 1..46):
.            _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.           |  _   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  |
.           | | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _  | |
.           | | |  _   _ _ _ _ _ _ _ _ _ _ _  | | |
.           | | | | | |  _ _ _ _ _ _ _ _ _  | | | |
.           | | | | | | |_ _ _ _ _ _ _ _  | | | | |
.           | | | | | |  _ _ _ _ _ _ _  | | | | | |
.           | | | | | | |  _ _ _ _ _  | | | | | | |
.           | | | | | | | |  _ _ _  | | | | | | | |
.           | | | | | | | | |_ _  | | | | | | | | |
.           | | | | | | | |  _  | | | | | | | | | |
.           | | | | | | | | | |_| | | | | | | | | |
.           | | | | | | | |_ _ _ _| |_| | | | | | |
.           | | | | | | |_ _ _ _ _ _ _ _| | | | | |
.           | | | | | |_ _ _ _ _ _ _ _ _ _| | | | |
.           | | | | |_ _ _ _ _ _ _ _ _ _ _ _| | | |
.           | | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
.           | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| |
.           | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|       Labyrinth
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  <-- entrance
.
Figure 2. Interpreted as a sequence, the absolute value of a(n) is the length of the n-th line segment starting from the center of the structure. The figure shows the first 46 line segments. Note that the structure looks like a labyrinth.
		

Crossrefs

Formula

Written as an irregular array we have that:
T(1,3) = 1.
And for j > 1:
T(j,1) = m*(j-1), where m is the precedent term in the sequence whose absolute value is 1.
T(j,2) = T(j,1), if 2*j-1 is an odd prime and 2*j+1 is an odd nonprime or if 2*j-1 is an odd nonprime and 2*j+1 is an odd prime.
T(j,3) = (-1)*m, if T(j,1) = T(j,2), where m is the precedent term in the sequence whose absolute value is 1, otherwise T(j,3) does not exist.

A165287 Primes which are the sum of at least 3 consecutive odd nonprimes (A014076) >1.

Original entry on oeis.org

61, 71, 73, 97, 107, 163, 179, 197, 233, 239, 257, 263, 271, 307, 331, 349, 359, 367, 397, 409, 419, 421, 461, 467, 479, 487, 503, 523, 547, 571, 593, 599, 613, 617, 631, 659, 677, 691, 709, 727, 733, 743, 757, 761, 787, 809, 811, 821, 827, 839, 857
Offset: 1

Views

Author

Keywords

Examples

			15+21+25 = 61, 9+15+21+25+27 = 97.
		

Crossrefs

Cf. A106091.

Programs

  • Mathematica
    lst={};Do[If[PrimeQ[m],Continue[]];s=m;Do[If[PrimeQ[n],Continue[]];s+=n;If[PrimeQ[s],If[s<=2917,AppendTo[lst,s]]],{n,m+2,2*6!,2}],{m,1,2*6!,2}];lst=Take[Union@lst,200]
  • PARI
    N=1000;v=vector(N);L=listcreate();n=9;while(nRalf Stephan, Nov 26 2013

Extensions

Edited by Ralf Stephan, Nov 26 2013

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

A071904 Odd composite numbers.

Original entry on oeis.org

9, 15, 21, 25, 27, 33, 35, 39, 45, 49, 51, 55, 57, 63, 65, 69, 75, 77, 81, 85, 87, 91, 93, 95, 99, 105, 111, 115, 117, 119, 121, 123, 125, 129, 133, 135, 141, 143, 145, 147, 153, 155, 159, 161, 165, 169, 171, 175, 177, 183, 185, 187, 189, 195, 201, 203, 205
Offset: 1

Views

Author

Shyam Sunder Gupta, Jun 12 2002

Keywords

Comments

Same as A014076 except for the initial term A014076(1)=1 (which is not a composite number).
Values of quadratic form (2x + 3)*(2y + 3) = 4xy + 6x + 6y + 9 for x, y >= 0. - Anton Joha, Jan 21 2001
Intersection of A002808 and A005408. - Reinhard Zumkeller, Oct 10 2011
Composite numbers n such that (n-1)^(n-1) == 1 (mod n). - Michel Lagneau, Feb 18 2012
There is a rectangular array of n dots (with both sides > 1) with a unique center point if and only if n is in this sequence. - Peter Woodward, Apr 21 2015
First differences <= 6. Cf. A164510. - Zak Seidov, Sep 22 2016
Let r(n) = (a(n)-1)/(a(n)+1) if a(n) mod 4 = 1, (a(n)+1)/(a(n)-1) otherwise; then Product_{n>=1} r(n) = (4/5) * (8/7) * (10/11) * (12/13) * (14/13) * ... = Pi/4. - Dimitris Valianatos, May 24 2017

Examples

			45 is in the sequence because it is odd and composite (45 = 3 * 3 * 5).
195 is in the sequence because it is odd and composite (195 = 3 * 5 * 13).
		

Crossrefs

Programs

  • Haskell
    a071904 n = a071904_list !! (n-1)
    a071904_list = filter odd a002808_list
    -- Reinhard Zumkeller, Oct 10 2011
    
  • Maple
    remove(isprime, [seq(2*i+1, i = 1 .. 1000)]); # Robert Israel, Apr 22 2015
    # alternative
    A071904 := proc(n) local a;
        if n = 1 then
            9;
        else
            for a from procname(n-1)+2 by 2 do
                if not isprime(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Sep 09 2015
  • Mathematica
    Select[Table[n, {n, 9, 300, 2}], !PrimeQ[#] &] (* Vladimir Joseph Stephan Orlovsky, Apr 16 2011 *)
    With[{upto = 200}, Complement[Range[9, upto, 2], Prime[Range[ PrimePi[ upto]]]]] (* Harvey P. Dale, Jan 24 2013 *)
    With[{upto = 200},oddsequence=Table[2n+1,{n,1,upto}];oddcomposites=Union[Flatten[Range[oddsequence^2,upto,2*oddsequence]]]] (* Ben Engelen, Feb 24 2016 *)
  • PARI
    is(n)=n%2 && !isprime(n) && n > 1 \\ Charles R Greathouse IV, Nov 24 2012
    
  • PARI
    lista(nn) = forcomposite(n=1, nn, if (n%2, print1(n, ", "))); \\ Michel Marcus, Sep 24 2016
    
  • Python
    from sympy import isprime
    def ok(n): return n > 3 and n%2 == 1 and not isprime(n)
    print(list(filter(ok, range(206)))) # Michael S. Branicky, Sep 15 2021
    
  • Python
    from sympy import primepi
    def A071904(n):
        if n == 1: return 9
        m, k = n, primepi(n) + n + (n>>1)
        while m != k:
            m, k = k, primepi(k) + n + (k>>1)
        return m # Chai Wah Wu, Jul 31 2024

Formula

A000035(a(n))*(1-A010051(a(n))) = 1; A020639(a(n)) = A162022(n). - Reinhard Zumkeller, Oct 10 2011
a(n) ~ 2n. - Charles R Greathouse IV, Jul 02 2013
More precisely, a(n) = 2n(1 + 2(1+o(1))/log(n)). - Vladimir Shevelev, Jan 07 2015

A083254 a(n) = 2*phi(n) - n.

Original entry on oeis.org

1, 0, 1, 0, 3, -2, 5, 0, 3, -2, 9, -4, 11, -2, 1, 0, 15, -6, 17, -4, 3, -2, 21, -8, 15, -2, 9, -4, 27, -14, 29, 0, 7, -2, 13, -12, 35, -2, 9, -8, 39, -18, 41, -4, 3, -2, 45, -16, 35, -10, 13, -4, 51, -18, 25, -8, 15, -2, 57, -28, 59, -2, 9, 0, 31, -26, 65, -4, 19, -22, 69, -24, 71, -2, 5, -4, 43, -30, 77, -16, 27, -2, 81, -36, 43, -2, 25
Offset: 1

Views

Author

Labos Elemer, May 08 2003

Keywords

Comments

Möbius transform of A033879, deficiency of n. - Antti Karttunen, Dec 26 2017

Examples

			Case 1# - totient(x)-cototient[x] = 0 if x is a power of 2;
Case 2# - totient(x)>cototient[x] gives odd primes and also A067800, (= A014076 except probably A036798); e.g. n = 33: a(33) = 2.20-33 = 7; n = p prime: a(p) = p-2;
Case 3# - totient(x)<cototient[x] gives even numbers without powers of 2 and most probably A036798; e.g. n = 20: a(20) = -4; n = 105: a(105) = 2.48-105 = 96-105 = -9.
		

Crossrefs

Programs

Formula

a(n) = totient(n) - cototient(n) = A000010(n) - A051953(n).
From Antti Karttunen, Dec 26 2017: (Start)
a(n) = A065620(A297153(n)) = A117966(A297154(n)).
a(n) = A297114(n) + A297115(n).
a(2n) = A297114(2n).
For all n >= 1, -a(A000010(n)) = A293516(n).
(End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = 6/Pi^2 - 1/2 = 0.107927... . - Amiram Eldar, Sep 07 2023

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

A163300 Even numbers without 2.

Original entry on oeis.org

0, 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, 122, 124, 126, 128, 130, 132
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 26 2009

Keywords

Comments

Zero together with the even nonprimes. - Omar E. Pol, Aug 04 2009
The nonprime numbers (A018252) begin: 1,4,6,8,9,10,12,14,15,... So the words "prime" and "nonprime" normally refer to the natural numbers or positive integers: 1,2,3,4,5,6,... (Zero is not a member of A018252. See also the definition of A141468). - Omar E. Pol, Aug 04 2009

Crossrefs

Programs

Formula

a(n) = 2*A087156(n).

Extensions

New definition from Charles R Greathouse IV, Jun 23 2024

A091113 Nonprimes of the form 4*k+1.

Original entry on oeis.org

1, 9, 21, 25, 33, 45, 49, 57, 65, 69, 77, 81, 85, 93, 105, 117, 121, 125, 129, 133, 141, 145, 153, 161, 165, 169, 177, 185, 189, 201, 205, 209, 213, 217, 221, 225, 237, 245, 249, 253, 261, 265, 273, 285, 289, 297, 301, 305, 309, 321, 325, 329, 333, 341, 345
Offset: 1

Views

Author

Labos Elemer, Feb 24 2004

Keywords

Comments

A multiplicative semigroup: if m and n are in the sequence, then so is m*n. - Antti Karttunen, Jul 02 2024

Crossrefs

Cf. A014076, A091236, A373978 (characteristic function).
Subsequence of A016813 (4*n+1).
Cf. also A291745.

Programs

  • GAP
    Filtered(List([0..100],k->4*k+1),n->not IsPrime(n)); # Muniru A Asiru, Mar 10 2019
    
  • Magma
    [n: n in [1..350] | IsIntegral((n-1)/4) and not IsPrime(n)]; // G. C. Greubel, Mar 10 2019
    
  • Maple
    A091113 := proc(n)
        option remember;
        if n =1 then
            1;
        else
            for a from procname(n-1)+4 by 4 do
                if not isprime(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A091113(n),n=1..100) ; # R. J. Mathar, Aug 29 2018
  • Mathematica
    Do[If[ !PrimeQ[n]&&Equal[Mod[n, 4], 1], Print[n]], {n, 1, 1000}]
    Select[4*Range[0,100]+1,!PrimeQ[#]&] (* Harvey P. Dale, Oct 28 2017 *)
  • PARI
    isok(n) = !isprime(n) && !((n-1) % 4); \\ Michel Marcus, Mar 11 2019
  • Sage
    [n for n in (1..350) if ((n-1)/4).is_integer() and not is_prime(n)] # G. C. Greubel, Mar 10 2019
    
Previous Showing 11-20 of 80 results. Next