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

A099055 A bisection of A054519.

Original entry on oeis.org

1, 4, 9, 15, 21, 28, 36, 42, 51, 59, 67, 75, 85, 92, 102, 112, 120, 128, 141, 147, 159, 169, 177, 187, 199, 208, 218, 228, 240, 248, 262, 268, 281, 293, 301, 313, 327, 333, 345, 357, 369, 378, 392, 400, 412, 426, 436, 444, 460, 468, 483, 493, 503, 515, 529, 539
Offset: 0

Views

Author

N. J. A. Sloane, Nov 15 2004

Keywords

Extensions

More terms from Joshua Zucker, May 12 2006

A099056 A bisection of A054519.

Original entry on oeis.org

2, 6, 11, 17, 24, 30, 38, 46, 53, 61, 71, 77, 88, 96, 104, 114, 124, 132, 143, 151, 161, 171, 183, 189, 202, 212, 220, 232, 244, 250, 264, 274, 285, 295, 305, 315, 329, 339, 349, 359, 374, 380, 396, 404, 414, 430, 440, 448, 462, 474, 485, 495, 511, 517, 531
Offset: 0

Views

Author

N. J. A. Sloane, Nov 15 2004

Keywords

Programs

  • Maple
    a:=n->sum(ceil(2*n/j), j=1..n): seq(a(n), n=1..55); # Zerinvary Lajos, Jan 24 2007

Extensions

More terms from Joshua Zucker, May 12 2006

A000005 d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 4, 3, 4, 2, 6, 2, 4, 4, 5, 2, 6, 2, 6, 4, 4, 2, 8, 3, 4, 4, 6, 2, 8, 2, 6, 4, 4, 4, 9, 2, 4, 4, 8, 2, 8, 2, 6, 6, 4, 2, 10, 3, 6, 4, 6, 2, 8, 4, 8, 4, 4, 2, 12, 2, 4, 6, 7, 4, 8, 2, 6, 4, 8, 2, 12, 2, 4, 6, 6, 4, 8, 2, 10, 5, 4, 2, 12, 4, 4, 4, 8, 2, 12, 4, 6, 4, 4, 4, 12, 2, 6, 6, 9, 2, 8, 2, 8
Offset: 1

Views

Author

Keywords

Comments

If the canonical factorization of n into prime powers is Product p^e(p) then d(n) = Product (e(p) + 1). More generally, for k > 0, sigma_k(n) = Product_p ((p^((e(p)+1)*k))-1)/(p^k-1) is the sum of the k-th powers of the divisors of n.
Number of ways to write n as n = x*y, 1 <= x <= n, 1 <= y <= n. For number of unordered solutions to x*y=n, see A038548.
Note that d(n) is not the number of Pythagorean triangles with radius of the inscribed circle equal to n (that is A078644). For number of primitive Pythagorean triangles having inradius n, see A068068(n).
Number of factors in the factorization of the polynomial x^n-1 over the integers. - T. D. Noe, Apr 16 2003
Also equal to the number of partitions p of n such that all the parts have the same cardinality, i.e., max(p)=min(p). - Giovanni Resta, Feb 06 2006
Equals A127093 as an infinite lower triangular matrix * the harmonic series, [1/1, 1/2, 1/3, ...]. - Gary W. Adamson, May 10 2007
For odd n, this is the number of partitions of n into consecutive integers. Proof: For n = 1, clearly true. For n = 2k + 1, k >= 1, map each (necessarily odd) divisor to such a partition as follows: For 1 and n, map k + (k+1) and n, respectively. For any remaining divisor d <= sqrt(n), map (n/d - (d-1)/2) + ... + (n/d - 1) + (n/d) + (n/d + 1) + ... + (n/d + (d-1)/2) {i.e., n/d plus (d-1)/2 pairs each summing to 2n/d}. For any remaining divisor d > sqrt(n), map ((d-1)/2 - (n/d - 1)) + ... + ((d-1)/2 - 1) + (d-1)/2 + (d+1)/2 + ((d+1)/2 + 1) + ... + ((d+1)/2 + (n/d - 1)) {i.e., n/d pairs each summing to d}. As all such partitions must be of one of the above forms, the 1-to-1 correspondence and proof is complete. - Rick L. Shepherd, Apr 20 2008
Number of subgroups of the cyclic group of order n. - Benoit Jubin, Apr 29 2008
Equals row sums of triangle A143319. - Gary W. Adamson, Aug 07 2008
Equals row sums of triangle A159934, equivalent to generating a(n) by convolving A000005 prefaced with a 1; (1, 1, 2, 2, 3, 2, ...) with the INVERTi transform of A000005, (A159933): (1, 1,-1, 0, -1, 2, ...). Example: a(6) = 4 = (1, 1, 2, 2, 3, 2) dot (2, -1, 0, -1, 1, 1) = (2, -1, 0, -2, 3, 2) = 4. - Gary W. Adamson, Apr 26 2009
Number of times n appears in an n X n multiplication table. - Dominick Cancilla, Aug 02 2010
Number of k >= 0 such that (k^2 + k*n + k)/(k + 1) is an integer. - Juri-Stepan Gerasimov, Oct 25 2015
The only numbers k such that tau(k) >= k/2 are 1,2,3,4,6,8,12. - Michael De Vlieger, Dec 14 2016
a(n) is also the number of partitions of 2*n into equal parts, minus the number of partitions of 2*n into consecutive parts. - Omar E. Pol, May 03 2017
From Tomohiro Yamada, Oct 27 2020: (Start)
Let k(n) = log d(n)*log log n/(log 2 * log n), then lim sup k(n) = 1 (Hardy and Wright, Chapter 18, Theorem 317) and k(n) <= k(6983776800) = 1.537939... (the constant A280235) for every n (Nicolas and Robin, 1983).
There exist infinitely many n such that d(n) = d(n+1) (Heath-Brown, 1984). The number of such integers n <= x is at least c*x/(log log x)^3 (Hildebrand, 1987) but at most O(x/sqrt(log log x)) (Erdős, Carl Pomerance and Sárközy, 1987). (End)
Number of 2D grids of n congruent rectangles with two different side lengths, in a rectangle, modulo rotation (cf. A038548 for squares instead of rectangles). Also number of ways to arrange n identical objects in a rectangle (NOT modulo rotation, cf. A038548 for modulo rotation); cf. A007425 and A140773 for the 3D case. - Manfred Boergens, Jun 08 2021
The constant quoted above from Nicolas and Robin, 6983776800 = 2^5 * 3^3 * 5^2 * 7 * 11 * 13 * 17 * 19, appears arbitrary, but interestingly equals 2 * A095849(36). That second factor is highly composite and deeply composite. - Hal M. Switkay, Aug 08 2025

