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-4 of 4 results.

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

Views

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

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

Original entry on oeis.org

1, 2, 5, 4, 8, 10, 11, 8, 20, 16, 17, 20, 20, 22, 42, 16, 26, 40, 29, 32, 58, 34, 35, 40, 53, 40, 74, 44, 44, 84, 47, 32, 90, 52, 94, 80, 56, 58, 106, 64, 62, 116, 65, 68, 174, 70, 71, 80, 102, 106, 138, 80, 80, 148, 146, 88, 154, 88, 89, 168, 92, 94, 241, 64, 172
Offset: 1

Views

Author

Ilya Gutkovskiy, Oct 07 2019

Keywords

Crossrefs

Programs

  • Magma
    a:=[]; for k in [1..65] do if IsOdd(k) then a[k]:=(k * #Divisors(k) + DivisorSigma(1,k)) / 2; else a[k]:=(k * (#Divisors(k) - #Divisors(k div 2)) + DivisorSigma(1,k) - DivisorSigma(1,k div 2)) / 2;  end if; end for; a; // Marius A. Burtea, Oct 07 2019
    
  • Mathematica
    nmax = 65; CoefficientList[Series[Sum[k x^k/(1 - x^(2 k))^2, {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    a[n_] := DivisorSum[n, (n Mod[#, 2] + Boole[OddQ[n/#]] #)/2 &]; Table[a[n], {n, 1, 65}]
  • PARI
    A328203(n) = if(n%2,(1/2)*(sigma(n)+(n*numdiv(n))),2*A328203(n/2)); \\ Antti Karttunen, Nov 13 2021

Formula

a(n) = (n * d(n) + sigma(n)) / 2 if n odd, (n * (d(n) - d(n/2)) + sigma(n) - sigma(n/2)) / 2 if n even.
a(n) = (n * A001227(n) + A002131(n)) / 2.
a(2*n) = 2 * a(n).
From Antti Karttunen, Nov 13 2021: (Start)
The following two convolutions were found by Jon Maiga's Sequence Machine search algorithm. Both are easy to prove:
a(n) = Sum_{d|n} A003602(d) * A026741(n/d).
a(n) = Sum_{d|n} A109168(d) * A193356(n/d), where A109168(d) = A140472(d) = (d+A006519(d))/2.
(End)

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

Original entry on oeis.org

1, 7, 15, 38, 40, 108, 77, 188, 180, 290, 187, 600, 260, 560, 630, 888, 442, 1323, 551, 1620, 1218, 1364, 805, 3024, 1325, 1898, 1998, 3136, 1276, 4680, 1457, 4080, 2970, 3230, 3290, 7470, 2072, 4028, 4134, 8200, 2542, 9072, 2795, 7656, 7830, 5888, 3337, 14496, 4998, 9825, 7038
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 14 2019

Keywords

Comments

Dirichlet convolution of triangular numbers (A000217) with squares (A000290).
a(n) is n times half m, where m is the sum of all parts plus the total number of parts of the partitions of n into equal parts. - Omar E. Pol, Nov 30 2019

Crossrefs

Programs

  • Magma
    [n*(n*NumberOfDivisors(n) + DivisorSigma(1,n))/2:n in [1..51]]; // Marius A. Burtea, Nov 29 2019
  • Maple
    with(numtheory): seq(n*(n*tau(n)+sigma(n))/2, n=1..50); # Ridouane Oudra, Nov 28 2019
  • Mathematica
    nmax = 51; CoefficientList[Series[Sum[k^2 x^k/(1 - x^k)^3, {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Table[DirichletConvolve[j (j + 1)/2, j^2, j, n], {n, 1, 51}]
    Table[n (n DivisorSigma[0, n] + DivisorSigma[1, n])/2, {n, 1, 51}]
  • PARI
    a(n)=sumdiv(n, d, binomial(n/d+1,2)*d^2); \\ Andrew Howroyd, Aug 14 2019
    
  • PARI
    a(n)=n*(n*numdiv(n) + sigma(n))/2; \\ Andrew Howroyd, Aug 14 2019
    

Formula

G.f.: Sum_{k>=1} (k*(k + 1)/2) * x^k * (1 + x^k)/(1 - x^k)^3.
a(n) = n * (n * d(n) + sigma(n))/2.
Dirichlet g.f.: zeta(s-2) * (zeta(s-2) + zeta(s-1))/2.
a(n) = n*(A038040(n) + A000203(n))/2 = n*A152211(n)/2. - Omar E. Pol, Aug 17 2019
a(n) = Sum_{k=1..n} k*sigma(gcd(n,k)). - Ridouane Oudra, Nov 28 2019

A308668 a(n) = Sum_{d|n} d^(n/d+n).

Original entry on oeis.org

1, 9, 82, 1089, 15626, 287010, 5764802, 135270401, 3487315843, 100244173394, 3138428376722, 107072686593858, 3937376385699290, 155601328490478978, 6568412173896940652, 295165920677390712833, 14063084452067724991010
Offset: 1

Views

Author

Seiichi Manyama, Jun 16 2019

Keywords

Crossrefs

Diagonal of A308502.

Programs

  • Mathematica
    a[n_] := DivisorSum[n, #^(n/# + n) &]; Array[a, 20] (* Amiram Eldar, Mar 17 2021 *)
  • PARI
    a(n) = sumdiv(n,d,d^(n/d+n));
    
  • PARI
    my(N=20, x='x+O('x^N)); Vec(x*deriv(-log(prod(k=1, N, (1-k*(k*x)^k)^(1/k)))))
    
  • PARI
    my(N=20, x='x+O('x^N)); Vec(sum(k=1, N, k^(k+1)*x^k/(1-k^(k+1)*x^k))) \\ Seiichi Manyama, Mar 17 2021
    
  • Python
    from sympy import divisors
    def A308668(n): return sum(d**(n//d+n) for d in divisors(n,generator=True)) # Chai Wah Wu, Jun 19 2022

Formula

L.g.f.: -log(Product_{k>=1} (1 - k*(k*x)^k)^(1/k)) = Sum_{k>=1} a(k)*x^k/k.
G.f.: Sum_{k>=1} k^(k+1) * x^k/(1 - k^(k+1) * x^k). - Seiichi Manyama, Mar 17 2021
a(n) ~ n^(n+1). - Vaclav Kotesovec, Aug 30 2025
Showing 1-4 of 4 results.