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

A073425 a(0)=0; for n>0, a(n) = number of primes not exceeding n-th composite number.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jul 31 2002

Keywords

Comments

a(n-1) = A018252(n) - n. a(n-1) = inverse (frequency distribution) sequence of A014689(n), i.e. number of terms of sequence A014689(n) less than n. a(n) = A073169(n+1) - 1, for n >= 1. For n >= 1: a(n) + 1 = A073169(n) = the number of set {1, primes}, i.e. (A008578) less than (n)-th composite numbers (A002828(n)). a(n-1) = The number of primes (A000040(n)) less than n-th nonprime (A018252(n)). - Jaroslav Krizek, Jun 27 2009

Examples

			n=100: composite[100]=133,Pi[133]=32=a(100)
		

Crossrefs

Programs

  • Mathematica
    c[x_] := FixedPoint[x+PrimePi[ # ]+1&, x] Table[PrimePi[c[w]], {w, 1, 128}]
    With[{nn=150},PrimePi/@Complement[Range[nn],Prime[Range[PrimePi[nn]]]]] (* Harvey P. Dale, Jun 26 2013 *)
  • Python
    from sympy import composite
    def A073425(n): return composite(n)-n-1 if n else 0 # Chai Wah Wu, Oct 11 2024

Formula

a(n) = A000720(A002808(n)).
a(n) ~ n. - Charles R Greathouse IV, Sep 02 2015
a(n) = A002808(n)-n-1 for n > 0. - Chai Wah Wu, Oct 11 2024

Extensions

Edited by N. J. A. Sloane, Jul 04 2009 at the suggestion of R. J. Mathar
Correction for change of offset in A158611 and A008578 in Aug 2009 Jaroslav Krizek, Jan 27 2010

A162177 a(n) is the number of composite numbers that are smaller than A008578(n).

Original entry on oeis.org

0, 0, 0, 1, 2, 5, 6, 9, 10, 13, 18, 19, 24, 27, 28, 31, 36, 41, 42, 47, 50, 51, 56, 59, 64, 71, 74, 75, 78, 79, 82, 95, 98, 103, 104, 113, 114, 119, 124, 127, 132, 137, 138, 147, 148, 151, 152, 163, 174, 177, 178, 181, 186, 187, 196, 201, 206, 211, 212, 217, 220, 221
Offset: 1

Views

Author

Jaroslav Krizek, Jun 27 2009

Keywords

Comments

Essentially the same as A065890.
a(n) = number of terms of A073169(n) less than n.

Examples

			A008578(6) = 11, and there are 5 composites smaller than 11, viz. 4, 6, 8, 9, 10, hence a(6) = 5.
		

Crossrefs

Cf. A002808 (composites), A008578 (1 and the primes), A065890, A073169.

Programs

  • Magma
    T:=[0,1] cat PrimesUpTo(300); [ T[n+1]-n: n in [1..#T-1] ]; // Klaus Brockhaus, Sep 08 2009
  • Mathematica
    Join[{0},Module[{nn=300,cmps},cmps=Accumulate[Table[If[CompositeQ[n],1,0],{n,nn}]];Table[cmps[[p]],{p,Prime[ Range[ PrimePi[ nn]]]}]]] (* Harvey P. Dale, Nov 11 2024 *)

Formula

a(n) = A008578(n) - n = A158611(n+1) -n.
a(n) = A065890(n-1) for n > 1.

Extensions

Edited and extended by Klaus Brockhaus, Sep 09 2009

A073170 a(1) = a(2) = 0; for n>2, a(n) = prime(n-1)-n+1.

Original entry on oeis.org

0, 0, 1, 2, 3, 6, 7, 10, 11, 14, 19, 20, 25, 28, 29, 32, 37, 42, 43, 48, 51, 52, 57, 60, 65, 72, 75, 76, 79, 80, 83, 96, 99, 104, 105, 114, 115, 120, 125, 128, 133, 138, 139, 148, 149, 152, 153, 164, 175, 178, 179, 182, 187, 188, 197, 202, 207, 212, 213, 218, 221
Offset: 1

Views

Author

Labos Elemer, Jul 19 2002

Keywords

Comments

Smallest x such that A002808(x)-x (cf. A073169) equals n, or 0 if no such value exists.

Crossrefs

Cf. A002808, A073168, A073169. Essentially same sequence as A014689.

Programs

  • Mathematica
    f[x_] := FixedPoint[x+PrimePi[ # ]+1&, x] t=Table[0, {100}]; Do[s=f[n]-n; If[s<101&&t[[s]]==0, t[[s]]=n], {n, 1, 10000}]; t
    Join[{0,0},Table[Prime[n-1]-n+1,{n,3,70}]] (* Harvey P. Dale, Dec 18 2012 *)

Formula

a(n)=Min{x; composite[x]-x=n}

Extensions

Simpler description from Vladeta Jovovic, Mar 29 2003
Definition corrected by Harvey P. Dale, Dec 18 2012

A163248 Sum of the n-th composite number plus the number of composite numbers less than the n-th noncomposite number.

Original entry on oeis.org

4, 6, 8, 10, 12, 17, 20, 24, 26, 31, 38, 40, 46, 51, 53, 57, 63, 69, 72, 79, 83, 85, 91, 95, 102, 110, 114, 117, 122, 124, 128, 143, 147, 153, 155, 165, 168, 174, 180, 184, 190, 197, 200, 210, 212, 216, 218, 231, 243, 247
Offset: 1

Views

Author

Jaroslav Krizek, Jul 23 2009

Keywords

Programs

  • Maple
    nnc:= 1: nc:= 0; b[nnc]:= 0:b[0]:= 0:
    for x from 2 to 1000 do
       if isprime(x) then
         nnc:= nnc+1; b[nnc]:= b[nnc-1];
       else
         b[nnc]:= b[nnc]+1;
         nc:= nc+1;
         c[nc]:= x;
       fi
    od:
    seq(b[n-1]+c[n],n=1..min(nnc,nc)); # Robert Israel, Jan 09 2015

Formula

a(n) = A002808(n) + A162177(n) = A008578(n) + A073169(n).

Extensions

Corrected for Aug 2009 change of offset in A158611 and A008578 by Jaroslav Krizek, Jan 27 2010
Showing 1-4 of 4 results.