Examples

			G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 2*x^5 + 4*x^6 + 2*x^7 + 4*x^8 + 3*x^9 + ...
		

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. 840.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 38.
  • G. Chrystal, Algebra: An elementary text-book for the higher classes of secondary schools and for colleges, 6th ed, Chelsea Publishing Co., New York 1959 Part II, p. 345, Exercise XXI(16). MR0121327 (22 #12066)
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 55.
  • G. H. Hardy and E. M. Wright, revised by D. R. Heath-Brown and J. H. Silverman, An Introduction to the Theory of Numbers, 6th ed., Oxford Univ. Press, 2008.
  • K. Knopp, Theory and Application of Infinite Series, Blackie, London, 1951, p. 451.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Chap. II. (For inequalities, etc.)
  • S. Ramanujan, Collected Papers, Ed. G. H. Hardy et al., Cambridge 1927; Chelsea, NY, 1962. Has many references to this sequence. - N. J. A. Sloane, Jun 02 2014
  • 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).
  • B. Spearman and K. S. Williams, Handbook of Estimates in the Theory of Numbers, Carleton Math. Lecture Note Series No. 14, 1975; see p. 2.1.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 285.
  • E. C. Titchmarsh, The Theory of Functions, Oxford, 1938, p. 160.
  • Terence Tao, Poincaré's Legacies, Part I, Amer. Math. Soc., 2009, see pp. 31ff for upper bounds on d(n).

Crossrefs

See A002183, A002182 for records. See A000203 for the sum-of-divisors function sigma(n).
For partial sums see A006218.
Factorizations into given number of factors: writing n = x*y (A038548, unordered, A000005, ordered), n = x*y*z (A034836, unordered, A007425, ordered), n = w*x*y*z (A007426, ordered).
Cf. A098198 (Dgf at s=2), A183030 (Dgf at s=3), A183031 (Dgf at s=3).

