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

A018892 Number of ways to write 1/n as a sum of exactly 2 unit fractions.

Original entry on oeis.org

1, 2, 2, 3, 2, 5, 2, 4, 3, 5, 2, 8, 2, 5, 5, 5, 2, 8, 2, 8, 5, 5, 2, 11, 3, 5, 4, 8, 2, 14, 2, 6, 5, 5, 5, 13, 2, 5, 5, 11, 2, 14, 2, 8, 8, 5, 2, 14, 3, 8, 5, 8, 2, 11, 5, 11, 5, 5, 2, 23, 2, 5, 8, 7, 5, 14, 2, 8, 5, 14, 2, 18, 2, 5, 8, 8, 5, 14, 2, 14, 5, 5, 2, 23, 5, 5, 5, 11, 2, 23, 5, 8, 5, 5, 5, 17, 2, 8, 8
Offset: 1

Views

Author

Keywords

Comments

Number of elements in the set {(x,y): x|n, y|n, x<=y, gcd(x,y)=1}. Number of divisors of n^2 less than or equal to n. - Vladeta Jovovic, May 03 2002
Equivalently, number of pairs (x,y) such that lcm(x,y)=n. - Benoit Cloitre, May 16 2002
Also, number of right triangles with an integer hypotenuse and height n. - Reinhard Zumkeller, Jul 10 2002
The triangles are to be considered as resting on their hypotenuse, with the height measured to the right angle. - Franklin T. Adams-Watters, Feb 19 2015
a(n) >= 2 for n>=2 because of the identities 1/n = 1/(2*n) + 1/(2*n) = 1/(n+1) + 1/(n*(n+1)). - Lekraj Beedassy, May 04 2004
a(n) is the number of divisors of n^2 that are <= n; e.g., a(12) counts these 8 divisors of 12: 1,2,3,4,6,8,9,12. - Clark Kimberling, Apr 21 2019

Examples

			n=1: 1/1 = 1/2 + 1/2.
n=2: 1/2 = 1/4 + 1/4 = 1/3 + 1/6.
n=3: 1/3 = 1/6 + 1/6 = 1/4 + 1/12.
		

References

  • K. S. Brown, Posting to netnews group sci.math, Aug 17 1996.
  • L. E. Dickson, History of The Theory of Numbers, Vol. 2 p. 690, Chelsea NY 1923.
  • A. M. and I. M. Yaglom, Challenging Mathematical Problems With Elementary Solutions, Vol. 1, Dover, N.Y., 1987, pp. 8 and 60, Problem 19.

Crossrefs

