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 13 results. Next

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

A001248 Squares of primes.

Original entry on oeis.org

4, 9, 25, 49, 121, 169, 289, 361, 529, 841, 961, 1369, 1681, 1849, 2209, 2809, 3481, 3721, 4489, 5041, 5329, 6241, 6889, 7921, 9409, 10201, 10609, 11449, 11881, 12769, 16129, 17161, 18769, 19321, 22201, 22801, 24649, 26569, 27889, 29929, 32041, 32761, 36481
Offset: 1

Views

Author

Keywords

Comments

Also 4, together with numbers n such that Sum_{d|n}(-1)^d = -A048272(n) = -3. - Benoit Cloitre, Apr 14 2002
Also, all solutions to the equation sigma(x) + phi(x) = 2x + 1. - Farideh Firoozbakht, Feb 02 2005
Unique numbers having 3 divisors (1, their square root, themselves). - Alexandre Wajnberg, Jan 15 2006
Smallest (or first) new number deleted at the n-th step in an Eratosthenes sieve. - Lekraj Beedassy, Aug 17 2006
Subsequence of semiprimes A001358. - Lekraj Beedassy, Sep 06 2006
Integers having only 1 factor other than 1 and the number itself. Every number in the sequence is a multiple of 1 factor other than 1 and the number itself. 4 : 2 is the only factor other than 1 and 4; 9 : 3 is the only factor other than 1 and 9; and so on. - Rachit Agrawal (rachit_agrawal(AT)daiict.ac.in), Oct 23 2007
The n-th number with p divisors is equal to the n-th prime raised to power p-1, where p is prime. - Omar E. Pol, May 06 2008
There are 2 Abelian groups of order p^2 (C_p^2 and C_p x C_p) and no non-Abelian group. - Franz Vrabec, Sep 11 2008
Also numbers n such that phi(n) = n - sqrt(n). - Michel Lagneau, May 25 2012
For n > 1, n is the sum of numbers from A006254(n-1) to A168565(n-1). - Vicente Izquierdo Gomez, Dec 01 2012
A078898(a(n)) = 2. - Reinhard Zumkeller, Apr 06 2015
Let r(n) = (a(n) - 1)/(a(n) + 1); then Product_{n>=1} r(n) = (3/5) * (4/5) * (12/13) * (24/25) * (60/61) * ... = 2/5. - Dimitris Valianatos, Feb 26 2019
Numbers k such that A051709(k) = 1. - Jianing Song, Jun 27 2021

Crossrefs

Programs

Formula

n such that A062799(n) = 2. - Benoit Cloitre, Apr 06 2002
A000005(a(n)^(k-1)) = A005408(k) for all k>0. - Reinhard Zumkeller, Mar 04 2007
a(n) = A000040(n)^(3-1)=A000040(n)^2, where 3 is the number of divisors of a(n). - Omar E. Pol, May 06 2008
A000005(a(n)) = 3 or A002033(a(n)) = 2. - Juri-Stepan Gerasimov, Oct 10 2009
A033273(a(n)) = 3. - Juri-Stepan Gerasimov, Dec 07 2009
For n > 2: (a(n) + 17) mod 12 = 6. - Reinhard Zumkeller, May 12 2010
A192134(A095874(a(n))) = A005722(n) + 1. - Reinhard Zumkeller, Jun 26 2011
For n > 2: a(n) = 1 (mod 24). - Zak Seidov, Dec 07 2011
A211110(a(n)) = 2. - Reinhard Zumkeller, Apr 02 2012
a(n) = A087112(n,n). - Reinhard Zumkeller, Nov 25 2012
a(n) = prime(n)^2. - Jon E. Schoenfield, Mar 29 2015
Product_{n>=1} a(n)/(a(n)-1) = Pi^2/6. - Daniel Suteu, Feb 06 2017
Sum_{n>=1} 1/a(n) = P(2) = 0.4522474200... (A085548). - Amiram Eldar, Jul 27 2020
From Amiram Eldar, Jan 23 2021: (Start)
Product_{n>=1} (1 + 1/a(n)) = zeta(2)/zeta(4) = 15/Pi^2 (A082020).
Product_{n>=1} (1 - 1/a(n)) = 1/zeta(2) = 6/Pi^2 (A059956). (End)

A006881 Squarefree semiprimes: Numbers that are the product of two distinct primes.

