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

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

A005238 Numbers k such that k, k+1 and k+2 have the same number of divisors.

Original entry on oeis.org

33, 85, 93, 141, 201, 213, 217, 230, 242, 243, 301, 374, 393, 445, 603, 633, 663, 697, 902, 921, 1041, 1105, 1137, 1261, 1274, 1309, 1334, 1345, 1401, 1641, 1761, 1832, 1837, 1885, 1893, 1924, 1941, 1981, 2013, 2054, 2101, 2133, 2181, 2217, 2264, 2305
Offset: 1

Views

Author

Keywords

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.
  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 33, pp. 12, Ellipses, Paris 2008.
  • R. K. Guy, Unsolved Problems in Number Theory, B18.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a005238 n = a005238_list !! (n-1)
    a005238_list = map (+ 1) $ elemIndices 0 $ zipWith (+) ds $ tail ds where
       ds = map abs $ zipWith (-) (tail a000005_list) a000005_list
    -- Reinhard Zumkeller, Oct 03 2012
    
  • Mathematica
    Select[Range[2500],DivisorSigma[0,#]==DivisorSigma[0,#+1] == DivisorSigma[ 0,#+2]&] (* Harvey P. Dale, Nov 12 2012 *)
    Flatten[Position[Partition[DivisorSigma[0,Range[2500]],3,1],{x_,x_,x_}]] (* Harvey P. Dale, Jul 06 2015 *)
    SequencePosition[DivisorSigma[0,Range[2500]],{x_,x_,x_}][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 03 2017 *)
  • PARI
    is(n)=my(d=numdiv(n)); numdiv(n+1)==d && numdiv(n+2)==d \\ Charles R Greathouse IV, Feb 06 2017

Extensions

More terms from Olivier Gérard

A307704 Expansion of (1/(1 - x)) * Sum_{k>=1} (-x)^k/(1 - (-x)^k).

Original entry on oeis.org

-1, 1, -1, 2, 0, 4, 2, 6, 3, 7, 5, 11, 9, 13, 9, 14, 12, 18, 16, 22, 18, 22, 20, 28, 25, 29, 25, 31, 29, 37, 35, 41, 37, 41, 37, 46, 44, 48, 44, 52, 50, 58, 56, 62, 56, 60, 58, 68, 65, 71, 67, 73, 71, 79, 75, 83, 79, 83, 81, 93, 91, 95, 89, 96, 92, 100, 98, 104, 100, 108
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 22 2019

Keywords

Crossrefs

Cf. A001620 (gamma), A002162.

Programs

  • Mathematica
    nmax = 70; Rest[CoefficientList[Series[1/(1 - x) Sum[(-x)^k/(1 - (-x)^k), {k, 1, nmax}], {x, 0, nmax}], x]]
    Table[Sum[(-1)^k DivisorSigma[0, k], {k, 1, n}], {n, 1, 70}]
    Accumulate[Array[(-1)^#*DivisorSigma[0, #] &, 70]] (* Amiram Eldar, Oct 14 2022 *)

Formula

a(n) = Sum_{k=1..n} (-1)^k*A000005(k).
a(n) = n*log(n)/2 + (gamma - log(2) - 1/2)*n + O(n^(131/416 + eps)) (Tóth, 2017). - Amiram Eldar, Oct 14 2022

A055927 Numbers k such that k + 1 has one more divisor than k.

Original entry on oeis.org

1, 3, 9, 15, 25, 63, 121, 195, 255, 361, 483, 729, 841, 1443, 3363, 3481, 3721, 5041, 6241, 10201, 15625, 17161, 18224, 19321, 24963, 31683, 32761, 39601, 58564, 59049, 65535, 73441, 88208, 110889, 121801, 143641, 145923, 149769, 167281
Offset: 1

Views

Author

Labos Elemer, Jul 21 2000

Keywords

Comments

Numbers k such that d(k+1) - d(k) = 1, where d(k) is A000005(k), the number of divisors.
Numbers k such that A049820(k) = A049820(k+1). - Jaroslav Krizek, Feb 10 2014
Numbers k such that A051950(k+1) = 1. - Danny Rorabaugh, Oct 05 2017

Examples

			a(4) = 15, as 15 has 4 and 16 has 5 divisors. a(6) = 63, as 63 and 64 have 6 and 7 divisors respectively.
		

Crossrefs

Numbers where repetition occurs in A049820.

Programs

  • Mathematica
    Select[ Range[ 200000], DivisorSigma[0, # ] + 1 == DivisorSigma[0, # + 1] &]
    Position[Differences[DivisorSigma[0,Range[170000]]],1]//Flatten (* Harvey P. Dale, Jul 06 2025 *)
  • PARI
    for(n=1,1000,if(numdiv(n+1)-numdiv(n)==1,print1(n,", "))); /* Joerg Arndt, Apr 09 2011 */

Extensions

More terms from David W. Wilson, Sep 06 2000, who remarks that every element is of form n^2 or n^2 - 1.

A341062 Sequence whose partial sums give A000005.

Original entry on oeis.org

1, 1, 0, 1, -1, 2, -2, 2, -1, 1, -2, 4, -4, 2, 0, 1, -3, 4, -4, 4, -2, 0, -2, 6, -5, 1, 0, 2, -4, 6, -6, 4, -2, 0, 0, 5, -7, 2, 0, 4, -6, 6, -6, 4, 0, -2, -2, 8, -7, 3, -2, 2, -4, 6, -4, 4, -4, 0, -2, 10, -10, 2, 2, 1, -3, 4, -6, 4, -2, 4, -6, 10, -10, 2, 2, 0, -2, 4, -6, 8, -5, -1, -2, 10, -8, 0, 0, 4, -6, 10
Offset: 1

Views

Author

Omar E. Pol, Feb 04 2021

Keywords

Comments

Essentially a duplicate of A051950.
Convolved with A000041 gives A138137.
Convolved with A000027 gives the nonzero terms of A006218.
Convolved with A000070 gives the nonzero terms of A006128.
Convolved with A014153 gives the nonzero terms of A284870.
Convolved with A036469 gives the nonzero terms of A305082.
Convolved with the nonzero terms of A006218 gives A055507.
Convolved with the nonzero terms of A000217 gives the nonzero terms of A078567.

Crossrefs

Programs

  • Mathematica
    Join[{1}, Differences[Table[DivisorSigma[0, n], {n, 1, 90}]]] (* Amiram Eldar, Feb 06 2021 *)

Formula

a(n) = A051950(n) for n > 1.

A361897 Leading terms of the rows of the array in A362450; or, Gilbreath transform of tau (A000005).

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0
Offset: 1

Views

Author

Wayman Eduardo Luy and Robert G. Wilson v, Mar 28 2023

Keywords

Comments

Conjecture: All terms are either 0 or 1. Verified to a(10^7).
Inspired by Gilbreath's conjecture, A036262.
Using the terminology of A362451, this is the Gilbreath transform of tau (A000005). - N. J. A. Sloane, May 05 2023

Examples

			Table begins (conjecture is leading terms are 0 or 1):
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 ...
 1 0 1 1 2 2 2 1 1 2 4 4 2 0 1 3 4 4 4 2 0 2 6 5 1 0 2 4 6 6 4 2 0 0 5 7 2 0 ...
  1 1 0 1 0 0 1 0 1 2 0 2 2 1 2 1 0 0 2 2 2 4 1 4 1 2 2 2 0 2 2 2 0 5 2 5 2 4 ...
   0 1 1 1 0 1 1 1 1 2 2 0 1 1 1 1 0 2 0 0 2 3 3 3 1 0 0 2 2 0 0 2 5 3 3 3 2 ...
    1 0 0 1 1 0 0 0 1 0 2 1 0 0 0 1 2 2 0 2 1 0 0 2 1 0 2 0 2 0 2 3 2 0 0 1 0 ...
     1 0 1 0 1 0 0 1 1 2 1 1 0 0 1 1 0 2 2 1 1 0 2 1 1 2 2 2 2 2 1 1 2 0 1 1 ...
      1 1 1 1 1 0 1 0 1 1 0 1 0 1 0 1 2 0 1 0 1 2 1 0 1 0 0 0 0 1 0 1 2 1 0 1 ...
       0 0 0 0 1 1 1 1 0 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 ...
        0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 ...
         0 0 1 1 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 ...
          0 1 0 1 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 0 1 1 0 1 0 0 0 0 0 1 ...
           1 1 1 1 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 1 0 1 1 1 0 0 0 0 1 ...
etc.
...
The first two rows are A000005, abs(A051950). The full table, read by antidiagonals, is A362450.
		

Crossrefs

See also A001659 (if don't use absolute values).

Programs

  • Maple
    N:= 200: # for a(1) to a(N)
    L:= [seq(numtheory:-tau(n),n=1..N)]:
    for i from 1 to 105 do
      R[i]:= L[1];
      L:= map(abs,L[2..-1]-L[1..-2])
    od:
    seq(R[i],i=1..M); # Robert Israel, May 07 2023
  • Mathematica
    a[n_] := NestWhile[ Abs@ Differences@ # &, Table[ DivisorSigma[0, m], {m, n}], Length[##] > 1 &][[1]]; Array[a, 105]
    (* or *)
    mx = 105; lst = {}; k = 0; d = Array[ DivisorSigma[0, #] &, mx]; While[k < mx, AppendTo[lst, d[[1]]]; d = Abs@ Differences@ d; k++]; lst
    (* or *)
    A361897[nmax_]:=Module[{d=DivisorSigma[0,Range[nmax]]},Join[{1},Table[First[d=Abs[Differences[d]]],nmax-1]]];A361897[200] (* Paolo Xausa, May 07 2023 *)
  • PARI
    lista(nn) = my(v=apply(numdiv, [1..nn]), list = List(), nb=nn); listput(list, v[1]); for (n=2, nn, nb--; my(w = vector(nb, k, abs(v[k+1]-v[k]))); listput(list, w[1]); v = w;); Vec(list);
    lista(200) \\ Michel Marcus, Mar 29 2023

Extensions

Edited by N. J. A. Sloane, Apr 30 2023

A169834 Numbers k such that d(k-1) = d(k) = d(k+1).

Original entry on oeis.org

34, 86, 94, 142, 202, 214, 218, 231, 243, 244, 302, 375, 394, 446, 604, 634, 664, 698, 903, 922, 1042, 1106, 1138, 1262, 1275, 1310, 1335, 1346, 1402, 1642, 1762, 1833, 1838, 1886, 1894, 1925, 1942, 1982, 2014, 2055, 2102, 2134, 2182, 2218, 2265, 2306, 2344, 2362
Offset: 1

Views

Author

N. J. A. Sloane, Jun 02 2010

Keywords

Crossrefs

Programs

  • Haskell
    a169834 n = a169834_list !! (n-1)
    a169834_list = f a051950_list [0..] where
       f (0:0:ws) (x:y:zs) = y : f (0:ws) (y:zs)
       f (:v:ws) (:y:zs) = f (v:ws) (y:zs)
    -- Reinhard Zumkeller, Aug 31 2014
    
  • Maple
    q:= n-> is(nops(map(numtheory[tau], {$n-1..n+1}))=1):
    select(q, [$1..3000])[];  # Alois P. Heinz, Jun 24 2021
  • Mathematica
    d[n_] := DivisorSigma[0, n];
    samedQ[n_] := d[n-1] == d[n] == d[n+1];
    Select[Range[3000], samedQ] (* Jean-François Alcover, Aug 01 2018 *)
    1 + Flatten@Position[Differences@#&/@Partition[DivisorSigma[0, Range@3000], 3, 1], {0, 0}] (* Hans Rudolf Widmer, Feb 02 2023 *)
  • Python
    from sympy import divisor_count as d
    def ok(n): return d(n-1) == d(n) == d(n+1)
    print(list(filter(ok, range(1, 2400)))) # Michael S. Branicky, Jun 24 2021

Formula

a(n) = A005238(n) + 1. - Jon Maiga / Georg Fischer, Jun 24 2021

A286255 Compound filter: a(n) = P(A046523(n), A046523(1+n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

2, 5, 12, 14, 23, 27, 38, 63, 40, 27, 80, 90, 23, 61, 216, 152, 80, 90, 80, 148, 61, 27, 302, 375, 40, 84, 179, 90, 467, 495, 530, 698, 61, 61, 826, 702, 23, 61, 412, 324, 467, 495, 80, 265, 148, 27, 1178, 1323, 109, 148, 142, 90, 302, 430, 412, 430, 61, 27, 1832, 1890, 23, 142, 2787, 2410, 601, 495, 80, 148, 601, 495, 2630, 2700, 23, 142, 265, 148, 601, 495, 1178
Offset: 1

Views

Author

Antti Karttunen, May 07 2017

Keywords

Crossrefs

Cf. A005383 (after its initial term 3, gives the positions of 23's in this sequence).
Cf. A051950 (one of the matches not matched by A046523 alone).

Programs

  • PARI
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    A286255(n) = (2 + ((A046523(n)+A046523(1+n))^2) - A046523(n) - 3*A046523(1+n))/2;
    for(n=1, 10000, write("b286255.txt", n, " ", A286255(n)));
    
  • Python
    from sympy import factorint
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a(n): return T(a046523(n), a046523(n + 1)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A286255 n) (* (/ 1 2) (+ (expt (+ (A046523 n) (A046523 (+ 1 n))) 2) (- (A046523 n)) (- (* 3 (A046523 (+ 1 n)))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A046523(n)+A046523(1+n))^2) - A046523(n) - 3*A046523(1+n)).

A230115 Numbers n such that tau(n+1) - tau(n) = 2; where tau(n) = the number of divisors of n (A000005).

Original entry on oeis.org

5, 7, 13, 27, 37, 51, 61, 62, 73, 74, 91, 115, 123, 146, 153, 157, 164, 187, 188, 193, 206, 235, 245, 267, 274, 277, 278, 284, 291, 313, 355, 356, 362, 369, 386, 397, 403, 411, 421, 422, 423, 425, 427, 428, 451, 457, 538, 541, 605, 613, 637, 657, 661, 667, 673
Offset: 1

Views

Author

Jaroslav Krizek, Oct 09 2013

Keywords

Comments

Numbers n such that A051950(n+1) = 2.
Numbers n such that A049820(n) - A049820(n+1) = 1.
Sequence of starts of first run of n (n>=2) consecutive integers m_1, m_2, ..., m_n such that tau(m_k) - tau(m_k-1) = 2, for all k=n...2: 5, 61, 421, ... (a(5) > 100000); example for n=4: tau(421) = 2, tau(422) = 4, tau(423) = 6, tau(424) = 8.

Examples

			Number 7 is in sequence because tau(8) - tau(7) = 4 - 2 = 2.
		

Crossrefs

Cf. A000005, A055927 (numbers n such that tau(n+1) - tau(n) = 1).
Subsequence of A162318. - Michel Marcus, Mar 26 2017

Programs

  • Mathematica
    Select[ Range[ 50000], DivisorSigma[0, # ] + 2 == DivisorSigma[0, # + 1] &]
    Flatten[Position[Partition[DivisorSigma[0,Range[700]],2,1],? (#[[2]]- #[[1]] == 2&),{1},Heads->False]] (* _Harvey P. Dale, Aug 03 2014 *)
  • PARI
    isok(n) = (numdiv(n+1) - numdiv(n)) == 2; \\ Michel Marcus, Mar 26 2017
    
  • Python
    from sympy.ntheory import divisor_count
    [n for n in range(1000) if divisor_count(n + 1) - divisor_count(n) == 2] # Indranil Ghosh, Mar 26 2017

A230653 Numbers k such that tau(k+1) - tau(k) = 3, where tau(k) = the number of divisors of k (A000005).

Original entry on oeis.org

49, 99, 1023, 1681, 1935, 2499, 8649, 9603, 20449, 21903, 23715, 29583, 30975, 38024, 43263, 58563, 60515, 71824, 74528, 110223, 130321, 136899, 145924, 150543, 154449, 165649, 181475, 216224, 224675, 233288, 243049, 256035, 258063, 265225, 294849, 300303
Offset: 1

Views

Author

Jaroslav Krizek, Oct 27 2013

Keywords

Comments

Numbers k such that A051950(k+1) = 3.
Numbers k such that A049820(k) - A049820(k+1) = 2.
k or k+1 is a perfect square. - David A. Corneth, Feb 16 2024

Examples

			99 is in the sequence because tau(100) - tau(99) = 9 - 6 = 3.
		

Crossrefs

Cf. A055927 (numbers n such that tau(n+1) - tau(n) = 1), A230115 (numbers n such that tau(n+1) - tau(n) = 2), A000005.

Programs

  • Mathematica
    Select[ Range[ 50000], DivisorSigma[0, # ] + 3 == DivisorSigma[0, # + 1] &]
    Position[Differences[DivisorSigma[0,Range[300400]]],3]//Flatten (* Harvey P. Dale, Jun 30 2022 *)
  • PARI
    isok(n) = numdiv(n+1) - numdiv(n) == 3; \\ Michel Marcus, Oct 27 2013
    
  • Python
    from sympy import divisor_count as tau
    from itertools import count, islice
    def agen(): # generator of terms, using comment by David A. Corneth
        for m in count(1):
            mm = m*m
            tmm = tau(mm)
            if tmm - tau(mm-1) == 3: yield mm-1
            if tau(mm+1) - tmm == 3: yield mm
    print(list(islice(agen(), 36))) # Michael S. Branicky, Feb 16 2024

Extensions

More terms from Michel Marcus, Oct 27 2013
Showing 1-10 of 28 results. Next