Programs

  • GAP
    List([1..150],n->Tau(n)); # Muniru A Asiru, Mar 05 2019
    
  • Haskell
    divisors 1 = [1]
    divisors n = (1:filter ((==0) . rem n)
                   [2..n `div` 2]) ++ [n]
    a = length . divisors
    -- James Spahlinger, Oct 07 2012
    
  • Haskell
    a000005 = product . map (+ 1) . a124010_row  -- Reinhard Zumkeller, Jul 12 2013
    
  • Julia
    function tau(n)
        i = 2; num = 1
        while i * i <= n
            if rem(n, i) == 0
                e = 0
                while rem(n, i) == 0
                    e += 1
                    n = div(n, i)
                end
                num *= e + 1
            end
            i += 1
        end
        return n > 1 ? num + num : num
    end
    println([tau(n) for n in 1:104])  # Peter Luschny, Sep 03 2023
  • Magma
    [ NumberOfDivisors(n) : n in [1..100] ]; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
    
  • Maple
    with(numtheory): A000005 := tau; [ seq(tau(n), n=1..100) ];
  • Mathematica
    Table[DivisorSigma[0, n], {n, 100}] (* Enrique Pérez Herrero, Aug 27 2009 *)
    CoefficientList[Series[(Log[1 - q] + QPolyGamma[1, q])/(q Log[q]), {q, 0, 100}], q] (* Vladimir Reshetnikov, Apr 23 2013 *)
    a[ n_] := SeriesCoefficient[ (QPolyGamma[ 1, q] + Log[1 - q]) / Log[q], {q, 0, Abs@n}]; (* Michael Somos, Apr 25 2013 *)
    a[ n_] := SeriesCoefficient[ q/(1 - q)^2 QHypergeometricPFQ[ {q, q}, {q^2, q^2}, q, q^2], {q, 0, Abs@n}]; (* Michael Somos, Mar 05 2014 *)
    a[n_] := SeriesCoefficient[q/(1 - q) QHypergeometricPFQ[{q, q}, {q^2}, q, q], {q, 0, Abs@n}] (* Mats Granvik, Apr 15 2015 *)
    With[{M=500},CoefficientList[Series[(2x)/(1-x)-Sum[x^k (1-2x^k)/(1-x^k),{k,M}],{x,0,M}],x]] (* Mamuka Jibladze, Aug 31 2018 *)
  • MuPAD
    numlib::tau (n)$ n=1..90 // Zerinvary Lajos, May 13 2008
    
  • PARI
    {a(n) = if( n==0, 0, numdiv(n))}; /* Michael Somos, Apr 27 2003 */
    
  • PARI
    {a(n) = n=abs(n); if( n<1, 0, direuler( p=2, n, 1 / (1 - X)^2)[n])}; /* Michael Somos, Apr 27 2003 */
    
  • PARI
    {a(n)=polcoeff(sum(m=1, n+1, sumdiv(m, d, (-log(1-x^(m/d) +x*O(x^n) ))^d/d!)), n)} \\ Paul D. Hanna, Aug 21 2014
    
  • Python
    from sympy import divisor_count
    for n in range(1, 20): print(divisor_count(n), end=', ') # Stefano Spezia, Nov 05 2018
    
  • Sage
    [sigma(n, 0) for n in range(1, 105)]  # Zerinvary Lajos, Jun 04 2009
    

Formula