Original entry on oeis.org

6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58, 62, 65, 69, 74, 77, 82, 85, 86, 87, 91, 93, 94, 95, 106, 111, 115, 118, 119, 122, 123, 129, 133, 134, 141, 142, 143, 145, 146, 155, 158, 159, 161, 166, 177, 178, 183, 185, 187, 194, 201, 202, 203, 205
Offset: 1

Views

Author

Keywords

Comments

Numbers k such that phi(k) + sigma(k) = 2*(k+1). - Benoit Cloitre, Mar 02 2002
Numbers k such that tau(k) = omega(k)^omega(k). - Benoit Cloitre, Sep 10 2002 [This comment is false. If k = 900 then tau(k) = omega(k)^omega(k) = 27 but 900 = (2*3*5)^2 is not the product of two distinct primes. - Peter Luschny, Jul 12 2023]
Could also be called 2-almost primes. - Rick L. Shepherd, May 11 2003
From the Goldston et al. reference's abstract: "lim inf [as n approaches infinity] [(a(n+1) - a(n))] <= 26. If an appropriate generalization of the Elliott-Halberstam Conjecture is true, then the above bound can be improved to 6." - Jonathan Vos Post, Jun 20 2005
The maximal number of consecutive integers in this sequence is 3 - there cannot be 4 consecutive integers because one of them would be divisible by 4 and therefore would not be product of distinct primes. There are several examples of 3 consecutive integers in this sequence. The first one is 33 = 3 * 11, 34 = 2 * 17, 35 = 5 * 7; (see A039833). - Matias Saucedo (solomatias(AT)yahoo.com.ar), Mar 15 2008
Number of terms less than or equal to 10^k for k >= 0 is A036351(k). - Robert G. Wilson v, Jun 26 2012
Are these the numbers k whose difference between the sum of proper divisors of k and the arithmetic derivative of k is equal to 1? - Omar E. Pol, Dec 19 2012
Intersection of A001358 and A030513. - Wesley Ivan Hurt, Sep 09 2013
A237114(n) (smallest semiprime k^prime(n)+1) is a term, for n != 2. - Jonathan Sondow, Feb 06 2014
a(n) are the reduced denominators of p_2/p_1 + p_4/p_3, where p_1 != p_2, p_3 != p_4, p_1 != p_3, and the p's are primes. In other words, (p_2*p_3 + p_1*p_4) never shares a common factor with p_1*p_3. - Richard R. Forberg, Mar 04 2015
Conjecture: The sums of two elements of a(n) forms a set that includes all primes greater than or equal to 29 and all integers greater than or equal to 83 (and many below 83). - Richard R. Forberg, Mar 04 2015
The (disjoint) union of this sequence and A001248 is A001358. - Jason Kimberley, Nov 12 2015
A263990 lists the subsequence of a(n) where a(n+1)=1+a(n). - R. J. Mathar, Aug 13 2019

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Zervos, Marie: Sur une classe de nombres composés. Actes du Congrès interbalkanique de mathématiciens 267-268 (1935)

Crossrefs

Products of exactly k distinct primes, for k = 1 to 6: A000040, A006881. A007304, A046386, A046387, A067885.
Cf. A030229, A051709, A001221 (omega(n)), A001222 (bigomega(n)), A001358 (semiprimes), A005117 (squarefree), A007304 (squarefree 3-almost primes), A213952, A039833, A016105 (subsequences), A237114 (subsequence, n != 2).
Subsequence of A007422.
Cf. A259758 (subsequence), A036351, A363923.

