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.

Previous Showing 11-20 of 114 results. Next

A127093 Triangle read by rows: T(n,k)=k if k is a divisor of n; otherwise, T(n,k)=0 (1 <= k <= n).

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Jan 05 2007, Apr 04 2007

Keywords

Comments

Sum of terms in row n = sigma(n) (sum of divisors of n).
Euler's derivation of A127093 in polynomial form is in his proof of the formula for Sigma(n): (let S=Sigma, then Euler proved that S(n) = S(n-1) + S(n-2) - S(n-5) - S(n-7) + S(n-12) + S(n-15) - S(n-22) - S(n-26), ...).
[Young, pp. 365-366], Euler begins, s = (1-x)*(1-x^2)*(1-x^3)*... = 1 - x - x^2 + x^5 + x^7 - x^12 ...; log s = log(1-x) + log(1-x^2) + log(1-x^3) ...; differentiating and then changing signs, Euler has t = x/(1-x) + 2x^2/(1-x^2) + 3x^3/(1-x^3) + 4x^4/(1-x^4) + 5x^5/(1-x^5) + ...
Finally, Euler expands each term of t into a geometric series, getting A127093 in polynomial form: t =
x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + ...
+ 2x^2 + 2x^4 + 2x^6 + 2x^8 + ...
+ 3x^3 + 3x^6 + ...
+ 4x^4 + 4x^8 + ...
+ 5x^5 + ...
+ 6x^6 + ...
+ 7x^7 + ...
+ 8x^8 + ...
T(n,k) is the sum of all the k-th roots of unity each raised to the n-th power. - Geoffrey Critzer, Jan 02 2016
From Davis Smith, Mar 11 2019: (Start)
For n > 1, A020639(n) is the leftmost term, other than 0 or 1, in the n-th row of this array. As mentioned in the Formula section, the k-th column is period k: repeat [k, 0, 0, ..., 0], but this also means that it's the characteristic function of the multiples of k multiplied by k. T(n,1) = A000012(n), T(n,2) = 2*A059841(n), T(n,3) = 3*A079978(n), T(n,4) = 4*A121262(n), T(n,5) = 5*A079998(n), and so on.
The terms in the n-th row, other than 0, are the factors of n. If n > 1 and for every k, 1 <= k < n, T(n,k) = 0 or 1, then n is prime. (End)
From Gary W. Adamson, Aug 07 2019: (Start)
Row terms of the triangle can be used to calculate E(n) in A002654): (1, 1, 0, 1, 2, 0, 0, 1, 1, 2, ...), and A004018, the number of points in a square lattice on the circle of radius sqrt(n), A004018: (1, 4, 4, 0, 4, 8, 0, 0, 4, ...).
As to row terms in the triangle, let E(n) of even terms = 0,
E(integers of the form 4*k - 1 = (-1), and E(integers of the form 4*k + 1 = 1.
Then E(n) is the sum of the E(n)'s of the factors of n in the triangle rows. Example: E(10) = Sum: ((E(1) + E(2) + E(5) + E(10)) = ((1 + 0 + 1 + 0) = 2, matching A002654(10).
To get A004018, multiply the result by 4, getting A004018(10) = 8.
The total numbers of lattice points = 4r^2 = E(1) + ((E(2))/2 + ((E(3))/3 + ((E(4))/4 + ((E(5))/5 + .... Since E(even integers) are zero, E(integers of the form (4*k - 1)) = (-1), and E(integers of the form (4*k + 1)) = (+1); we are left with 4r^2 = 1 - 1/3 + 1/5 - 1/7 + 1/9 - ..., which is approximately equal to Pi(r^2). (End)
T(n,k) is also the number of parts in the partition of n into k equal parts. - Omar E. Pol, May 05 2020

Examples

			T(8,4) = 4 since 4 divides 8.
T(9,3) = 3 since 3 divides 9.
First few rows of the triangle:
  1;
  1, 2;
  1, 0, 3;
  1, 2, 0, 4;
  1, 0, 0, 0, 5;
  1, 2, 3, 0, 0, 6;
  1, 0, 0, 0, 0, 0, 7;
  1, 2, 0, 4, 0, 0, 0, 8;
  1, 0, 3, 0, 0, 0, 0, 0, 9;
  ...
		

References

  • David Wells, "Prime Numbers, the Most Mysterious Figures in Math", John Wiley & Sons, 2005, appendix.
  • L. Euler, "Discovery of a Most Extraordinary Law of the Numbers Concerning the Sum of Their Divisors"; pp. 358-367 of Robert M. Young, "Excursions in Calculus, An Interplay of the Continuous and the Discrete", MAA, 1992. See p. 366.

Crossrefs

Reversal = A127094
Cf. A027750.
Cf. A000012 (the first column), A020639, A059841 (the second column when multiplied by 2), A079978 (the third column when multiplied by 2), A079998 (the fifth column when multiplied by 5), A121262 (the fourth column when multiplied by 4).

Programs

  • Excel
    mod(row()-1;column()) - mod(row();column()) + 1 - Mats Granvik, Aug 31 2007
    
  • Haskell
    a127093 n k = a127093_row n !! (k-1)
    a127093_row n = zipWith (*) [1..n] $ map ((0 ^) . (mod n)) [1..n]
    a127093_tabl = map a127093_row [1..]
    -- Reinhard Zumkeller, Jan 15 2011
    
  • Maple
    A127093:=proc(n,k) if type(n/k, integer)=true then k else 0 fi end:
    for n from 1 to 16 do seq(A127093(n,k),k=1..n) od; # yields sequence in triangular form - Emeric Deutsch, Jan 20 2007
  • Mathematica
    t[n_, k_] := k*Boole[Divisible[n, k]]; Table[t[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jan 17 2014 *)
    Table[ SeriesCoefficient[k*x^k/(1 - x^k), {x, 0, n}], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Apr 14 2015 *)
  • PARI
    trianglerows(n) = for(x=1, n, for(k=1, x, if(x%k==0, print1(k, ", "), print1("0, "))); print(""))
    /* Print initial 9 rows of triangle as follows: */
    trianglerows(9) \\ Felix Fröhlich, Mar 26 2019

Formula

k-th column is composed of "k" interspersed with (k-1) zeros.
Let M = A127093 as an infinite lower triangular matrix and V = the harmonic series as a vector: [1/1, 1/2, 1/3, ...]. then M*V = d(n), A000005: [1, 2, 2, 3, 2, 4, 2, 4, 3, 4, ...]. M^2 * V = A060640: [1, 5, 7, 17, 11, 35, 15, 49, 34, 55, ...]. - Gary W. Adamson, May 10 2007
T(n,k) = ((n-1) mod k) - (n mod k) + 1 (1 <= k <= n). - Mats Granvik, Aug 31 2007
T(n,k) = k * 0^(n mod k). - Reinhard Zumkeller, Jan 15 2011
G.f.: Sum_{k>=1} k * x^k * y^k/(1-x^k) = Sum_{m>=1} x^m * y/(1 - x^m*y)^2. - Robert Israel, Aug 08 2016
T(n,k) = Sum_{d|k} mu(k/d)*sigma(gcd(n,d)). - Ridouane Oudra, Apr 05 2025

A054523 Triangle read by rows: T(n,k) = phi(n/k) if k divides n, T(n,k)=0 otherwise (n >= 1, 1 <= k <= n).

Original entry on oeis.org

1, 1, 1, 2, 0, 1, 2, 1, 0, 1, 4, 0, 0, 0, 1, 2, 2, 1, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 4, 2, 0, 1, 0, 0, 0, 1, 6, 0, 2, 0, 0, 0, 0, 0, 1, 4, 4, 0, 0, 1, 0, 0, 0, 0, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 2, 2, 2, 0, 1, 0, 0, 0, 0, 0, 1, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 6
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

From Gary W. Adamson, Jan 08 2007: (Start)
Let H be this lower triangular matrix. Then:
H * [1, 2, 3, ...] = 1, 3, 5, 8, 9, 15, ... = A018804,
H * sigma(n) = A038040 = d(n) * n = 1, 4, 6, 12, 10, ... where sigma(n) = A000203,
H * d(n) (A000005) = sigma(n) = A000203,
Row sums are A000027 (corrected by Werner Schulte, Sep 06 2020, see comment of Gary W. Adamson, Aug 03 2008),
H^2 * d(n) = d(n)*n, H^2 = A127192,
H * mu(n) (A008683) = A007431(n) (corrected by Werner Schulte, Sep 06 2020),
H^2 row sums = A018804. (End)
The Möbius inversion principle of Richard Dedekind and Joseph Liouville (1857), cf. "Concrete Mathematics", p. 136, is equivalent to the statement that row sums are the row index n. - Gary W. Adamson, Aug 03 2008
The multivariable row polynomials give n times the cycle index for the cyclic group C_n, called Z(C_n) (see the MathWorld link with the Harary reference): n*Z(C_n) = Sum_{k=1..n} T(n,k)*(y_{n/k})^k, n >= 1. E.g., 6*Z(C_6) = 2*(y_6)^1 + 2*(y_3)^2 + 1*(y_2)^3 + 1*(y_1)^6. - Wolfdieter Lang, May 22 2012
See A102190 (no 0's, rows reversed). - Wolfdieter Lang, May 29 2012
This is the number of permutations in the n-th cyclic group which are the product of k disjoint cycles. - Robert A. Beeler, Aug 09 2013

Examples

			Triangle begins
   1;
   1, 1;
   2, 0, 1;
   2, 1, 0, 1;
   4, 0, 0, 0, 1;
   2, 2, 1, 0, 0, 1;
   6, 0, 0, 0, 0, 0, 1;
   4, 2, 0, 1, 0, 0, 0, 1;
   6, 0, 2, 0, 0, 0, 0, 0, 1;
   4, 4, 0, 0, 1, 0, 0, 0, 0, 1;
  10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1;
   4, 2, 2, 2, 0, 1, 0, 0, 0, 0, 0, 1;
		

References

  • Ronald L. Graham, D. E. Knuth, Oren Patashnik, Concrete Mathematics, Addison-Wesley, 2nd ed., 1994, p. 136.

Crossrefs

Sums incliude: A029935, A069097, A092843 (diagonal), A209295.
Sums of the form Sum_{k} k^p * T(n, k): A000027 (p=0), A018804 (p=1), A069097 (p=2), A343497 (p=3), A343498 (p=4), A343499 (p=5).

Programs

  • Haskell
    a054523 n k = a054523_tabl !! (n-1) !! (k-1)
    a054523_row n = a054523_tabl !! (n-1)
    a054523_tabl = map (map (\x -> if x == 0 then 0 else a000010 x)) a126988_tabl
    -- Reinhard Zumkeller, Jan 20 2014
    
  • Magma
    A054523:= func< n,k | k eq n select 1 else (n mod k) eq 0 select EulerPhi(Floor(n/k)) else 0 >;
    [A054523(n,k): k in [1..n], n in [1..15]]; // G. C. Greubel, Jun 24 2024
    
  • Maple
    A054523 := proc(n,k) if n mod k = 0 then numtheory[phi](n/k) ; else 0; end if; end proc: # R. J. Mathar, Apr 11 2011
  • Mathematica
    T[n_, k_]:= If[k==n,1,If[Divisible[n, k], EulerPhi[n/k], 0]];
    Table[T[n,k], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Dec 15 2017 *)
  • PARI
    for(n=1, 10, for(k=1, n, print1(if(!(n % k), eulerphi(n/k), 0), ", "))) \\ G. C. Greubel, Dec 15 2017
    
  • SageMath
    def A054523(n,k):
        if (k==n): return 1
        elif (n%k)==0: return euler_phi(int(n//k))
        else: return 0
    flatten([[A054523(n,k) for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Jun 24 2024

Formula

Sum_{k=1..n} k * T(n, k) = A018804(n). - Gary W. Adamson, Jan 08 2007
Equals A054525 * A126988 as infinite lower triangular matrices. - Gary W. Adamson, Aug 03 2008
From Werner Schulte, Sep 06 2020: (Start)
Sum_{k=1..n} T(n,k) * A000010(k) = A029935(n) for n > 0.
Sum_{k=1..n} k^2 * T(n,k) = A069097(n) for n > 0. (End)
From G. C. Greubel, Jun 24 2024: (Start)
T(2*n-1, n) = A000007(n-1), n >= 1.
T(2*n, n) = A000012(n), n >= 1.
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = (1 - (-1)^n)*n/2.
Sum_{k=1..floor(n+1)/2} T(n-k+1, k) = A092843(n+1).
Sum_{k=1..n} (k+1)*T(n, k) = A209295(n).
Sum_{k=1..n} k^3 * T(n, k) = A343497(n).
Sum_{k=1..n} k^4 * T(n, k) = A343498(n).
Sum_{k=1..n} k^5 * T(n, k) = A343499(n). (End)

A060640 If n = Product p_i^e_i then a(n) = Product (1 + 2*p_i + 3*p_i^2 + ... + (e_i+1)*p_i^e_i).

Original entry on oeis.org

1, 5, 7, 17, 11, 35, 15, 49, 34, 55, 23, 119, 27, 75, 77, 129, 35, 170, 39, 187, 105, 115, 47, 343, 86, 135, 142, 255, 59, 385, 63, 321, 161, 175, 165, 578, 75, 195, 189, 539, 83, 525, 87, 391, 374, 235, 95, 903, 162, 430, 245, 459, 107, 710, 253, 735, 273, 295, 119
Offset: 1

Views

Author

N. J. A. Sloane, Apr 17 2001

Keywords

Comments

Equals row sums of triangle A143313. - Gary W. Adamson, Aug 06 2008
Equals row sums of triangle A127099. - Gary W. Adamson, Jul 27 2008
Sum of the divisors d2 from the ordered pairs of divisors of n, (d1,d2) with d1<=d2, such that d1|d2. - Wesley Ivan Hurt, Mar 22 2022

Examples

			a(4) = a(2^2) = 1 + (2)*(2) + (3)*(2^2) = 17;
a(6) = a(2)*a(3) = (1 + (2)*(2))*(1+(2)*(3)) = (5)*(7) = 35.
a(6) = tau(1) + 2*tau(2) + 3*tau(3) + 6*tau(6) = 1 + 2*2 + 3*2 + 6*4 = 35.
		

References

  • D. M. Burton, Elementary Number Theory, Allyn and Bacon Inc., Boston, MA, 1976, p. 120.

Crossrefs

Cf. A000005, A000203, A001001, A006171, A038040 (Mobius transform), A049060, A057660, A057723, A327960 (Dirichlet inverse).
Cf. also triangles A027750, A127099, A143313.

Programs

  • Haskell
    a060640 n = sum [d * a000005 d | d <- a027750_row n]
    -- Reinhard Zumkeller, Feb 29 2012
    
  • Maple
    A060640 := proc(n) local ans, i, j; ans := 1: for i from 1 to nops(ifactors(n)[2]) do ans := ans*(1+sum((j+1)*ifactors(n)[2][i][1]^j,j=1..ifactors(n)[2][i][2])): od: RETURN(ans) end:
  • Mathematica
    a[n_] := Total[#*DivisorSigma[1, n/#] & /@ Divisors[n]];
    a /@ Range[59] (* Jean-François Alcover, May 19 2011, after Vladeta Jovovic *)
    f[p_, e_] := ((e + 1)*p^(e + 2) - (e + 2)*p^(e + 1) + 1)/(p - 1)^2; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Apr 10 2022 *)
  • PARI
    j=[]; for(n=1,200,j=concat(j,sumdiv(n,d,n/d*sigma(d)))); j
    
  • PARI
    a(n)=if(n<1,0,direuler(p=2,n,1/(1-X)/(1-p*X)^2)[n]) /* Ralf Stephan */
    
  • PARI
    N=66; default(seriesprecision,N); x=z+O(z^(N+1))
    c=sum(j=1,N,j*x^j); t=1/prod(j=1,N, eta(x^(j)));
    t=log(t);t=serconvol(t,c);
    Vec(t) /* Joerg Arndt, May 03 2008 */
    
  • PARI
    { for (n=1, 1000, write("b060640.txt", n, " ", direuler(p=2, n, 1/(1 - X)/(1 - p*X)^2)[n]); ) } /* Harry J. Smith, Jul 08 2009 */
    
  • Sage
    def A060640(n) :
        sigma = sloane.A000203
        return add(sigma(k)*(n/k) for k in divisors(n))
    [A060640(i) for i in (1..59)] # Peter Luschny, Sep 15 2012

Formula

a(n) = Sum_{d|n} d*tau(d), where tau(d) is the number of divisors of d, cf. A000005. a(n) = Sum_{d|n} d*sigma(n/d), where sigma(n)=sum of divisors of n, cf. A000203. - Vladeta Jovovic, Apr 23 2001
Multiplicative with a(p^e) = ((e+1)*p^{e+2} - (e+2)*p^{e+1} + 1) / (p-1)^2. Dirichlet g.f.: zeta(s)*zeta(s-1)^2. - Franklin T. Adams-Watters, Aug 03 2006
L.g.f.: Sum(A060640(n)*x^n/n) = -log( Product_{j>=1} P(x^j) ) where P(x) = Product_{k>=1} (1-x^k). - Joerg Arndt, May 03 2008
G.f.: Sum_{k>=1} k*tau(k)*x^k/(1 - x^k). - Ilya Gutkovskiy, Sep 06 2018
Sum_{k=1..n} a(k) ~ n^2/24 * ((4*gamma - 1)*Pi^2 + 2*Pi^2 * log(n) + 12*Zeta'(2)), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Feb 01 2019

Extensions

More terms from James Sellers, Vladeta Jovovic and Matthew Conroy, Apr 17 2001

A245579 Number of odd divisors of n multiplied by n.

Original entry on oeis.org

1, 2, 6, 4, 10, 12, 14, 8, 27, 20, 22, 24, 26, 28, 60, 16, 34, 54, 38, 40, 84, 44, 46, 48, 75, 52, 108, 56, 58, 120, 62, 32, 132, 68, 140, 108, 74, 76, 156, 80, 82, 168, 86, 88, 270, 92, 94, 96, 147, 150, 204, 104, 106, 216, 220, 112, 228, 116, 118, 240, 122
Offset: 1

Views

Author

Michael Somos, Jul 26 2014

Keywords

Examples

			G.f. = x + 2*x^2 + 6*x^3 + 4*x^4 + 10*x^5 + 12*x^6 + 14*x^7 + 8*x^8 + ...
For n = 10 there are two odd divisors of 10: 1 and 5, so a(10) = 2*10 = 20.
		

Crossrefs

Programs

  • Maple
    seq(n*numtheory:-tau(n/2^padic:-ordp(n,2)), n=1..100); # Robert Israel, Apr 26 2017
  • Mathematica
    a[ n_] := If[ n < 1, 0, n Sum[ Mod[d, 2], {d, Divisors @ n}]];
    (* Second program: *)
    Table[n DivisorSum[n, 1 &, OddQ], {n, 61}] (* Michael De Vlieger, Apr 24 2017 *)
  • PARI
    {a(n) = if( n<1, 0, n * sumdiv(n, d, d%2))};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum(k=1, n, if( k%2, k * x^k / (1 - x^k)^2), x * O(x^n)), n))};
    
  • PARI
    {a(n) = if( n<1, 0, n * numdiv(n / 2^valuation(n, 2)))} \\ Fast when n has many divisors. Jens Kruse Andersen, Jul 26 2014
    
  • Python
    from sympy import divisors
    def a(n): return n*len(list(filter(lambda i: i%2==1, divisors(n)))) # Indranil Ghosh, Apr 24 2017
    
  • Python
    from math import prod
    from sympy import factorint
    def A245579(n): return n*prod(e+1 for e in factorint(n>>(~n&n-1).bit_length()).values()) # Chai Wah Wu, Dec 31 2023

Formula

a(n) is multiplicative with a(2^e) = 2^e, a(p^e) = p^e * (e+1) if p>2.
a(n) = n * A001227(n).
G.f.: Sum_{k>0 odd} k * x^k / (1 - x^k)^2.
From Amiram Eldar, Dec 31 2022: (Start)
Dirichlet g.f.: zeta(s-1)^2*(1-1/2^(s-1)).
Sum_{k=1..n} a(k) ~ n^2*log(n)/4 + (4*gamma + 2*log(2) - 1)*n^2/8, where gamma is Euler's constant (A001620). (End)

Extensions

Edited by N. J. A. Sloane, Apr 27 2022

A038044 Shifts left under transform T where Ta is a DCONV a.

Original entry on oeis.org

1, 1, 2, 4, 9, 18, 40, 80, 168, 340, 698, 1396, 2844, 5688, 11456, 22948, 46072, 92144, 184696, 369392, 739536, 1479232, 2959860, 5919720, 11842696, 23685473, 47376634, 94753940, 189519576, 379039152, 758102900, 1516205800
Offset: 1

Views

Author

Keywords

Crossrefs

Positions of odd terms are given by A003095. Other self-convolved sequences: A000108, A007460 - A007464, A025192, A061922, A062177.
Column k=1 of A144324 and A144823. - Alois P. Heinz, Nov 04 2012
Cf. A038040.
Cf. A000010.

Programs

  • Haskell
    import Data.Function (on)
    a038044 n = a038044_list !! (n-1)
    a038044_list = 1 : f 1 [1] where
       f x ys = y : f (x + 1) (y:ys) where
         y = sum $ zipWith ((*) `on` a038044) divs $ reverse divs
             where divs = a027750_row x
    -- Reinhard Zumkeller, Jan 21 2014
  • Maple
    with(numtheory); EIGENbyDIRCONV := proc(upto_n) local n,a,j,i,s,m; a := [1]; for i from 1 to upto_n do s := 0; m := convert(divisors(i),set); n := nops(m); for j from 1 to n do s := s+(a[m[j]]*a[m[(n-j)+1]]); od; a := [op(a),s]; od; RETURN(a); end;
  • Mathematica
    dc[b_, c_] := Module[{p}, p[n_] := p[n] = Sum[b[d]*c[n/d], {d, If[n<0, {}, Divisors[n]]}]; p]; A[n_, k_] := Module[{f, b, t}, b[1] = dc[f, f]; For[t = 2, t <= k, t++, b[t] = dc[b[t-1], b[t-1]]]; f = Function[m, If[m == 1, 1, b[k][m-1]]]; f[n]]; a[n_] := A[n, 1]; Array[a, 40] (* Jean-François Alcover, Mar 20 2017, after A144324 *)

Formula

From Benoit Cloitre, Aug 29 2004: (Start)
a(n+1) = Sum_{d|n} a(d)*a(n/d), a(1) = 1.
a(prime(k)+1) = 2*a(prime(k));
a(n) is asymptotic to c*2^n where c=0.353030198... (End)
G.f.: A(x) = Sum_{n>=1} a(n)*x^n = x * (1 + Sum_{i>=1} Sum_{j>=1} a(i)*a(j)*x^(i*j)). - Ilya Gutkovskiy, May 01 2019 [modified by Ilya Gutkovskiy, May 09 2019]
a(n+1) = Sum_{k=1..n} a(gcd(n,k))*a(n/gcd(n,k))/phi(n/gcd(n,k)) where phi = A000010. - Richard L. Ollerton, May 19 2021

A143127 a(n) = Sum_{k=1..n} k*d(k) where d(k) is the number of divisors of k.

Original entry on oeis.org

1, 5, 11, 23, 33, 57, 71, 103, 130, 170, 192, 264, 290, 346, 406, 486, 520, 628, 666, 786, 870, 958, 1004, 1196, 1271, 1375, 1483, 1651, 1709, 1949, 2011, 2203, 2335, 2471, 2611, 2935, 3009, 3161, 3317, 3637, 3719, 4055, 4141, 4405, 4675, 4859, 4953, 5433
Offset: 1

Views

Author

Gary W. Adamson, Jul 26 2008

Keywords

Comments

a(n) is also the sum of all parts of all partitions of all positive integers <= n into equal parts. - Omar E. Pol, May 29 2017
a(n) is also the sum of the multiples of k, not exceeding n, for k = 1, 2, ..., n. See a formula and an example below. - Wolfdieter Lang, Oct 18 2021

Examples

			a(3) = 11 = (1 + 4 + 6), where n*d(n) = (1, 4, 6, 12, 10, 24, ...).
a(4) = 23 = (8 + 7 + 5 + 3), where (8, 7, 5, 3) = row 4 of triangle A110661.
a(4) = 23 is the sum of [1 2 3 4|2 4|3|4] (multiples of k=1..4, not exceeding n). - _Wolfdieter Lang_, Oct 18 2021
a(4) = [1] + [2 + 1 + 1] + [3 + 1 + 1 + 1] + [4 + 2 + 2 + 1 + 1 + 1 + 1] = 23. - _Omar E. Pol_, Oct 18 2021
		

Crossrefs

Partial sums of A038040.
Row sums of triangle A110661.
Row sums of triangle A143310. - Gary W. Adamson, Aug 06 2008
Cf. A018804.

Programs

  • Haskell
    a143127 n = a143127_list !! (n-1)
    a143127_list = scanl1 (+) a038040_list
    -- Reinhard Zumkeller, Jan 21 2014
    
  • Mathematica
    Accumulate[DivisorSigma[0, Range[48]] Range[48]] (* Giovanni Resta, May 29 2018 *)
  • PARI
    a(n) = sum(k=1, n, k*numdiv(k)); \\ Michel Marcus, May 29 2018
    
  • Python
    from math import isqrt
    def A143127(n): return -((k:=isqrt(n))*(k+1)>>1)**2+sum(i*(m:=n//i)*(1+m) for i in range(1,k+1)) # Chai Wah Wu, Jul 11 2023

Formula

a(n) = Sum_{k=1..n} A038040(k).
a(n) = Sum_{m=1..floor(sqrt(n))} m*(m+floor(n/m))*(floor(n/m)+1-m) - A000330(floor(sqrt(n))) = 2*A083356(n) - A000330(floor(sqrt(n))). - Max Alekseyev, Jan 31 2012
G.f.: x*f'(x)/(1 - x), where f(x) = Sum_{k>=1} x^k/(1 - x^k). - Ilya Gutkovskiy, Apr 13 2017 [Sum_{k>=1} k*x^k/((1-x)*(1-x^k)^2), see A038040. - Wolfdieter Lang, Oct 18 2021]
a(n) = Sum_{k=1..n} k/2 * floor(n/k) * floor(1 + n/k). - Daniel Suteu, May 28 2018
a(n) ~ log(n) * n^2 / 2 + (gamma - 1/4)*n^2, where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Sep 08 2018
From Daniel Hoying, May 21 2020: (Start)
a(n) = (Sum_{i=1..floor(sqrt(n))} i*floor(n/i)*(1+floor(n/i))) - (floor(sqrt(n))*(1+floor(sqrt(n)))/2)^2;
= (Sum_{i=1..floor(sqrt(n))} i*floor(n/i)*(1+floor(n/i))) - A000537(floor(sqrt(n))).
a(n) = A000537(floor(sqrt(n))) ; n=1;
= A000537(floor(sqrt(n))) + n*(n+1) - floor(n/2)*(floor(n/2)+1) ; 1
= A000537(floor(sqrt(n))) + n*(n+1) - floor(n/2)*(floor(n/2)+1) + Sum_{i=floor(sqrt(n))+1..floor(n/2)} i*floor(n/i)*(1+floor(n/i)) ; n>=6. (End)
a(n) = Sum_{i=1..n} A018804(i)*floor(n/i). - Ridouane Oudra, Mar 15 2021
a(n) = Sum_{k=1..n} b(n,k), with b(n, k) = Sum_{j=1..floor(n/k)} j*k = k * floor(n/k) * (floor(n/k) + 1)/2. See the formula by Daniel Suteu above. - Wolfdieter Lang, Oct 18 2021

Extensions

More terms from Carl Najafi, Dec 24 2011
Edited by Max Alekseyev, Jan 31 2012

A094471 a(n) = Sum_{(n - k)|n, 0 <= k <= n} k.

Original entry on oeis.org

0, 1, 2, 5, 4, 12, 6, 17, 14, 22, 10, 44, 12, 32, 36, 49, 16, 69, 18, 78, 52, 52, 22, 132, 44, 62, 68, 112, 28, 168, 30, 129, 84, 82, 92, 233, 36, 92, 100, 230, 40, 240, 42, 180, 192, 112, 46, 356, 90, 207, 132, 214, 52, 312, 148, 328, 148, 142, 58, 552, 60
Offset: 1

Author

Labos Elemer, May 28 2004

Keywords

Comments

Not all values arise and some arise more than once.
Row sums of triangle A134866. - Gary W. Adamson, Nov 14 2007
Sum of the largest parts of the partitions of n into two parts such that the smaller part divides the larger. - Wesley Ivan Hurt, Dec 21 2017
a(n) is also the sum of all parts minus the total number of parts of all partitions of n into equal parts (an interpretation of the Torlach Rush's formula). - Omar E. Pol, Nov 30 2019
If and only if sigma(n) divides a(n), then n is one of Ore's Harmonic numbers, A001599. - Antti Karttunen, Jul 18 2020

Examples

			q^2 + 2*q^3 + 5*q^4 + 4*q^5 + 12*q^6 + 6*q^7 + 17*q^8 + 14*q^9 + ...
For n = 4 the partitions of 4 into equal parts are [4], [2,2], [1,1,1,1]. The sum of all parts is 4 + 2 + 2 + 1 + 1 + 1 + 1 = 12. There are 7 parts, so a(4) = 12 - 7 = 5. - _Omar E. Pol_, Nov 30 2019
		

References

  • P. A. MacMahon, Combinatory Analysis, Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916; see vol. 2, p 30.

Crossrefs

Cf. A000005, A000010, A000203, A001599, A038040, A134866, A152211, A244051, A324121 (= gcd(a(n), sigma(n))).
Cf. A088827 (positions of odd terms).

Programs

  • Julia
    using AbstractAlgebra
    function A094471(n)
        sum(k for k in 0:n if is_divisible_by(n, n - k))
    end
    [A094471(n) for n in 1:61] |> println  # Peter Luschny, Nov 14 2023
    
  • Maple
    with(numtheory); A094471:=n->n*tau(n)-sigma(n); seq(A094471(k), k=1..100); # Wesley Ivan Hurt, Oct 27 2013
    divides := (k, n) -> k = n or (k > 0 and irem(n, k) = 0):
    a := n -> local k; add(`if`(divides(n - k, n), k, 0), k = 0..n):
    seq(a(n), n = 1..61);  # Peter Luschny, Nov 14 2023
  • Mathematica
    Table[n*DivisorSigma[0, n] - DivisorSigma[1, n], {n, 1, 100}]
  • PARI
    {a(n) = n*numdiv(n) - sigma(n)} /* Michael Somos, Jan 25 2008 */
    
  • Python
    from math import prod
    from sympy import factorint
    def A094471(n):
        f = factorint(n).items()
        return n*prod(e+1 for p,e in f)-prod((p**(e+1)-1)//(p-1) for p,e in f)
    # Chai Wah Wu, Nov 14 2023
  • SageMath
    def A094471(n): return sum(k for k in (0..n) if (n-k).divides(n))
    print([A094471(n) for n in range(1, 62)])  # Peter Luschny, Nov 14 2023
    

Formula

a(n) = n*tau(n) - sigma(n) = n*A000005(n) - A000203(n). [Previous name.]
If p is prime, then a(p) = p*tau(p)-sigma(p) = 2p-(p+1) = p-1 = phi(p).
If n>1, then a(n)>0.
a(n) = Sum_{d|n} (n-d). - Amarnath Murthy, Jul 31 2005
G.f.: Sum_{k>=1} k*x^(2*k)/(1 - x^k)^2. - Ilya Gutkovskiy, Oct 24 2018
a(n) = A038040(n) - A000203(n). - Torlach Rush, Feb 02 2019

Extensions

Simpler name by Peter Luschny, Nov 14 2023

A106315 Harmonic residue of n.

Original entry on oeis.org

0, 1, 2, 5, 4, 0, 6, 2, 1, 4, 10, 16, 12, 8, 12, 18, 16, 30, 18, 36, 20, 16, 22, 12, 13, 20, 28, 0, 28, 24, 30, 3, 36, 28, 44, 51, 36, 32, 44, 50, 40, 48, 42, 12, 36, 40, 46, 108, 33, 21, 60, 18, 52, 72, 4, 88, 68, 52, 58, 48, 60, 56, 66, 67, 8, 96, 66, 30, 84, 128, 70, 84, 72, 68, 78
Offset: 1

Author

George J. Schaeffer (gschaeff(AT)andrew.cmu.edu), Apr 29 2005

Keywords

Comments

The harmonic residue is the remainder when n*d(n) is divided by sigma(n), where d(n) is the number of divisors of n and sigma(n) is the sum of the divisors of n. If n is perfect, the harmonic residue of n is 0.

Crossrefs

Cf. A106316, A106317, A001599 (positions of zeros).

Programs

  • Haskell
    a106315 n = n * a000005 n `mod` a000203 n -- Reinhard Zumkeller, Apr 06 2014
  • Maple
    A106315 := proc(n)
        modp(n*numtheory[tau](n),numtheory[sigma](n)) ;
    end proc:
    seq(A106315(n),n=1..100) ; # R. J. Mathar, Jan 25 2017
  • Mathematica
    HarmonicResidue[n_]=Mod[n*DivisorSigma[0, n], DivisorSigma[1, n]]; HarmonicResidue[ Range[ 80]]

Formula

a(n) = A038040(n) - A000203(n) * A240471(n) . - Reinhard Zumkeller, Apr 06 2014

Extensions

Mathematica program completed by Harvey P. Dale, Feb 29 2024

A244051 Triangle read by rows in which row n lists the parts of the partitions of n into equal parts, in nonincreasing order.

Original entry on oeis.org

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

Author

Omar E. Pol, Nov 08 2014

Keywords

Comments

Row n has length sigma(n) = A000203(n).
Row sums give n*A000005(n) = A038040(n).
Column 1 is A000027.
Both columns 2 and 3 are A032742, n > 1.
For any k > 0 and t > 0, the sequence contains exactly one run of k consecutive t's. - Rémy Sigrist, Feb 11 2019
From Omar E. Pol, Dec 04 2019: (Start)
The number of parts congruent to 0 (mod m) in row m*n equals sigma(n) = A000203(n).
The number of parts greater than 1 in row n equals A001065(n), the sum of aliquot parts of n.
The number of parts greater than 1 and less than n in row n equals A048050(n), the sum of divisors of n except for 1 and n.
The number of partitions in row n equals A000005(n), the number of divisors of n.
The number of partitions in row n with an odd number of parts equals A001227(n).
The sum of odd parts in row n equals the sum of parts of the partitions in row n that have an odd number of parts, and equals the sum of all parts in the partitions of n into consecutive parts, and equals A245579(n) = n*A001227(n).
The decreasing records in row n give the n-th row of A056538.
Row n has n 1's which are all at the end of the row.
First n rows contain A000217(n) 1's.
The number of k's in row n is A126988(n,k).
The number of odd parts in row n is A002131(n).
The k-th block in row n has A027750(n,k) parts.
Right border gives A000012. (End)
The r-th row of the triangle begins at index k = A160664(r-1). - Samuel Harkness, Jun 21 2022

Examples

			Triangle begins:
   [1];
   [2], [1,1];
   [3], [1,1,1];
   [4], [2,2], [1,1,1,1];
   [5], [1,1,1,1,1];
   [6], [3,3], [2,2,2], [1,1,1,1,1,1];
   [7], [1,1,1,1,1,1,1];
   [8], [4,4], [2,2,2,2], [1,1,1,1,1,1,1,1];
   [9], [3,3,3], [1,1,1,1,1,1,1,1,1];
  [10], [5,5], [2,2,2,2,2], [1,1,1,1,1,1,1,1,1,1];
  [11], [1,1,1,1,1,1,1,1,1,1,1];
  [12], [6,6], [4,4,4], [3,3,3,3], [2,2,2,2,2,2], [1,1,1,1,1,1,1,1,1,1,1,1];
  [13], [1,1,1,1,1,1,1,1,1,1,1,1,1];
  [14], [7,7], [2,2,2,2,2,2,2], [1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  [15], [5,5,5], [3,3,3,3,3], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  [16], [8,8], [4,4,4,4], [2,2,2,2,2,2,2,2], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  ...
For n = 6 the 11 partitions of 6 are [6], [3, 3], [4, 2], [2, 2, 2], [5, 1], [3, 2], [4, 1, 1], [2, 2, 1, 1], [3, 1, 1, 1], [2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]. There are only four partitions of 6 that contain equal parts so the 6th row of triangle is [6], [3, 3], [2, 2, 2], [1, 1, 1, 1, 1, 1]. The number of parts equals sigma(6) = A000203(6) = 12. The row sum is A038040(6) = 6*A000005(6) = 6*4 = 24.
From _Omar E. Pol_, Dec 04 2019: (Start)
The structure of the above triangle is as follows:
   1;
   2 11;
   3    111;
   4 22     1111;
   5             11111;
   6 33 222            111111;
   7                          1111111;
   8 44     2222                      11111111;
   9    333                                    111111111;
  ... (End)
		

Programs

  • Mathematica
    A244051row[n_]:=Flatten[Map[ConstantArray[#,n/#]&,Reverse[Divisors[n]]]];
    Array[A244051row,10] (* Paolo Xausa, Oct 16 2023 *)
  • PARI
    tabf(nn) = {for (n=1, nn, d = Vecrev(divisors(n)); for (i=1, #d, for (j=1, n/d[i], print1(d[i], ", "));); print(););} \\ Michel Marcus, Nov 08 2014

A324058 a(n) = A324121(A005940(1+n)) = gcd(A324054(n), A005940(1+n)*A106737(n)).

Original entry on oeis.org

1, 1, 2, 1, 2, 12, 1, 1, 2, 2, 12, 4, 1, 3, 4, 1, 2, 8, 4, 6, 4, 24, 6, 12, 3, 3, 2, 1, 4, 24, 1, 3, 2, 4, 12, 56, 4, 48, 2, 10, 4, 16, 24, 24, 2, 18, 120, 4, 1, 3, 6, 1, 6, 12, 1, 3, 4, 4, 24, 8, 1, 3, 2, 1, 2, 2, 4, 12, 4, 48, 6, 8, 28, 8, 24, 112, 6, 24, 8, 2, 4, 16, 24, 336, 8, 96, 12, 120, 6, 24, 4, 6, 8, 720, 6, 36, 3, 3, 2, 21, 6, 36, 3, 15, 14, 6
Offset: 0

Author

Antti Karttunen, Feb 15 2019

Keywords

Programs

  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
    A106737(n) = sum(k=0, n, (binomial(n+k, n-k)*binomial(n, k)) % 2);
    A324054(n) = { my(p=2,mp=p*p,m=1); while(n, if(!(n%2), p=nextprime(1+p); mp = p*p, if(3==(n%4),mp *= p,m *= (mp-1)/(p-1))); n>>=1); (m); };
    A324058(n) = gcd(A324054(n), A005940(1+n)*A106737(n));
    \\ Alternatively as:
    A324121(n) = gcd(sigma(n),n*numdiv(n));
    A324058(n) = A324121(A005940(1+n));

Formula

a(n) = A324121(A005940(1+n)) = gcd(A324054(n), A005940(1+n)*A106737(n)).
Previous Showing 11-20 of 114 results. Next