If n is written as 2^z*3^y*5^x*7^w*11^v*... then a(n)=(z+1)*(y+1)*(x+1)*(w+1)*(v+1)*...
a(n) = 2 iff n is prime.
G.f.: Sum_{n >= 1} a(n) x^n = Sum_{k>0} x^k/(1-x^k). This is usually called THE Lambert series (see Knopp, Titchmarsh).
a(n) = A083888(n) + A083889(n) + A083890(n) + A083891(n) + A083892(n) + A083893(n) + A083894(n) + A083895(n) + A083896(n).
a(n) = A083910(n) + A083911(n) + A083912(n) + A083913(n) + A083914(n) + A083915(n) + A083916(n) + A083917(n) + A083918(n) + A083919(n).
Multiplicative with a(p^e) = e+1. - David W. Wilson, Aug 01 2001
a(n) <= 2 sqrt(n) [see Mitrinovich, p. 39, also A046522].
a(n) is odd iff n is a square. - Reinhard Zumkeller, Dec 29 2001
a(n) = Sum_{k=1..n} f(k, n) where f(k, n) = 1 if k divides n, 0 otherwise (Mobius transform of A000012). Equivalently, f(k, n) = (1/k)*Sum_{l=1..k} z(k, l)^n with z(k, l) the k-th roots of unity. - Ralf Stephan, Dec 25 2002
G.f.: Sum_{k>0} ((-1)^(k+1) * x^(k * (k + 1)/2) / ((1 - x^k) * Product_{i=1..k} (1 - x^i))). - Michael Somos, Apr 27 2003
a(n) = n - Sum_{k=1..n} (ceiling(n/k) - floor(n/k)). - Benoit Cloitre, May 11 2003
a(n) = A032741(n) + 1 = A062011(n)/2 = A054519(n) - A054519(n-1) = A006218(n) - A006218(n-1) = 1 + Sum_{k=1..n-1} A051950(k+1). - Ralf Stephan, Mar 26 2004
G.f.: Sum_{k>0} x^(k^2)*(1+x^k)/(1-x^k). Dirichlet g.f.: zeta(s)^2. - Michael Somos, Apr 05 2003
Sequence = M*V where M = A129372 as an infinite lower triangular matrix and V = ruler sequence A001511 as a vector: [1, 2, 1, 3, 1, 2, 1, 4, ...]. - Gary W. Adamson, Apr 15 2007
Sequence = M*V, where M = A115361 is an infinite lower triangular matrix and V = A001227, the number of odd divisors of n, is a vector: [1, 1, 2, 1, 2, 2, 2, ...]. - Gary W. Adamson, Apr 15 2007
Row sums of triangle A051731. - Gary W. Adamson, Nov 02 2007
Sum_{n>0} a(n)/(n^n) = Sum_{n>0, m>0} 1/(n*m). - Gerald McGarvey, Dec 15 2007
Logarithmic g.f.: Sum_{n>=1} a(n)/n * x^n = -log( Product_{n>=1} (1-x^n)^(1/n) ). - Joerg Arndt, May 03 2008
a(n) = Sum_{k=1..n} (floor(n/k) - floor((n-1)/k)). - Enrique Pérez Herrero, Aug 27 2009
a(s) = 2^omega(s), if s > 1 is a squarefree number (A005117) and omega(s) is: A001221. - Enrique Pérez Herrero, Sep 08 2009
a(n) = A048691(n) - A055205(n). - Reinhard Zumkeller, Dec 08 2009
For n > 1, a(n) = 2 + Sum_{k=2..n-1} floor((cos(Pi*n/k))^2). And floor((cos(Pi*n/k))^2) = floor(1/4 * e^(-(2*i*Pi*n)/k) + 1/4 * e^((2*i*Pi*n)/k) + 1/2). - Eric Desbiaux, Mar 09 2010, corrected Apr 16 2011
a(n) = 1 + Sum_{k=1..n} (floor(2^n/(2^k-1)) mod 2) for every n. - Fabio Civolani (civox(AT)tiscali.it), Mar 12 2010
From Vladimir Shevelev, May 22 2010: (Start)
(Sum_{d|n} a(d))^2 = Sum_{d|n} a(d)^3 (J. Liouville).
Sum_{d|n} A008836(d)*a(d)^2 = A008836(n)*Sum_{d|n} a(d). (End)
a(n) = sigma_0(n) = 1 + Sum_{m>=2} Sum_{r>=1} (1/m^(r+1))*Sum_{j=1..m-1} Sum_{k=0..m^(r+1)-1} e^(2*k*Pi*i*(n+(m-j)*m^r)/m^(r+1)). - A. Neves, Oct 04 2010
a(n) = 2*A038548(n) - A010052(n). - Reinhard Zumkeller, Mar 08 2013
Sum_{n>=1} a(n)*q^n = (log(1-q) + psi_q(1)) / log(q), where psi_q(z) is the q-digamma function. - Vladimir Reshetnikov, Apr 23 2013
a(n) = Product_{k = 1..A001221(n)} (A124010(n,k) + 1). - Reinhard Zumkeller, Jul 12 2013
a(n) = Sum_{k=1..n} A238133(k)*A000041(n-k). - Mircea Merca, Feb 18 2013
G.f.: Sum_{k>=1} Sum_{j>=1} x^(j*k). - Mats Granvik, Jun 15 2013
The formula above is obtained by expanding the Lambert series Sum_{k>=1} x^k/(1-x^k). - Joerg Arndt, Mar 12 2014
G.f.: Sum_{n>=1} Sum_{d|n} ( -log(1 - x^(n/d)) )^d / d!. - Paul D. Hanna, Aug 21 2014
2*Pi*a(n) = Sum_{m=1..n} Integral_{x=0..2*Pi} r^(m-n)( cos((m-n)*x)-r^m cos(n*x) )/( 1+r^(2*m)-2r^m cos(m*x) )dx, 0 < r < 1 a free parameter. This formula is obtained as the sum of the residues of the Lambert series Sum_{k>=1} x^k/(1-x^k). - Seiichi Kirikami, Oct 22 2015
a(n) = A091220(A091202(n)) = A106737(A156552(n)). - Antti Karttunen, circa 2004 & Mar 06 2017
a(n) = A034296(n) - A237665(n+1) [Wang, Fokkink, Fokkink]. - George Beck, May 06 2017
G.f.: 2*x/(1-x) - Sum_{k>0} x^k*(1-2*x^k)/(1-x^k). - Mamuka Jibladze, Aug 29 2018
a(n) = Sum_{k=1..n} 1/phi(n / gcd(n, k)). - Daniel Suteu, Nov 05 2018
a(k*n) = a(n)*(f(k,n)+2)/(f(k,n)+1), where f(k,n) is the exponent of the highest power of k dividing n and k is prime. - Gary Detlefs, Feb 08 2019
a(n) = 2*log(p(n))/log(n), n > 1, where p(n)= the product of the factors of n = A007955(n). - Gary Detlefs, Feb 15 2019
a(n) = (1/n) * Sum_{k=1..n} sigma(gcd(n,k)), where sigma(n) = sum of divisors of n. - Orges Leka, May 09 2019
a(n) = A001227(n)*(A007814(n) + 1) = A001227(n)*A001511(n). - Ivan N. Ianakiev, Nov 14 2019
From Richard L. Ollerton, May 11 2021: (Start)
a(n) = A038040(n) / n = (1/n)*Sum_{d|n} phi(d)*sigma(n/d), where phi = A000010 and sigma = A000203.
a(n) = (1/n)*Sum_{k=1..n} phi(gcd(n,k))*sigma(n/gcd(n,k))/phi(n/gcd(n,k)). (End)
From Ridouane Oudra, Nov 12 2021: (Start)
a(n) = Sum_{j=1..n} Sum_{k=1..j} (1/j)*cos(2*k*n*Pi/j);
a(n) = Sum_{j=1..n} Sum_{k=1..j} (1/j)*e^(2*k*n*Pi*i/j), where i^2=-1. (End)

Extensions

Incorrect formula deleted by Ridouane Oudra, Oct 28 2021

A326083 Number of subsets of {1..n} containing all of their pairwise sums <= n.

Original entry on oeis.org

1, 2, 3, 5, 7, 12, 16, 27, 37, 58, 80, 131, 171, 277, 380, 580, 785, 1250, 1655, 2616, 3516, 5344, 7257, 11353, 14931, 23204, 31379, 47511, 63778, 98681, 130503, 201357, 270038, 407429, 548090, 840171, 1110429, 1701872, 2284325, 3440337, 4601656
Offset: 0