Programs

  • Haskell
    a006881 n = a006881_list !! (n-1)
    a006881_list = filter chi [1..] where
       chi n = p /= q && a010051 q == 1 where
          p = a020639 n
          q = n `div` p
    -- Reinhard Zumkeller, Aug 07 2011
    
  • Magma
    [n: n in [1..210] | EulerPhi(n) + DivisorSigma(1,n) eq 2*(n+1)]; // Vincenzo Librandi, Sep 17 2015
    
  • Maple
    N:= 1001: # to get all terms < N
    Primes:= select(isprime, [2,seq(2*k+1,k=1..floor(N/2))]):
    {seq(seq(p*q,q=Primes[1..ListTools:-BinaryPlace(Primes,N/p)]),p=Primes)} minus {seq(p^2,p=Primes)};
    # Robert Israel, Jul 23 2014
    # Alternative, using A001221:
    isA006881 := proc(n)
         if numtheory[bigomega](n) =2 and A001221(n) = 2 then
            true ;
        else
            false ;
        end if;
    end proc:
    A006881 := proc(n) if n = 1 then 6; else for a from procname(n-1)+1 do if isA006881(a) then return a; end if; end do: end if;
    end proc: # R. J. Mathar, May 02 2010
    # Alternative:
    with(NumberTheory): isA006881 := n -> is(NumberOfPrimeFactors(n, 'distinct') = 2 and NumberOfPrimeFactors(n) = 2):
    select(isA006881, [seq(1..205)]); # Peter Luschny, Jul 12 2023
  • Mathematica
    mx = 205; Sort@ Flatten@ Table[ Prime[n]*Prime[m], {n, Log[2, mx/3]}, {m, n + 1, PrimePi[ mx/Prime[n]]}] (* Robert G. Wilson v, Dec 28 2005, modified Jul 23 2014 *)
    sqFrSemiPrimeQ[n_] := Last@# & /@ FactorInteger@ n == {1, 1}; Select[Range[210], sqFrSemiPrimeQ] (* Robert G. Wilson v, Feb 07 2012 *)
    With[{upto=250},Select[Sort[Times@@@Subsets[Prime[Range[upto/2]],{2}]],#<=upto&]] (* Harvey P. Dale, Apr 30 2018 *)
  • PARI
    for(n=1,214,if(bigomega(n)==2&&omega(n)==2,print1(n,",")))
    
  • PARI
    for(n=1,214,if(bigomega(n)==2&&issquarefree(n),print1(n,",")))
    
  • PARI
    list(lim)=my(v=List()); forprime(p=2,sqrt(lim), forprime(q=p+1, lim\p, listput(v,p*q))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Jul 20 2011
    
  • Python
    from sympy import factorint
    def ok(n): f=factorint(n); return len(f) == 2 and sum(f[p] for p in f) == 2
    print(list(filter(ok, range(1, 206)))) # Michael S. Branicky, Jun 10 2021
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A006881(n):
        def f(x): return int(n+x+(t:=primepi(s:=isqrt(x)))+(t*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Aug 15 2024
  • Sage
    def A006881_list(n) :
        R = []
        for i in (6..n) :
            d = prime_divisors(i)
            if len(d) == 2 :
                if d[0]*d[1] == i :
                    R.append(i)
        return R
    A006881_list(205)  # Peter Luschny, Feb 07 2012
    

Formula

A000005(a(n)^(k-1)) = A000290(k) for all k>0. - Reinhard Zumkeller, Mar 04 2007
A109810(a(n)) = 4; A178254(a(n)) = 6. - Reinhard Zumkeller, May 24 2010
A056595(a(n)) = 3. - Reinhard Zumkeller, Aug 15 2011
a(n) = A096916(n) * A070647(n). - Reinhard Zumkeller, Sep 23 2011
A211110(a(n)) = 3. - Reinhard Zumkeller, Apr 02 2012
Sum_{n >= 1} 1/a(n)^s = (1/2)*(P(s)^2 - P(2*s)), where P is Prime Zeta. - Enrique Pérez Herrero, Jun 24 2012
A050326(a(n)) = 2. - Reinhard Zumkeller, May 03 2013
sopf(a(n)) = a(n) - phi(a(n)) + 1 = sigma(a(n)) - a(n) - 1. - Wesley Ivan Hurt, May 18 2013
d(a(n)) = 4. Omega(a(n)) = 2. omega(a(n)) = 2. mu(a(n)) = 1. - Wesley Ivan Hurt, Jun 28 2013
a(n) ~ n log n/log log n. - Charles R Greathouse IV, Aug 22 2013
A089233(a(n)) = 1. - Reinhard Zumkeller, Sep 04 2013
From Peter Luschny, Jul 12 2023: (Start)
For k > 1: k is a term <=> k^A001221(k) = k*A007947(k).
For k > 1: k is a term <=> k^A001222(k) = k*A007947(k).
For k > 1: k is a term <=> A363923(k) = k. (End)
a(n) ~ n log n/log log n. - Charles R Greathouse IV, Jan 13 2025

Extensions

Name expanded (based on a comment of Rick L. Shepherd) by Charles R Greathouse IV, Sep 16 2015

A018818 Number of partitions of n into divisors of n.

Original entry on oeis.org

1, 2, 2, 4, 2, 8, 2, 10, 5, 11, 2, 45, 2, 14, 14, 36, 2, 81, 2, 92, 18, 20, 2, 458, 7, 23, 23, 156, 2, 742, 2, 202, 26, 29, 26, 2234, 2, 32, 30, 1370, 2, 1654, 2, 337, 286, 38, 2, 9676, 9, 407, 38, 454, 2, 3132, 38, 3065, 42, 47, 2, 73155, 2, 50, 493, 1828, 44, 5257, 2, 740, 50, 5066
Offset: 1

Views

Author

Keywords

Comments

From Reinhard Zumkeller, Dec 11 2009: (Start)
For odd primes p: a(p^2) = p + 2; for n > 1: a(A001248(n)) = A052147(n);
For odd primes p > 3, a(3*p) = 2*p + 4; for n > 2: a(A001748(n)) = A100484(n) + 4. (End)
From Matthew Crawford, Jan 19 2021: (Start)
For a prime p, a(p^3) = (p^3 + p^2 + 2*p + 4)/2;
For distinct primes p and q, a(p*q) = (p+1)*(q+1)/2 + 2. (End)

Examples

			The a(6) = 8 representations of 6 are 6 = 3 + 3 = 3 + 2 + 1 = 3 + 1 + 1 + 1 = 2 + 2 + 2 = 2 + 2 + 1 + 1 = 2 + 1 + 1 + 1 + 1 = 1 + 1 + 1 + 1 + 1 + 1.
		

Crossrefs

Programs

  • Haskell
    a018818 n = p (init $ a027750_row n) n + 1 where
       p _      0 = 1
       p []     _ = 0
       p ks'@(k:ks) m | m < k     = 0
                      | otherwise = p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Apr 02 2012
    
  • Magma
    [#RestrictedPartitions(n,{d:d in Divisors(n)}): n in [1..100]]; // Marius A. Burtea, Jan 02 2019
  • Maple
    A018818 := proc(n)
        local a,p,w,el ;
        a := 0 ;
        for p in combinat[partition](n) do
            w := true ;
            for el in p do
                if modp(n,el) <> 0 then
                    w := false;
                    break;
                end if;
            end do:
            if w then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Mar 30 2017
  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[1/Product[1 - x^d[[i]], {i, Length[d]}], {x, 0, n}], x, n], {n, 100}] (* T. D. Noe, Jul 28 2011 *)
  • PARI
    a(n)=numbpartUsing(n, divisors(n));
    numbpartUsing(n, v, mx=#v)=if(n<1, return(n==0)); sum(i=1,mx, numbpartUsing(n-v[i],v,i)) \\ inefficient; Charles R Greathouse IV, Jun 21 2017
    
  • PARI
    A018818(n) = { my(p = Ser(1, 'x, 1+n)); fordiv(n, d, p /= (1 - 'x^d)); polcoef(p, n); }; \\ Antti Karttunen, Jan 23 2025, after Vladeta Jovovic
    

Formula

Coefficient of x^n in the expansion of 1/Product_{d|n} (1-x^d). - Vladeta Jovovic, Sep 28 2002
a(n) = 2 iff n is prime. - Juhani Heino, Aug 27 2009
a(n) = f(n,n,1), where f(n,m,k) = f(n,m,k+1) + f(n,m-k,k)*0^(n mod k) if k <= m, otherwise 0^m. - Reinhard Zumkeller, Dec 11 2009
Paul Erdős, Andrew M. Odlyzko, and the Editors of the AMM give bounds; see Bowman et al. - Charles R Greathouse IV, Dec 04 2012

A033942 Positive integers with at least 3 prime factors (counted with multiplicity).

Original entry on oeis.org

8, 12, 16, 18, 20, 24, 27, 28, 30, 32, 36, 40, 42, 44, 45, 48, 50, 52, 54, 56, 60, 63, 64, 66, 68, 70, 72, 75, 76, 78, 80, 81, 84, 88, 90, 92, 96, 98, 99, 100, 102, 104, 105, 108, 110, 112, 114, 116, 117, 120, 124, 125, 126, 128, 130, 132, 135, 136, 138, 140, 144
Offset: 1

Views

Author

Keywords

Comments

A001055(a(n)) > 2; e.g., for a(3)=18 there are 4 factorizations: 1*18 = 2*9 = 2*3*3 = 3*6. - Reinhard Zumkeller, Dec 29 2001
A001222(a(n)) > 2; A054576(a(n)) > 1. - Reinhard Zumkeller, Mar 10 2006
Also numbers such that no permutation of all divisors exists with coprime adjacent elements: A109810(a(n))=0. - Reinhard Zumkeller, May 24 2010
A211110(a(n)) > 3. - Reinhard Zumkeller, Apr 02 2012
A060278(a(n)) > 0. - Reinhard Zumkeller, Apr 05 2013
Volumes of rectangular cuboids with each side > 1. - Peter Woodward, Jun 16 2015
If k is a term then so is k*m for m > 0. - David A. Corneth, Sep 30 2020
Numbers k with a pair of proper divisors of k, (d1,d2), such that d1 < d2 and gcd(d1,d2) > 1. - Wesley Ivan Hurt, Jan 01 2021

Crossrefs

Cf. A014612.
A101040(a(n))=0.
A033987 is a subsequence; complement of A037143. - Reinhard Zumkeller, May 24 2010
Subsequence of A080257.
See also A002808 for 'Composite numbers' or 'Divisible by at least 2 primes'.

Programs

  • Haskell
    a033942 n = a033942_list !! (n-1)
    a033942_list = filter ((> 2) . a001222) [1..]
    -- Reinhard Zumkeller, Oct 27 2011
    
  • Maple
    with(numtheory): A033942:=n->`if`(bigomega(n)>2, n, NULL): seq(A033942(n), n=1..200); # Wesley Ivan Hurt, Jun 23 2015
  • Mathematica
    Select[ Range[150], Plus @@ Last /@ FactorInteger[ # ] > 2 &] (* Robert G. Wilson v, Oct 12 2005 *)
    Select[Range[150],PrimeOmega[#]>2&] (* Harvey P. Dale, Jun 22 2011 *)
  • PARI
    is(n)=bigomega(n)>2 \\ Charles R Greathouse IV, May 04 2013
    
  • Python
    from sympy import factorint
    def ok(n): return sum(factorint(n).values()) > 2
    print([k for k in range(145) if ok(k)]) # Michael S. Branicky, Sep 10 2022
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A033942(n):
        def f(x): return int(n+primepi(x)+sum(primepi(x//k)-a for a,k in enumerate(primerange(isqrt(x)+1))))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 23 2024

Formula

Numbers of the form Product p_i^e_i with Sum e_i >= 3.
a(n) ~ n. - Charles R Greathouse IV, May 04 2013

Extensions

Corrected by Patrick De Geest, Jun 15 1998

A080257 Numbers having at least two distinct or a total of at least three prime factors.

Original entry on oeis.org

6, 8, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 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, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 10 2003

Keywords

Comments

Complement of A000430; A080256(a(n)) > 3.
A084114(a(n)) > 0, see also A084110.
Also numbers greater than the square of their smallest prime-factor: a(n)>A020639(a(n))^2=A088377(a(n));
a(n)>A000430(k) for n<=13, a(n) < A000430(k) for n>13.
Numbers with at least 4 divisors. - Franklin T. Adams-Watters, Jul 28 2006
Union of A024619 and A033942; A211110(a(n)) > 2. - Reinhard Zumkeller, Apr 02 2012
Also numbers > 1 that are neither prime nor a square of a prime. Also numbers whose omega-sequence (A323023) has sum > 3. Numbers with omega-sequence summing to m are: A000040 (m = 1), A001248 (m = 3), A030078 (m = 4), A068993 (m = 5), A050997 (m = 6), A325264 (m = 7). - Gus Wiseman, Jul 03 2019
Numbers n such that sigma_2(n)*tau(n) = A001157(n)*A000005(n) >= 4*n^2. Note that sigma_2(n)*tau(n) >= sigma(n)^2 = A072861 for all n. - Joshua Zelinsky, Jan 23 2025

Examples

			8=2*2*2 and 10=2*5 are terms; 4=2*2 is not a term.
From _Gus Wiseman_, Jul 03 2019: (Start)
The sequence of terms together with their prime indices begins:
   6: {1,2}
   8: {1,1,1}
  10: {1,3}
  12: {1,1,2}
  14: {1,4}
  15: {2,3}
  16: {1,1,1,1}
  18: {1,2,2}
  20: {1,1,3}
  21: {2,4}
  22: {1,5}
  24: {1,1,1,2}
  26: {1,6}
  27: {2,2,2}
  28: {1,1,4}
  30: {1,2,3}
  32: {1,1,1,1,1}
(End)
		

Crossrefs

Programs

  • Haskell
    a080257 n = a080257_list !! (n-1)
    a080257_list = m a024619_list a033942_list where
       m xs'@(x:xs) ys'@(y:ys) | x < y  = x : m xs ys'
                               | x == y = x : m xs ys
                               | x > y  = y : m xs' ys
    -- Reinhard Zumkeller, Apr 02 2012
    
  • Mathematica
    Select[Range[100],PrimeNu[#]>1||PrimeOmega[#]>2&] (* Harvey P. Dale, Jul 23 2013 *)
  • PARI
    is(n)=omega(n)>1 || isprimepower(n)>2
    
  • PARI
    is(n)=my(k=isprimepower(n)); if(k, k>2, !isprime(n)) \\ Charles R Greathouse IV, Jan 23 2025

Formula

a(n) = n + O(n/log n). - Charles R Greathouse IV, Sep 14 2015

Extensions

Definition clarified by Harvey P. Dale, Jul 23 2013

A065205 Number of subsets of proper divisors of n that sum to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 5, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 7, 0, 0, 0, 3, 0, 2, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 0, 34, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 1, 0, 6, 0, 0, 0, 25, 0, 0, 0, 1, 0, 23, 0, 0, 0, 0, 0, 21, 0, 0, 0, 2
Offset: 1

Views

Author

Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Oct 19 2001

Keywords

Comments

Deficient and weird numbers have a(n) = 0, perfect numbers and others (see A064771) have a(n) = 1.
Number of partitions of n into distinct proper divisors of n; a(A136447(n)) = 0; a(A005835(n)) > 0; a(A064771(n)) = 1. - Reinhard Zumkeller, Jan 21 2013

Examples

			a(20) = 1 because {1, 4, 5, 10} is the only subset of proper divisors of 20 that sum to 20.
a(24) = 5 because there are five different subsets we can use to sum up to 24: {1, 2, 3, 4, 6, 8}, {1, 2, 3, 6, 12}, {1, 3, 8, 12}, {2, 4, 6, 12}, {4, 8, 12}.
		

Crossrefs

Cf. A065218 for records.

Programs

  • Haskell
    a065205 n = p (a027751_row n) n where
       p _      0 = 1
       p []     _ = 0
       p (k:ks) m = if m < k then 0 else p ks (m - k) + p ks m
    -- Reinhard Zumkeller, Jan 21 2013
    
  • Mathematica
    a[n_] := (dd = Most[ Divisors[n] ]; cc = Array[c, Length[dd]]; Length[ {ToRules[ Reduce[ And @@ (0 <= # <= 1 &) /@ cc && dd . cc == n, cc, Integers]]}]); Table[ a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 23 2012 *)
  • PARI
    a(n,s,d)={s || (s=sigma(n)-n) || return; d||d=vecextract(divisors(n),"^-1"); while(d[#d]>n, s-=d[#d]; d=d[1..-2]); s<=n && return(s==n); if( n>d[#d], a(n-d[#d],s-d[#d],d[1..-2]), 1)+a(n,s-d[#d],d[1..-2])} \\ M. F. Hasler, May 11 2015

Formula

a(n) = A033630(n) - 1.

Extensions

More terms and additional comments from Jud McCranie, Oct 21 2001

A210442 Number of partitions of n into proper divisors of n, cf. A027751.

Original entry on oeis.org

1, 0, 1, 1, 3, 1, 7, 1, 9, 4, 10, 1, 44, 1, 13, 13, 35, 1, 80, 1, 91, 17, 19, 1, 457, 6, 22, 22, 155, 1, 741, 1, 201, 25, 28, 25, 2233, 1, 31, 29, 1369, 1, 1653, 1, 336, 285, 37, 1, 9675, 8, 406, 37, 453, 1, 3131, 37, 3064, 41, 46, 1, 73154, 1, 49, 492, 1827
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 21 2013

Keywords

Comments

For n > 0: a(A000040(n)) = 1 and a(A002808(n)) > 1.

Crossrefs

Programs

  • Haskell
    a210442 n = p (a027751_row n) n where
       p _          0 = 1
       p []         _ = 0
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
  • Maple
    with(numtheory):
    a:= proc(n) local b, l; l:= sort([(divisors(n) minus {n})[]]):
          b:= proc(m, i) option remember; `if`(m=0 or i=1, 1,
                `if`(i<1, 0, b(m, i-1)+`if`(l[i]>m, 0, b(m-l[i], i))))
              end; forget(b):
          b(n, nops(l))
        end:
    seq(a(n), n=0..100); # Alois P. Heinz, Jan 29 2013
  • Mathematica
    a[n_] := Module[{b, l}, l = Most[Divisors[n]]; b[m_, i_] := b[m, i] = If[m==0 || i==1, 1, If[i<1, 0, b[m, i-1] + If[l[[i]]>m, 0, b[m-l[[i]], i]]]]; b[n, Length[l]]]; a[0]=1; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 02 2017, after Alois P. Heinz *)

A211111 Number of partitions of n into distinct divisors > 1 of n.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 6, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 3, 1, 2, 1, 1, 1, 19, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 1, 14, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 01 2012

Keywords

Comments

a(A136446(n)) > 1.

Examples

			n=12: the divisors > 1 of 12 are {2,3,4,6,12}, there are exactly two subsets which sum up to 12, namely {12} and {2,4,6}, therefore a(12) = 2;
a(13) = #{13} = 1, because 13 is prime, having no other divisor > 1;
n=14: the divisors > 1 of 14 are {2,7,14}, {14} is the only subset summing up to 14, therefore a(14) = 1.
		

Crossrefs

Programs

  • Haskell
    a211111 n = p (tail $ a027750_row n) n where
       p _  0 = 1
       p [] _ = 0
       p (k:ks) m | m < k     = 0
                   | otherwise = p ks (m - k) + p ks m
  • Maple
    with(numtheory):
    a:= proc(n) local b, l; l:= sort([(divisors(n) minus {1})[]]):
          b:= proc(m, i) option remember; `if`(m=0, 1, `if`(i<1, 0,
                 b(m, i-1)+`if`(l[i]>m, 0, b(m-l[i], i-1))))
              end; forget(b):
          b(n, nops(l))
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Nov 18 2021
  • Mathematica
    a[n_] := Count[IntegerPartitions[n, All, Divisors[n] // Rest], P_ /; Reverse[P] == Union[P]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Nov 18 2021 *)

Extensions

a(0)=1 prepended by Alois P. Heinz, Nov 18 2021

A293813 Number of partitions of n into nontrivial divisors of n.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 2, 0, 3, 1, 2, 0, 11, 0, 2, 2, 9, 0, 14, 0, 15, 2, 2, 0, 79, 1, 2, 4, 19, 0, 93, 0, 35, 2, 2, 2, 279, 0, 2, 2, 157, 0, 153, 0, 27, 24, 2, 0, 1075, 1, 28, 2, 31, 0, 254, 2, 261, 2, 2, 0, 7025, 0, 2, 31, 201, 2, 320, 0, 39, 2, 301, 0, 12071, 0, 2, 35, 43, 2, 427, 0, 3073
Offset: 0

Views

Author

Ilya Gutkovskiy, Oct 16 2017

Keywords

Examples

			a(6) = 2 because 6 has 4 divisors {1, 2, 3, 6} among which 2 are nontrivial divisors {2, 3} therefore we have [3, 3] and [2, 2, 2].
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) local b, l; l:= sort([(divisors(n) minus {1, n})[]]):
          b:= proc(m, i) option remember; `if`(m=0, 1, `if`(i<1, 0,
                 b(m, i-1)+`if`(l[i]>m, 0, b(m-l[i], i))))
              end; forget(b):
          b(n, nops(l))
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Oct 16 2017
  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[Product[1/(1 - Boole[d[[k]] != 1 && d[[k]] != n] x^d[[k]]), {k, Length[d]}], {x, 0, n}], x, n], {n, 0, 80}]

Formula

a(n) = [x^n] Product_{d|n, 1 < d < n} 1/(1 - x^d).
a(n) = A211110(n) - 1 for n > 1.
Showing 1-10 of 13 results. Next