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

A002808 The composite numbers: numbers n of the form x*y for x > 1 and y > 1.

Original entry on oeis.org

4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88
Offset: 1

Views

Author

Keywords

Comments

The natural numbers 1,2,... are divided into three sets: 1 (the unit), the primes (A000040) and the composite numbers (A002808).
The number of composite numbers <= n (A065855) = n - pi(n) (A000720) - 1.
n is composite iff sigma(n) + phi(n) > 2n. This is a nice result of the well known theorem: For all positive integers n, n = Sum_{d|n} phi(d). For the proof see my contribution to puzzle 76 of Carlos Rivera's Primepuzzles. - Farideh Firoozbakht, Jan 27 2005, Jan 18 2015
The composite numbers have the semiprimes A001358 as primitive elements.
A211110(a(n)) > 1. - Reinhard Zumkeller, Apr 02 2012
A060448(a(n)) > 1. - Reinhard Zumkeller, Apr 05 2012
A086971(a(n)) > 0. - Reinhard Zumkeller, Dec 14 2012
Composite numbers n which are the product of r=A001222(n) prime numbers are sometimes called r-almost primes. Sequences listing r-almost primes are: A000040 (r = 1), A001358 (r = 2), A014612 (r = 3), A014613 (r = 4), A014614 (r = 5), A046306 (r = 6), A046308 (r = 7), A046310 (r = 8), A046312 (r = 9), A046314 (r = 10), A069272 (r = 11), A069273 (r = 12), A069274 (r = 13), A069275 (r = 14), A069276 (r = 15), A069277 (r = 16), A069278 (r = 17), A069279 (r = 18), A069280 (r = 19), A069281 (r = 20). - Jason Kimberley, Oct 02 2011
a(n) = A056608(n) * A160180(n). - Reinhard Zumkeller, Mar 29 2014
Degrees for which there are irreducible polynomials which are reducible mod p for all primes p, see Brandl. - Charles R Greathouse IV, Sep 04 2014
An integer is composite if and only if it is the sum of strictly positive integers in arithmetic progression with common difference 2: 4 = 1 + 3, 6 = 2 + 4, 8 = 3 + 5, 9 = 1 + 3 + 5, etc. - Jean-Christophe Hervé, Oct 02 2014
This statement holds since k+(k+2)+...+k+2(n-1) = n*(n+k-1) = a*b with arbitrary a,b (taking n=a and k=b-a+1 if b>=a). - M. F. Hasler, Oct 04 2014
For n > 4, these are numbers n such that n!/n^2 = (n-1)!/n is an integer (see A056653). - Derek Orr, Apr 16 2015
Let f(x) = Sum_{i=1..x} Sum_{j=2..i-1} cos((2*Pi*x*j)/i). It is known that the zeros of f(x) are the prime numbers. So these are the numbers n such that f(n) > 0. - Michel Lagneau, Oct 13 2015
Numbers n that can be written as solutions of the Diophantine equation n = (x+2)(y+2) where {x,y} in N^2, pairs of natural numbers including zero (cf. Mathematica code and Davis). - Ron R Spencer and Bradley Klee, Aug 15 2016
Numbers n with a partition (containing at least two summands) so that its summands also multiply to n. If n is prime, there is no way to find those two (or more) summands. If n is composite, simply take a factor or several, write those divisors and fill with enough 1's so that they add up to n. For example: 4 = 2*2 = 2+2, 6 = 1*2*3 = 1+2+3, 8 = 1*1*2*4 = 1+1+2+4, 9 = 1*1*1*3*3 = 1+1+1+3+3. - Juhani Heino, Aug 02 2017

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 2.
  • A. E. Bojarincev, Asymptotic expressions for the n-th composite number, Univ. Mat. Zap. 6:21-43 (1967). - In Russian.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 127.
  • Martin Davis, "Algorithms, Equations, and Logic", pp. 4-15 of S. Barry Cooper and Andrew Hodges, Eds., "The Once and Future Turing: Computing the World", Cambridge 2016.
  • R. K. Guy, Unsolved Problems Number Theory, Section A.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 2.
  • D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 66.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 51.
  • 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