Views

Author

Gus Wiseman, Jun 05 2019

Keywords

Comments

The summands are allowed to be equal. The case where they must be distinct is A326080. If A007865 counts sum-free sets, this sequence counts sum-closed sets. This is different from sum-full sets (A093971).
From Gus Wiseman, Jul 08 2019: (Start)
Also the number of subsets of {1..n} containing no sum of any multiset of the elements. For example, the a(0) = 1 through a(6) = 16 subsets are:
{} {} {} {} {} {} {}
{1} {1} {1} {1} {1} {1}
{2} {2} {2} {2} {2}
{3} {3} {3} {3}
{2,3} {4} {4} {4}
{2,3} {5} {5}
{3,4} {2,3} {6}
{2,5} {2,3}
{3,4} {2,5}
{3,5} {3,4}
{4,5} {3,5}
{3,4,5} {4,5}
{4,6}
{5,6}
{3,4,5}
{4,5,6}
(End)

Examples

			The a(0) = 1 through a(6) = 16 subsets:
  {}  {}   {}     {}       {}         {}           {}
      {1}  {2}    {2}      {3}        {3}          {4}
           {1,2}  {3}      {4}        {4}          {5}
                  {2,3}    {2,4}      {5}          {6}
                  {1,2,3}  {3,4}      {2,4}        {3,6}
                           {2,3,4}    {3,4}        {4,5}
                           {1,2,3,4}  {3,5}        {4,6}
                                      {4,5}        {5,6}
                                      {2,4,5}      {2,4,6}
                                      {3,4,5}      {3,4,6}
                                      {2,3,4,5}    {3,5,6}
                                      {1,2,3,4,5}  {4,5,6}
                                                   {2,4,5,6}
                                                   {3,4,5,6}
                                                   {2,3,4,5,6}
                                                   {1,2,3,4,5,6}