Programs

  • Haskell
    a018892 n = length [d | d <- [1..n], n^2 `mod` d == 0]
    -- Reinhard Zumkeller, Jan 08 2012
    
  • Mathematica
    f[j_, n_] := (Times @@ (j(Last /@ FactorInteger[n]) + 1) + j - 1)/j; Table[f[2, n], {n, 96}] (* Robert G. Wilson v, Aug 03 2005 *)
    a[n_] := (DivisorSigma[0, n^2] + 1)/2; Table[a[n], {n, 1, 99}](* Jean-François Alcover, Dec 19 2011, after Vladeta Jovovic *)
  • PARI
    A018892(n)=(numdiv(n^2)+1)/2 \\ M. F. Hasler, Dec 30 2007
    
  • PARI
    A018892s(n)=local(t=divisors(n^2));vector((#t+1)/2,i,[n+t[i],n+n^2/t[i]]) /* show solutions */ \\ M. F. Hasler, Dec 30 2007
    
  • PARI
    a(n)=sumdiv(n,d,sum(i=1,d,lcm(d,i)==n)) \\ Charles R Greathouse IV, Apr 08 2012
    
  • Python
    from math import prod
    from sympy import factorint
    def A018892(n): return prod((a<<1)+1 for a in factorint(n).values())+1>>1 # Chai Wah Wu, Aug 20 2023

Formula

If n = (p1^a1)(p2^a2)...(pt^at), a(n) = ((2*a1 + 1)(2*a2 + 1) ... (2*at + 1) + 1)/2.
a(n) = (tau(n^2)+1)/2. - Vladeta Jovovic, May 03 2002
a(n) = A063647(n)+1 = A046079(2*n)+1. - Lekraj Beedassy, Dec 01 2003
a(n) = Sum_{d|n} phi(2^omega(d)), where phi is A000010 and omega is A001221. - Enrique Pérez Herrero, Apr 13 2012
a(n) = A000005(n) + A089233(n). - James Spahlinger, Feb 16 2016
a(n) = n + Sum_{i=1..n} sign(n^2 mod -i). - Wesley Ivan Hurt, Apr 07 2021
a(n) = Sum_{d|n} mu(n/d)*A184389(d). - Ridouane Oudra, Feb 22 2022
Sum_{k=1..n} a(k) ~ (n/(2*zeta(2)))*(log(n)^2/2 + log(n)*(3*gamma - 1) + 1 - 3*gamma + 3*gamma^2 - 3*gamma_1 + zeta(2) + (2 - 6*gamma - 2*log(n))*zeta'(2)/zeta(2) + (2*zeta'(2)/zeta(2))^2 - 2*zeta''(2)/zeta(2)), where gamma is Euler's constant (A001620) and gamma_1 is the first Stieltjes constant (A082633). - Amiram Eldar, Oct 03 2024

Extensions

More terms from David W. Wilson, Sep 15 1996
First example corrected by Jason Orendorff (jason.orendorff(AT)gmail.com), Jan 02 2009
Incorrect Mathematica program deleted by N. J. A. Sloane, Jul 08 2009

A035116 a(n) = tau(n)^2, where tau(n) = A000005(n).

Original entry on oeis.org

1, 4, 4, 9, 4, 16, 4, 16, 9, 16, 4, 36, 4, 16, 16, 25, 4, 36, 4, 36, 16, 16, 4, 64, 9, 16, 16, 36, 4, 64, 4, 36, 16, 16, 16, 81, 4, 16, 16, 64, 4, 64, 4, 36, 36, 16, 4, 100, 9, 36, 16, 36, 4, 64, 16, 64, 16, 16, 4, 144, 4, 16
Offset: 1

Views

Author

Keywords

References

  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 59.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Theorem 304.

Crossrefs

Programs

Formula

Dirichlet g.f.: zeta(s)^4/zeta(2s).
tau(n)^2 = Sum_{d|n} tau(d^2), Dirichlet convolution of A048691 and A000012 (i.e.: inverse Mobius transform of A048691).
Multiplicative with a(p^e) = (e+1)^2. - Vladeta Jovovic, Dec 03 2001
G.f.: Sum_{n>=1} A000005(n^2)*x^n/(1-x^n). - Mircea Merca, Feb 25 2014
a(n) = A066446(n) + A184389(n). - Reinhard Zumkeller, Sep 08 2015
Let b(n), n > 0, be the Dirichlet inverse of a(n). Then b(n) is multiplicative with b(p^e) = (-1)^e*(Sum_{i=0..e} binomial(3,i)) for prime p and e >= 0, where binomial(n,k)=0 if n < k; abs(b(n)) is multiplicative and has the Dirichlet g.f.: (zeta(s))^4/(zeta(2*s))^3. - Werner Schulte, Feb 07 2021

Extensions

Additional comments from Vladeta Jovovic, Apr 29 2001

A273102 Difference table of the divisors of the positive integers.

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 2, 1, 2, 4, 1, 2, 1, 1, 5, 4, 1, 2, 3, 6, 1, 1, 3, 0, 2, 2, 1, 7, 6, 1, 2, 4, 8, 1, 2, 4, 1, 2, 1, 1, 3, 9, 2, 6, 4, 1, 2, 5, 10, 1, 3, 5, 2, 2, 0, 1, 11, 10, 1, 2, 3, 4, 6, 12, 1, 1, 1, 2, 6, 0, 0, 1, 4, 0, 1, 3, 1, 2, 1, 1, 13, 12, 1, 2, 7, 14, 1, 5, 7, 4, 2, -2, 1, 3, 5, 15, 2, 2, 10, 0, 8, 8
Offset: 1

Views

Author

Omar E. Pol, May 15 2016

Keywords

Comments

This is an irregular tetrahedron T(n,j,k) read by rows in which the slice n lists the elements of the rows of the difference triangle of the divisors of n (including the divisors of n).
The first row of the slice n is also the n-th row of the triangle A027750.
The bottom entry of the slice n is A187202(n).
The sum of the elements of the slice n is A273103(n).
For another version see A273104, from which differs at a(92).
From David A. Corneth, May 20 2016: (Start)
Each element of the difference table of the divisors of n can be expressed in terms of the divisors of n and use of Pascal's triangle. Suppose a, b, c, d and e are the divisors of n. Then the difference table is as follows (rotated for ease of reading):
a
. . b-a
b . . . . c-2b+a
. . c-b . . . . . d-3c+3b-a
c . . . . d-2c+b . . . . . . e-4d+6c-4b+a
. . d-c . . . . . e-3d+3c-b
d . . . . e-2d+c
. . e-d
e
From here we can see Pascal's triangle occurring. Induction can be used to show that it's the case in general.
(End)

Examples

			For n = 18 the divisors of 18 are 1, 2, 3, 6, 9, 18, so the difference triangle of the divisors of 18 is
  1 . 2 . 3 . 6 . 9 . 18
    1 . 1 . 3 . 3 . 9
      0 . 2 . 0 . 6
        2 .-2 . 6
         -4 . 8
           12
and the 18th slice is
  1, 2, 3, 6, 9, 18;
  1, 1, 3, 3, 9;
  0, 2, 0, 6;
  2,-2, 6;
  -4, 8;
  12;
The tetrahedron begins:
  1;
  1, 2;
  1;
  1, 3;
  2;
  1, 2, 4;
  1, 2;
  1;
  ...
This is also an irregular triangle T(n,r) read by rows in which row n lists the difference triangle of the divisors of n flattened. Row lengths are the terms of A184389. Row sums give A273103.
Triangle begins:
  1;
  1, 2, 1;
  1, 3, 2;
  1, 2, 4, 1, 2, 1;
  ...
		

Crossrefs

Programs

  • Mathematica
    Table[Drop[FixedPointList[Differences, Divisors@ n], -2], {n, 15}] // Flatten (* Michael De Vlieger, May 16 2016 *)
  • Sage
    def A273102_DTD(n): # DTD = Difference Table of Divisors
        D = divisors(n)
        T = matrix(ZZ, len(D))
        for (m, d) in enumerate(D):
            T[0, m] = d
            for k in range(m-1, -1, -1) :
                T[m-k, k] = T[m-k-1, k+1] - T[m-k-1, k]
        return [T.row(k)[:len(D)-k] for k in range(len(D))]
    # Keeps the rows of the DTD, for instance
    # A273102_DTD(18)[1] = 1,1,3,3,9 (see the example above).
    for n in range(1,19): print(A273102_DTD(n)) # Peter Luschny, May 18 2016

A066446 Number of unordered divisor pairs of n.

Original entry on oeis.org

0, 1, 1, 3, 1, 6, 1, 6, 3, 6, 1, 15, 1, 6, 6, 10, 1, 15, 1, 15, 6, 6, 1, 28, 3, 6, 6, 15, 1, 28, 1, 15, 6, 6, 6, 36, 1, 6, 6, 28, 1, 28, 1, 15, 15, 6, 1, 45, 3, 15, 6, 15, 1, 28, 6, 28, 6, 6, 1, 66, 1, 6, 15, 21, 6, 28, 1, 15, 6, 28, 1, 66, 1, 6, 15, 15, 6, 28, 1, 45, 10, 6, 1, 66, 6, 6, 6, 28
Offset: 1

Views

Author

Robert G. Wilson v, Dec 28 2001

Keywords

Examples

			The divisors of 6 are 1, 2, 3 & 6. In unordered pairs they are {1, 2}, {1, 3}, {1, 6}, {2, 3}, {2, 6}, & {3, 6}. Since there are six pairs, a(6) = 6. Also d(6) = 4. 4*3/2 = 6.
		

Crossrefs

Programs

  • Haskell
    a066446 = a000217 . subtract 1 . a000005'
    -- Reinhard Zumkeller, Sep 08 2015
  • Maple
    with(numtheory): seq(tau(n)*(tau(n)-1)/2, n=1..60); # Ridouane Oudra, Apr 15 2023
  • Mathematica
    Table[ Binomial[ DivisorSigma[0, n], 2], {n, 1, 100}]
  • PARI
    { for (n=1, 1000, a=binomial(numdiv(n), 2); write("b066446.txt", n, " ", a) ) } \\ Harry J. Smith, Feb 15 2010
    

Formula

a(p) = 1 iff p is a prime.
Combinations of d(n), the number of divisors of n (A000005), taken two at a time. If the canonical factorization of n into prime powers is Product p^e(p) then d(n) = Product (e(p) + 1). Therefore a(n) = C(d(n), 2) = d(n)*{ d(n)-1 }/2 which is a triangular number (A000217).
a(n) = A184389(n) - A000005(n) = A035116(n) - A184389(n). - Reinhard Zumkeller, Sep 08 2015
a(n) = A000217(A000005(n)-1). - Antti Karttunen, Sep 21 2018
a(n) = Sum_{k|n, i|n, i < k} 1. - Wesley Ivan Hurt, Aug 20 2020
a(n) = Sum_{d|n} A063647(d). - Ridouane Oudra, Apr 15 2023

A343658 Array read by antidiagonals where A(n,k) is the number of ways to choose a multiset of k divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 4, 3, 3, 1, 1, 5, 4, 6, 2, 1, 1, 6, 5, 10, 3, 4, 1, 1, 7, 6, 15, 4, 10, 2, 1, 1, 8, 7, 21, 5, 20, 3, 4, 1, 1, 9, 8, 28, 6, 35, 4, 10, 3, 1, 1, 10, 9, 36, 7, 56, 5, 20, 6, 4, 1, 1, 11, 10, 45, 8, 84, 6, 35, 10, 10, 2, 1
Offset: 1

Views

Author

Gus Wiseman, Apr 29 2021

Keywords

Comments

First differs from A343656 at A(4,2) = 6, A343656(4,2) = 5.
As a triangle, T(n,k) = number of ways to choose a multiset of n - k divisors of k.

Examples

			Array begins:
       k=0 k=1 k=2 k=3 k=4 k=5 k=6 k=7 k=8
  n=1:  1   1   1   1   1   1   1   1   1
  n=2:  1   2   3   4   5   6   7   8   9
  n=3:  1   2   3   4   5   6   7   8   9
  n=4:  1   3   6  10  15  21  28  36  45
  n=5:  1   2   3   4   5   6   7   8   9
  n=6:  1   4  10  20  35  56  84 120 165
  n=7:  1   2   3   4   5   6   7   8   9
  n=8:  1   4  10  20  35  56  84 120 165
  n=9:  1   3   6  10  15  21  28  36  45
Triangle begins:
   1
   1   1
   1   2   1
   1   3   2   1
   1   4   3   3   1
   1   5   4   6   2   1
   1   6   5  10   3   4   1
   1   7   6  15   4  10   2   1
   1   8   7  21   5  20   3   4   1
   1   9   8  28   6  35   4  10   3   1
   1  10   9  36   7  56   5  20   6   4   1
   1  11  10  45   8  84   6  35  10  10   2   1
For example, row n = 6 counts the following multisets:
  {1,1,1,1,1}  {1,1,1,1}  {1,1,1}  {1,1}  {1}  {}
               {1,1,1,2}  {1,1,3}  {1,2}  {5}
               {1,1,2,2}  {1,3,3}  {1,4}
               {1,2,2,2}  {3,3,3}  {2,2}
               {2,2,2,2}           {2,4}
                                   {4,4}
Note that for n = 6, k = 4 in the triangle, the two multisets {1,4} and {2,2} represent the same divisor 4, so they are only counted once under A343656(4,2) = 5.
		

Crossrefs

Row k = 1 of the array is A000005.
Column n = 4 of the array is A000217.
Column n = 6 of the array is A000292.
Row k = 2 of the array is A184389.
The distinct products of these multisets are counted by A343656.
Antidiagonal sums of the array (or row sums of the triangle) are A343661.
A000312 = n^n.
A009998(n,k) = n^k (as an array, offset 1).
A007318 counts k-sets of elements of {1..n}.
A059481 counts k-multisets of elements of {1..n}.

Programs

  • Mathematica
    multchoo[n_,k_]:=Binomial[n+k-1,k];
    Table[multchoo[DivisorSigma[0,k],n-k],{n,10},{k,n}]
  • PARI
    A(n,k) = binomial(numdiv(n) + k - 1, k)
    { for(n=1, 9, for(k=0, 8, print1(A(n,k), ", ")); print ) } \\ Andrew Howroyd, Jan 11 2024

Formula

A(n,k) = ((A000005(n), k)) = A007318(A000005(n) + k - 1, k).
T(n,k) = ((A000005(k), n - k)) = A007318(A000005(k) + n - k - 1, n - k).

A184387 a(n) = sum of numbers from 1 to sigma(n), where sigma(n) = A000203(n).

Original entry on oeis.org

1, 6, 10, 28, 21, 78, 36, 120, 91, 171, 78, 406, 105, 300, 300, 496, 171, 780, 210, 903, 528, 666, 300, 1830, 496, 903, 820, 1596, 465, 2628, 528, 2016, 1176, 1485, 1176, 4186, 741, 1830, 1596, 4095, 903, 4656, 990, 3570, 3081, 2628, 1176, 7750, 1653, 4371
Offset: 1

Views

Author

Jaroslav Krizek, Jan 12 2011

Keywords

Examples

			For n = 4; sigma(4) = 7; a(4) = 1+2+3+4+5+6+7 = 28.
		

Crossrefs

Programs

Formula

a(n) = Sum_{i = 1..sigma(n)} i = A000217(A000203(n)) = A000203(n)*(A000203(n) + 1)/2.
Sum_{k=1..n} a(k) = (5*zeta(3)/12) * n^3 + O(n^2*log(n)^2). - Amiram Eldar, Dec 08 2022

A184388 a(n) = product of numbers from 1 to sigma(n), where sigma(n) = A000203(n).

Original entry on oeis.org

1, 6, 24, 5040, 720, 479001600, 40320, 1307674368000, 6227020800, 6402373705728000, 479001600, 304888344611713860501504000000, 87178291200, 620448401733239439360000, 620448401733239439360000, 8222838654177922817725562880000000, 6402373705728000
Offset: 1

Views

Author

Jaroslav Krizek, Jan 12 2011

Keywords

Examples

			For n = 4; sigma(4) = 7; a(n) = 1*2*3*4*5*6*7 = 5040.
		

Crossrefs

Programs

Formula

a(n) = sigma(n)! = Product_(i = 1,…,sigma(n)) i = A000142(A000203(n)) = (A000203(n))!.

Extensions

Corrected and extended by Harvey P. Dale, Apr 09 2019

A273135 Difference table of the divisors of the positive integers (with every table read by antidiagonals downwards).

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 2, 1, 2, 1, 4, 2, 1, 1, 5, 4, 1, 2, 1, 3, 1, 0, 6, 3, 2, 2, 1, 7, 6, 1, 2, 1, 4, 2, 1, 8, 4, 2, 1, 1, 3, 2, 9, 6, 4, 1, 2, 1, 5, 3, 2, 10, 5, 2, 0, 1, 11, 10, 1, 2, 1, 3, 1, 0, 4, 1, 0, 0, 6, 2, 1, 1, 1, 12, 6, 4, 3, 2, 1, 1, 13, 12, 1, 2, 1, 7, 5, 4, 14, 7, 2, -2, 1, 3, 2, 5, 2, 0, 15, 10, 8, 8
Offset: 1

Views

Author

Omar E. Pol, May 18 2016

Keywords

Comments

This is an irregular tetrahedron T(n,j,k) in which the slice n lists the elements of the j-th antidiagonal of the difference triangle of the divisors of n.
The first row of the slice n is also the n-th row of the triangle A027750.
The bottom entry of the slice n is A187202(n).
The number of elements in the n-th slice is A000217(A000005(n)) = A184389(n).
The sum of the elements of the n-th slice is A273103(n).
The antidiagonal sums give A273262.
If n is a power of 2 the antidiagonals are also the divisors of the powers of 2 from 1 to n in decreasing order, for example if n = 8 the finite sequence of antidiagonals is [1], [2, 1], [4, 2, 1], [8, 4, 2, 1].
First differs from A272121 at a(92).

Examples

			The tables of the first nine positive integers are
  1; 1, 2; 1, 3; 1, 2, 4; 1, 5; 1, 2, 3, 6; 1, 7; 1, 2, 4, 8; 1, 3, 9;
     1;    2;    1, 2;    4;    1, 1, 3;    6;    1, 2, 4;    2, 6;
                 1;             0, 2;             1, 2;       4;
                                2;                1;
For n = 18 the difference table of the divisors of 18 is
  1,  2, 3, 6, 9, 18;
  1,  1, 3, 3, 9;
  0,  2, 0, 6;
  2, -2, 6;
 -4,  8;
 12;
This table read by antidiagonals downwards gives the finite subsequence [1], [2, 1], [3, 1, 0], [6, 3, 2, 2], [9, 3, 0, -2, -4], [18, 9, 6, 6, 8, 12].
		

Crossrefs

Programs

  • Mathematica
    Table[Table[#[[m - k + 1, k]], {m, Length@ #}, {k, m, 1, -1}] &@ NestWhileList[Differences, Divisors@ n, Length@ # > 1 &], {n, 15}] // Flatten (* Michael De Vlieger, Jun 26 2016 *)

A184390 a(n) = sum of numbers from 1 to pi(n), where pi(n) = A007955(n).

Original entry on oeis.org

1, 3, 6, 36, 15, 666, 28, 2080, 378, 5050, 66, 1493856, 91, 19306, 25425, 524800, 153, 17009028, 190, 32004000, 97461, 117370, 276, 55037822976, 7875, 228826, 266085, 240956128, 435, 328050405000
Offset: 1

Views

Author

Jaroslav Krizek, Jan 12 2011

Keywords

Examples

			For n = 6; pi(6) = 36; a(n) = (1/2)*36*37 = 666.
		

Crossrefs

Programs

  • Mathematica
    # (#+1)/2&/@Array[Times@@Divisors[#]&,40] (* Harvey P. Dale, Oct 05 2012 *)
  • Python
    from math import isqrt
    from sympy import divisor_count
    def A184390(n): return (m:=((isqrt(n) if (c:=divisor_count(n)) & 1 else 1)*n**(c//2)))*(m+1)//2 # Chai Wah Wu, Jun 25 2022

Formula

a(n) = Sum_{i = 1..pi(n)} i = A000217(A007955(n)) = (1/2)*A007955(n)*(A007955(n)+1).

A184391 a(n) = product of numbers from 1 to A007955(n).

Original entry on oeis.org

1, 2, 6, 40320, 120, 371993326789901217467999448150835200000000, 5040, 126886932185884164103433389335161480802865516174545192198801894375214704230400000000000000, 10888869450418352160768000000
Offset: 1

Views

Author

Jaroslav Krizek, Jan 12 2011

Keywords

Crossrefs

Programs

  • Mathematica
    A184391[n_] := Product[i, {i, 1, n^(DivisorSigma[0, n]/2)}]; Table[A184391[n], {n, 1, 9}] (* Robert P. P. McKone, Feb 04 2021 *)
  • Python
    from math import isqrt, factorial
    from sympy import divisor_count
    def A184391(n): return factorial((isqrt(n) if (c:=divisor_count(n)) & 1 else 1)*n**(c//2)) # Chai Wah Wu, Jun 25 2022

Formula

a(n) = A007955(n)! = A000142(A007955(n)).

Extensions

a(9) from Robert P. P. McKone, Feb 04 2021
Showing 1-10 of 22 results. Next