Complement of A008578. - Omar E. Pol, Dec 16 2016
Cf. A073783 (first differences), A073445 (second differences).
Boustrophedon transforms: A230954, A230955.
Cf. A163870 (nontrivial divisors).
Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, 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
    a002808 n = a002808_list !! (n-1)
    a002808_list = filter ((== 1) . a066247) [2..]
    -- Reinhard Zumkeller, Feb 04 2012
    
  • Magma
    [n: n in [2..250] | not IsPrime(n)]; // G. C. Greubel, Feb 24 2024
    
  • Maple
    t := []: for n from 2 to 20000 do if isprime(n) then else t := [op(t),n]; fi; od: t; remove(isprime,[$3..89]); # Zerinvary Lajos, Mar 19 2007
    A002808 := proc(n) option remember ; local a ; if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then return a; end if; end do ; end if; end proc; # R. J. Mathar, Oct 27 2009
  • Mathematica
    Select[Range[2,100], !PrimeQ[#]&] (* Zak Seidov, Mar 05 2011 *)
    With[{nn=100},Complement[Range[nn],Prime[Range[PrimePi[nn]]]]] (* Harvey P. Dale, May 01 2012 *)
    Select[Range[100], CompositeQ] (* Jean-François Alcover, Nov 07 2021 *)
  • PARI
    A002808(n)=for(k=0,primepi(n),isprime(n++)&&k--);n \\ For illustration only: see below. - M. F. Hasler, Oct 31 2008
    
  • PARI
    A002808(n)= my(k=-1); while(-n + n += -k + k=primepi(n),); n \\ For n=10^4 resp. 3*10^4, this is about 100 resp. 500 times faster than the former; M. F. Hasler, Nov 11 2009
    
  • PARI
    forcomposite(n=1, 1e2, print1(n, ", ")) \\ Felix Fröhlich, Aug 03 2014
    
  • PARI
    for(n=1, 1e3, if(bigomega(n) > 1, print1(n, ", "))) \\ Altug Alkan, Oct 14 2015
    
  • Python
    from sympy import primepi
    def A002808(n):
        m, k = n, primepi(n) + 1 + n
        while m != k:
            m, k = k, primepi(k) + 1 + n
        return m # Chai Wah Wu, Jul 15 2015, updated Apr 14 2016
    
  • Python
    from sympy import isprime
    def ok(n): return n > 1 and not isprime(n)
    print([k for k in range(89) if ok(k)]) # Michael S. Branicky, Nov 07 2021
    
  • Python
    next_A002808=lambda n: next(n for n in range(n,n*5)if not isprime(n)) # next composite >= n > 0; next_A002808(n)==n <=> iscomposite(n). - M. F. Hasler, Mar 28 2025
    is_A002808=lambda n:not isprime(n) and n>1 # where isprime(n) can be replaced with: all(n%d for d in range(2, int(n**.5)+1))
    # generators of composite numbers:
    A002808_upto=lambda stop=1<<59: filter(is_A002808, range(2,stop))
    A002808_seq=lambda:(q:=2)and(n for p in primes if (o:=q)<(q:=p) for n in range(o+1,p)) # with, e.g.: primes=filter(isprime,range(2,1<<59)) # M. F. Hasler, Mar 28 2025
    
  • SageMath
    [n for n in (2..250) if not is_prime(n)] # G. C. Greubel, Feb 24 2024

Formula

a(n) = pi(a(n)) + 1 + n, where pi is the prime counting function.
a(n) = A136527(n, n).
A000005(a(n)) > 2. - Juri-Stepan Gerasimov, Oct 17 2009
A001222(a(n)) > 1. - Juri-Stepan Gerasimov, Oct 30 2009
A000203(a(n)) < A007955(a(n)). - Juri-Stepan Gerasimov, Mar 17 2011
A066247(a(n)) = 1. - Reinhard Zumkeller, Feb 05 2012
Sum_{n>=1} 1/a(n)^s = Zeta(s)-1-P(s), where P is prime zeta. - Enrique Pérez Herrero, Aug 08 2012
n + n/log n + n/log^2 n < a(n) < n + n/log n + 3n/log^2 n for n >= 4, see Panaitopol. Bojarincev gives an asymptotic version. - Charles R Greathouse IV, Oct 23 2012
a(n) > n + A000720(n) + 1. - François Huppé, Jan 08 2025

Extensions

Deleted an incomplete and broken link. - N. J. A. Sloane, Dec 16 2010

A056608 Least prime factor of the n-th composite number.

Original entry on oeis.org

2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 5, 2, 3, 2, 2, 2, 3, 2, 5, 2, 2, 3, 2, 2, 2, 3, 2, 2, 7, 2, 3, 2, 2, 5, 2, 3, 2, 2, 2, 3, 2, 5, 2, 2, 3, 2, 2, 2, 3, 2, 7, 2, 2, 3, 2, 2, 5, 2, 3, 2, 2, 7, 2, 3, 2, 5, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 5, 2, 3, 2, 7, 2, 11, 2, 3, 2, 5, 2, 2, 3, 2, 2, 7, 2, 3, 2, 2, 2
Offset: 1

Views

Author

Odimar Fabeny, Aug 07 2000

Keywords

Comments

Record values are seen when n = A120389(m). Conjecture: at each new record the count of the prior record follows A247509. Records seen are 2, 3, 5, 7, 11, ... and when 3, 5, 7, 11 are first seen, there have been 3, 3, 2, and 4 occurrences of 2, 3, 5, and 7. These are A247509(1) through A247509(4). Thus, the count for prime(60) would be A247509(60). - Bill McEachen, Jun 17 2024

Crossrefs

Cf. A052369 (largest prime factor of n, where n runs through composite numbers). - Klaus Brockhaus, Jun 23 2009
Cf. A160180.

Programs

  • Haskell
    a056608 = a020639 . a002808  -- Reinhard Zumkeller, Mar 29 2014
    
  • Magma
    [ PrimeDivisors(n)[1]: n in [2..140] | not IsPrime(n) ]; // Klaus Brockhaus, Jun 23 2009
    
  • Mathematica
    DeleteCases[Table[FactorInteger[n][[1, 1]] * Boole[Not[PrimeQ[n]]], {n, 2, 100}], 0] (* Alonso del Arte, Aug 21 2014 *)
    FactorInteger[#][[1,1]]&/@Select[Range[200],CompositeQ] (* Harvey P. Dale, Mar 16 2023 *)
  • PARI
    forcomposite(n=1, 1e2, p=factor(n)[1, 1]; print1(p, ", ")) \\ Felix Fröhlich, Aug 03 2014
    
  • Python
    from sympy import composite, factorint
    def A056608(n):
        return min(factorint(composite(n))) # Chai Wah Wu, Jul 22 2019

Formula

a(n) = A020639(A002808(n)) = A000040(A118663(n)). - M. F. Hasler, Apr 03 2012

Extensions

More terms from James Sellers, Aug 25 2000
Definition corrected by Reinhard Zumkeller, Mar 29 2014
Name changed by Alonso del Arte, Aug 21 2014

A163870 Triangle read by rows: row n lists the nontrivial divisors of the n-th composite.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Aug 06 2009

Keywords

Comments

Row n contains row A002808(n) of table A027750.
T(n,k) = A027751(A002808(n),k+1), k = 1..A144925(n). - Reinhard Zumkeller, Mar 29 2014

Examples

			The table starts in row n=1 (with the composite 4) as
  2;
  2,3;
  2,4;
  3;
  2,5;
  2,3,4,6;
  2,7;
  3,5;
  2,4,8;
  2,3,6,9;
  2,4,5,10.
		

Crossrefs

Cf. A144925 (row lengths), A062825 (row sums), A056608 (left edge), A160180 (right edge).

Programs

  • Haskell
    a163870 n k = a163870_tabf !! (n-1) !! (k-1)
    a163870_row n = a163870_tabf !! (n-1)
    a163870_tabf = filter (not . null) $ map tail a027751_tabf
    -- Reinhard Zumkeller, Mar 29 2014
    
  • Mathematica
    Divisors[Select[Range[50], CompositeQ]][[All, 2 ;; -2]] (* Paolo Xausa, Dec 26 2024 *)
  • Python
    from itertools import islice
    def g():
        n, j = 1, 2
        while True:
            n = (n << 1) | 1
            p = 1
            for k in range(2, (j >> 1) + 1):
                p = (p << 1) | 1
                if n % p == 0: yield k
            j+=1
    print(list(islice(g(),95))) # Darío Clavijo, Dec 16 2024

Extensions

Entries checked by R. J. Mathar, Sep 22 2009

A340791 Irregular triangle read by rows in which row n lists the positive divisors of n that are >= sqrt(n) in decreasing order.

Original entry on oeis.org

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

Views

Author

Charles Kusniec, Jan 21 2021

Keywords

Comments

Reversing rows gives A161908.

Examples

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

Crossrefs

Cf. A038548 (row widths), A160180 (second column), A161908 (rows reversed), A340792.

Programs

  • PARI
    row(n) = Vecrev(select(x->(x>=sqrt(n)), divisors(n))); \\ Michel Marcus, Jan 22 2021

A161003 A list of the composite numbers divided by their largest prime factors.

Original entry on oeis.org

2, 2, 4, 3, 2, 4, 2, 3, 8, 6, 4, 3, 2, 8, 5, 2, 9, 4, 6, 16, 3, 2, 5, 12, 2, 3, 8, 6, 4, 9, 2, 16, 7, 10, 3, 4, 18, 5, 8, 3, 2, 12, 2, 9, 32, 5, 6, 4, 3, 10, 24, 2, 15, 4, 7, 6, 16, 27, 2, 12, 5, 2, 3, 8, 18, 7, 4, 3, 2, 5, 32, 14, 9, 20, 6, 8, 15, 2, 36, 10, 3, 16, 6, 5, 4, 9, 2, 7, 24, 11, 2, 3, 4
Offset: 1

Views

Author

Trevor Cassiliano (casstjc(AT)gmail.com), Jun 01 2009

Keywords

Comments

a(A120389(n)) = A000040(n). - Gionata Neri, May 07 2015
For n >= 2, a(x) = n where x = A066246(n*A006530(n)). - Robert Israel, May 07 2015

Examples

			n=1 4/2; n=2 6/3; n=3 8/2.
		

Crossrefs

Programs

  • Maple
    with(numtheory): a := proc (n) if isprime(n) = false then n/factorset(n)[nops(factorset(n))] else end if end proc: seq(a(n), n = 2 .. 130); # Emeric Deutsch, Jun 27 2009
  • Mathematica
    With[{cmps=Select[Range[200],CompositeQ]},#/FactorInteger[#][[-1,1]]&/@ cmps] (* Harvey P. Dale, Mar 29 2017 *)

Formula

a(n) = A002808(n)/A052369(n). - Robert Israel, May 07 2015

Extensions

Extended by Emeric Deutsch, Jun 27 2009

A372815 The square of n minus (the largest divisor d of n with 2 <= d <= m-1, or 0 if there is no such divisor).

Original entry on oeis.org

1, 4, 9, 14, 25, 33, 49, 60, 78, 95, 121, 138, 169, 189, 220, 248, 289, 315, 361, 390, 434, 473, 529, 564, 620, 663, 720, 770, 841, 885, 961, 1008, 1078, 1139, 1218, 1278, 1369, 1425, 1508, 1580, 1681, 1743, 1849, 1914, 2010, 2093, 2209, 2280, 2394, 2475, 2584
Offset: 1

Views

Author

Stephen Pearson, Jul 04 2024

Keywords

Examples

			For n = 10, the divisors of n are {1,2,5,10}. The largest nontrivial divisor is 5, so 10 * 10 - 5 = 95.
		

Crossrefs

Relates to A364391 but uses n^2 instead of n.

Programs

  • Mathematica
    Table[
      Module[{divisors, largestNonTrivialDivisor},
        divisors = Divisors[n];
        largestNonTrivialDivisor = If[Length[divisors] > 2, divisors[[-2]], 0];
        n^2 - largestNonTrivialDivisor
      ],
      {n, 1, 20}
    ]
  • Python
    def factors(n):
        return sorted([i for i in range(2, n - 1) if n % i == 0])
    def main():
        for i in range(1, 20):
            fs = factors(i)
            if len(fs) == 0:
                l = 0
            else:
                l = fs[-1]
            print(i*i - l)
    if _name_ == "_main_":
        main()

Formula

a(n) = n^2 - A032742(n) if n is composite, n^2 otherwise.
a(n) = A000290(n) <=> n in { A008578 }.
Showing 1-6 of 6 results.