The a(7) = 27 subsets:
  {}  {4}  {36}  {246}  {2467}  {24567}  {234567}  {1234567}
      {5}  {45}  {356}  {3467}  {34567}
      {6}  {46}  {367}  {3567}
      {7}  {47}  {456}  {4567}
           {56}  {457}
           {57}  {467}
           {67}  {567}
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],SubsetQ[#,Select[Plus@@@Tuples[#,2],#<=n&]]&]],{n,0,10}]

Formula

For n > 0, a(n) = A103580(n) + 1.

A051026 Number of primitive subsequences of {1, 2, ..., n}.

Original entry on oeis.org

1, 2, 3, 5, 7, 13, 17, 33, 45, 73, 103, 205, 253, 505, 733, 1133, 1529, 3057, 3897, 7793, 10241, 16513, 24593, 49185, 59265, 109297, 163369, 262489, 355729, 711457, 879937, 1759873, 2360641, 3908545, 5858113, 10534337, 12701537, 25403073, 38090337, 63299265, 81044097, 162088193, 205482593, 410965185, 570487233, 855676353
Offset: 0

Views

Author

Keywords

Comments

a(n) counts all subsequences of {1, ..., n} in which no term divides any other. If n is a prime a(n) = 2*a(n-1)-1 because for each subsequence s counted by a(n-1) two different subsequences are counted by a(n): s and s,n. There is only one exception: 1,n is not a primitive subsequence because 1 divides n. For all n>1: a(n) < 2*a(n-1). - Alois P. Heinz, Mar 07 2011
Maximal primitive subsets are counted by A326077. - Gus Wiseman, Jun 07 2019

Examples

			a(4) = 7, the primitive subsequences (including the empty sequence) are: (), (1), (2), (3), (4), (2,3), (3,4).
a(5) = 13 = 2*7-1, the primitive subsequences are: (), (5), (1), (2), (2,5), (3), (3,5), (4), (4,5), (2,3), (2,3,5), (3,4), (3,4,5).
From _Gus Wiseman_, Jun 07 2019: (Start)
The a(0) = 1 through a(5) = 13 primitive (pairwise indivisible) subsets:
  {}  {}   {}   {}     {}     {}
      {1}  {1}  {1}    {1}    {1}
           {2}  {2}    {2}    {2}
                {3}    {3}    {3}
                {2,3}  {4}    {4}
                       {2,3}  {5}
                       {3,4}  {2,3}
                              {2,5}
                              {3,4}
                              {3,5}
                              {4,5}
                              {2,3,5}
                              {3,4,5}
a(n) is also the number of subsets of {1..n} containing all of their pairwise products <= n as well as any quotients of divisible elements. For example, the a(0) = 1 through a(5) = 13 subsets are:
  {}  {}   {}     {}       {}         {}
      {1}  {1}    {1}      {1}        {1}
           {1,2}  {1,2}    {1,3}      {1,3}
                  {1,3}    {1,4}      {1,4}
                  {1,2,3}  {1,2,4}    {1,5}
                           {1,3,4}    {1,2,4}
                           {1,2,3,4}  {1,3,4}
                                      {1,3,5}
                                      {1,4,5}
                                      {1,2,3,4}
                                      {1,2,4,5}
                                      {1,3,4,5}
                                      {1,2,3,4,5}
Also the number of subsets of {1..n} containing all of their multiples <= n. For example, the a(0) = 1 through a(5) = 13 subsets are:
  {}  {}   {}     {}       {}         {}
      {1}  {2}    {2}      {3}        {3}
           {1,2}  {3}      {4}        {4}
                  {2,3}    {2,4}      {5}
                  {1,2,3}  {3,4}      {2,4}
                           {2,3,4}    {3,4}
                           {1,2,3,4}  {3,5}
                                      {4,5}
                                      {2,3,4}
                                      {2,4,5}
                                      {3,4,5}
                                      {2,3,4,5}
                                      {1,2,3,4,5}
(End)
From _Gus Wiseman_, Mar 12 2024: (Start)
Also the number of subsets of {1..n} containing all divisors of the elements. For example, the a(0) = 1 through a(6) = 17 subsets are:
  {}  {}   {}     {}       {}         {}
      {1}  {1}    {1}      {1}        {1}
           {1,2}  {1,2}    {1,2}      {1,2}
                  {1,3}    {1,3}      {1,3}
                  {1,2,3}  {1,2,3}    {1,5}
                           {1,2,4}    {1,2,3}
                           {1,2,3,4}  {1,2,4}
                                      {1,2,5}
                                      {1,3,5}
                                      {1,2,3,4}
                                      {1,2,3,5}
                                      {1,2,4,5}
                                      {1,2,3,4,5}
(End)
		

References

  • Blanchet-Sadri, Francine. Algorithmic combinatorics on partial words. Chapman & Hall/CRC, Boca Raton, FL, 2008. ii+385 pp. ISBN: 978-1-4200-6092-8; 1-4200-6092-9 MR2384993 (2009f:68142). See p. 320. - N. J. A. Sloane, Apr 06 2012

Crossrefs

Programs

  • Maple
    with(numtheory):
    b:= proc(s) option remember; local n;
          n:= max(s[]);
          `if`(n<0, 1, b(s minus {n}) + b(s minus divisors(n)))
        end:
    bb:= n-> b({$2..n} minus divisors(n)):
    sb:= proc(n) option remember; `if`(n<2, 0, bb(n) + sb(n-1)) end:
    a:= n-> `if`(n=0, 1, `if`(isprime(n), 2*a(n-1)-1, 2+sb(n))):
    seq(a(n), n=0..40);  # Alois P. Heinz, Mar 07 2011
  • Mathematica
    b[s_] := b[s] = With[{n=Max[s]}, If[n < 0, 1, b[Complement[s, {n}]] + b[Complement[s, Divisors[n]]]]];
    bb[n_] := b[Complement[Range[2, n], Divisors[n]]];
    sb[n_] := sb[n] = If[n < 2, 0, bb[n] + sb[n-1]];
    a[n_] := If[n == 0, 1, If[PrimeQ[n], 2a[n-1] - 1, 2 + sb[n]]]; Table[a[n], {n, 0, 37}]
    (* Jean-François Alcover, Jul 27 2011, converted from Maple *)
    Table[Length[Select[Subsets[Range[n]], SubsetQ[#,Select[Union@@Table[#*i,{i,n}],#<=n&]]&]],{n,10}] (* Gus Wiseman, Jun 07 2019 *)
    Table[Length[Select[Subsets[Range[n]], #==Union@@Divisors/@#&]],{n,0,10}] (* Gus Wiseman, Mar 12 2024 *)

Extensions

More terms from David Wasserman, May 02 2002
a(32)-a(37) from Donovan Johnson, Aug 11 2010

A326080 Number of subsets of {1..n} containing the sum of every subset whose sum is <= n.

Original entry on oeis.org

1, 2, 4, 7, 12, 19, 31, 47, 73, 110, 168, 247, 375, 546, 817, 1193, 1769, 2552, 3791, 5445, 8012, 11517, 16899, 24144, 35391, 50427, 73614, 104984, 152656, 216802, 315689, 447473, 648813, 920163, 1332991, 1884735, 2728020, 3853437, 5568644, 7868096, 11347437
Offset: 0

Views

Author

Gus Wiseman, Jun 05 2019

Keywords

Comments

Equivalently, a(n) is the number of subsets of {1..n} containing the sum of any two distinct elements whose sum is <= n.
The summands must be distinct. The case where they are allowed to be equal is A326083.
If A151897 counts sum-free sets, this sequence counts sum-closed sets. This is different from sum-full sets (A093971).

Examples

			The a(0) = 1 through a(5) = 19 subsets:
  {}  {}   {}     {}       {}         {}
      {1}  {1}    {1}      {1}        {1}
           {2}    {2}      {2}        {2}
           {1,2}  {3}      {3}        {3}
                  {1,3}    {4}        {4}
                  {2,3}    {1,4}      {5}
                  {1,2,3}  {2,3}      {1,5}
                           {2,4}      {2,4}
                           {3,4}      {2,5}
                           {1,3,4}    {3,4}
                           {2,3,4}    {3,5}
                           {1,2,3,4}  {4,5}
                                      {1,4,5}
                                      {2,3,5}
                                      {2,4,5}
                                      {3,4,5}
                                      {1,3,4,5}
                                      {2,3,4,5}
                                      {1,2,3,4,5}
The a(6) = 31 subsets:
  {}  {1}  {1,6}  {1,5,6}  {1,4,5,6}  {1,3,4,5,6}  {1,2,3,4,5,6}
      {2}  {2,5}  {2,3,5}  {2,3,5,6}  {2,3,4,5,6}
      {3}  {2,6}  {2,4,6}  {2,4,5,6}
      {4}  {3,4}  {2,5,6}  {3,4,5,6}
      {5}  {3,5}  {3,4,5}
      {6}  {3,6}  {3,4,6}
           {4,5}  {3,5,6}
           {4,6}  {4,5,6}
           {5,6}
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],SubsetQ[#,Select[Plus@@@Subsets[#,{2}],#<=n&]]&]],{n,0,10}]
  • PARI
    a(n)={
       my(recurse(k, b)=
          if( k > n, 1,
              my(t=self()(k + 1, b + (1<Andrew Howroyd, Aug 30 2019

Extensions

Terms a(21) and beyond from Andrew Howroyd, Aug 30 2019

A326023 Number of subsets of {1..n} containing all of their integer quotients.

Original entry on oeis.org

1, 2, 3, 5, 9, 17, 25, 49, 73, 145, 217, 433, 553, 1105, 1657, 2593, 3937, 7873, 10057, 20113, 26689, 42321, 63481, 126961, 154801, 309601, 464401, 737569, 992161, 1984321, 2450881, 4901761, 6292801, 10197313, 15295969, 26241697, 32947489, 65894977, 98842465, 161587873, 205842529
Offset: 0

Views

Author

Gus Wiseman, Jun 04 2019

Keywords

Comments

These are sets that are closed under taking the quotient of two (not necessarily distinct) divisible terms.

Examples

			The a(0) = 1 through a(5) = 17 subsets:
  {}  {}   {}     {}       {}         {}
      {1}  {1}    {1}      {1}        {1}
           {1,2}  {1,2}    {1,2}      {1,2}
                  {1,3}    {1,3}      {1,3}
                  {1,2,3}  {1,4}      {1,4}
                           {1,2,3}    {1,5}
                           {1,2,4}    {1,2,3}
                           {1,3,4}    {1,2,4}
                           {1,2,3,4}  {1,2,5}
                                      {1,3,4}
                                      {1,3,5}
                                      {1,4,5}
                                      {1,2,3,4}
                                      {1,2,3,5}
                                      {1,2,4,5}
                                      {1,3,4,5}
                                      {1,2,3,4,5}
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],SubsetQ[#,Select[Divide@@@Tuples[#,2],IntegerQ]]&]],{n,0,10}]

Formula

For n > 0, a(n) = A326078(n) + 1.

Extensions

Terms a(21) and beyond from Andrew Howroyd, Aug 30 2019

A295235 Numbers k such that the positions of the ones in the binary representation of k are in arithmetic progression.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 24, 28, 30, 31, 32, 33, 34, 36, 40, 42, 48, 56, 60, 62, 63, 64, 65, 66, 68, 72, 73, 80, 84, 85, 96, 112, 120, 124, 126, 127, 128, 129, 130, 132, 136, 144, 146, 160, 168, 170, 192, 224, 240, 248
Offset: 1

Views

Author

Rémy Sigrist, Nov 18 2017

Keywords

Comments

Also numbers k of the form Sum_{b=0..h-1} 2^(i+j*b) for some h >= 0, i >= 0, j > 0 (in fact, h = A000120(k), and if k > 0, i = A007814(k)).
There is a simple bijection between the finite sets of nonnegative integers in arithmetic progression and the terms of this sequence: s -> Sum_{i in s} 2^i; the term 0 corresponds to the empty set.
For any n > 0, A054519(n) gives the numbers of terms with n+1 digits in binary representation.
For any n >= 0, n is in the sequence iff 2*n is in the sequence.
For any n > 0, A000695(a(n)) is in the sequence.
The first prime numbers in the sequence are: 2, 3, 5, 7, 17, 31, 73, 127, 257, 8191, 65537, 131071, 262657, 524287, ...
This sequence contains the following sequences: A000051, A000079, A000225, A000668, A002450, A019434, A023001, A048645.
For any k > 0, 2^k - 2, 2^k - 1, 2^k, 2^k + 1 and 2^k + 2 are in the sequence (e.g., 14, 15, 16, 17, and 18).
Every odd term is a binary palindrome (and thus belongs to A006995).
Odd terms are A064896. - Robert Israel, Nov 20 2017

Examples

			The binary representation of the number 42 is "101010" and has ones evenly spaced, hence 42 appears in the sequence.
The first terms, alongside their binary representations, are:
   n  a(n)  a(n) in binary
  --  ----  --------------
   1    0           0
   2    1           1
   3    2          10
   4    3          11
   5    4         100
   6    5         101
   7    6         110
   8    7         111
   9    8        1000
  10    9        1001
  11   10        1010
  12   12        1100
  13   14        1110
  14   15        1111
  15   16       10000
  16   17       10001
  17   18       10010
  18   20       10100
  19   21       10101
  20   24       11000
		

Crossrefs

Cf. A029931, A048793 (binary indices triangle), A070939, A291166, A325328 (prime indices rather than binary indices), A326669, A326675.

Programs

  • Maple
    f:= proc(d) local i,j,k;
      op(sort([seq(seq(add(2^(d-j*k),k=0..m),m=1..d/j),j=1..d),2^(d+1)]))
    end proc:
    0,1,seq(f(d),d=0..10); # Robert Israel, Nov 20 2017
  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Select[Range[100],SameQ@@Differences[bpe[#]]&] (* Gus Wiseman, Jul 22 2019 *)
  • PARI
    is(n) = my(h=hammingweight(n)); if(h<3, return(1), my(i=valuation(n,2),w=#binary(n)); if((w-i-1)%(h-1)==0, my(j=(w-i-1)/(h-1)); return(sum(k=0,h-1,2^(i+j*k))==n), return(0)))

A364755 Number of subsets of {1..n} containing n but not containing the sum of any two distinct elements.

Original entry on oeis.org

0, 1, 2, 3, 6, 9, 15, 24, 41, 60, 99, 149, 236, 355, 552, 817, 1275, 1870, 2788, 4167, 6243, 9098, 13433, 19718, 28771, 42137, 60652, 88603, 127555, 185200, 261781, 382931, 541022, 783862, 1096608, 1595829, 2217467, 3223064, 4441073, 6465800, 8893694
Offset: 0

Views

Author

Gus Wiseman, Aug 11 2023

Keywords

Examples

			The subset S = {1,3,6,8} has pair-sums {4,7,9,11,14}, which are disjoint from S, so it is counted under a(8).
The a(1) = 1 through a(6) = 15 subsets:
  {1}  {2}    {3}    {4}      {5}      {6}
       {1,2}  {1,3}  {1,4}    {1,5}    {1,6}
              {2,3}  {2,4}    {2,5}    {2,6}
                     {3,4}    {3,5}    {3,6}
                     {1,2,4}  {4,5}    {4,6}
                     {2,3,4}  {1,2,5}  {5,6}
                              {1,3,5}  {1,2,6}
                              {2,4,5}  {1,3,6}
                              {3,4,5}  {1,4,6}
                                       {2,3,6}
                                       {2,5,6}
                                       {3,4,6}
                                       {3,5,6}
                                       {4,5,6}
                                       {3,4,5,6}
		

Crossrefs

Partial sums are A085489(n) - 1, complement counted by A364534.
With re-usable parts we have A288728.
The complement with n is counted by A364756, first differences of A088809.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],MemberQ[#,n]&&Intersection[#,Total/@Subsets[#,{2}]]=={}&]],{n,0,10}]

Formula

First differences of A085489.

Extensions

a(21) onwards added (using A085489) by Andrew Howroyd, Jan 13 2024

A326079 Number of subsets of {1..n} containing all of their integer quotients > 1.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 48, 96, 144, 288, 432, 864, 1104, 2208, 3312, 5184, 7872, 15744, 20112, 40224, 53376, 84640, 126960, 253920, 309600, 619200, 928800, 1475136, 1984320, 3968640, 4901760, 9803520, 12585600, 20394624, 30591936, 52483392, 65894976, 131789952, 197684928, 323175744, 411685056
Offset: 0

Views

Author

Gus Wiseman, Jun 05 2019

Keywords

Comments

These sets are closed under taking the quotient of two distinct divisible terms.

Examples

			The a(6) = 48 subsets:
  {}  {1}  {1,2}  {1,2,3}  {1,2,3,4}  {1,2,3,4,5}  {1,2,3,4,5,6}
      {2}  {1,3}  {1,2,4}  {1,2,3,5}  {1,2,3,4,6}
      {3}  {1,4}  {1,2,5}  {1,2,3,6}  {1,2,3,5,6}
      {4}  {1,5}  {1,3,4}  {1,2,4,5}  {2,3,4,5,6}
      {5}  {1,6}  {1,3,5}  {1,3,4,5}
      {6}  {2,3}  {1,4,5}  {1,4,5,6}
           {2,4}  {1,4,6}  {2,3,4,5}
           {2,5}  {1,5,6}  {2,3,4,6}
           {3,4}  {2,3,4}  {2,3,5,6}
           {3,5}  {2,3,5}
           {4,5}  {2,3,6}
           {4,6}  {2,4,5}
           {5,6}  {3,4,5}
                  {4,5,6}
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],SubsetQ[#,Divide@@@Select[Tuples[#,2],UnsameQ@@#&&Divisible@@#&]]&]],{n,0,10}]

Formula

For n > 0, a(n) = 2 * A326078(n) = 2 * (A326023(n) - 1).

Extensions

Terms a(21) and beyond from Andrew Howroyd, Aug 30 2019
Showing 1-10 of 23 results. Next