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

A055155 a(n) = Sum_{d|n} gcd(d, n/d).

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 6, 5, 4, 2, 8, 2, 4, 4, 10, 2, 10, 2, 8, 4, 4, 2, 12, 7, 4, 8, 8, 2, 8, 2, 14, 4, 4, 4, 20, 2, 4, 4, 12, 2, 8, 2, 8, 10, 4, 2, 20, 9, 14, 4, 8, 2, 16, 4, 12, 4, 4, 2, 16, 2, 4, 10, 22, 4, 8, 2, 8, 4, 8, 2, 30, 2, 4, 14, 8, 4, 8, 2, 20, 17, 4, 2, 16, 4, 4, 4, 12, 2, 20, 4, 8, 4, 4
Offset: 1

Views

Author

Leroy Quet, Jul 02 2000

Keywords

Comments

a(n) is odd iff n is odd square. - Vladeta Jovovic, Aug 27 2002
From Robert Israel, Dec 26 2015: (Start)
a(n) >= A000005(n), with equality iff n is squarefree (i.e., is in A005117).
a(n) = 2 iff n is prime. (End)

Examples

			a(9) = gcd(1,9) + gcd(3,3) + gcd(9,1) = 5, since 1, 3, 9 are the positive divisors of 9.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get a(1) to a(N)
    V:= Vector(N):
    for k from 1 to N do
       for j from 1 to floor(N/k) do
         V[k*j]:= V[k*j]+igcd(k,j)
       od
    od:
    convert(V,list); # Robert Israel, Dec 26 2015
  • Mathematica
    Table[DivisorSum[n, GCD[#, n/#] &], {n, 94}] (* Michael De Vlieger, Sep 23 2017 *)
    f[p_, e_] := If[EvenQ[e], (p^(e/2)*(p+1)-2)/(p-1), 2*(p^((e+1)/2)-1)/(p-1)]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Sep 30 2020 *)
  • PARI
    a(n) = sumdiv(n, d, gcd(d, n/d)); \\ Michel Marcus, Aug 03 2016
    
  • Python
    from sympy import divisors, gcd
    def A055155(n): return sum(gcd(d,n//d) for d in divisors(n,generator=True)) # Chai Wah Wu, Aug 19 2021

Formula

Multiplicative with a(p^e) = (p^(e/2)*(p+1)-2)/(p-1) for even e and a(p^e) = 2*(p^((e+1)/2)-1)/(p-1) for odd e. - Vladeta Jovovic, Nov 01 2001
Dirichlet g.f.: (zeta(s))^2*zeta(2s-1)/zeta(2s); inverse Mobius transform of A000188. - R. J. Mathar, Feb 16 2011
Dirichlet convolution of A069290 and A008966. - R. J. Mathar, Oct 31 2011
Sum_{k=1..n} a(k) ~ 3*n / (2*Pi^6) * (Pi^4 * log(n)^2 + ((8*g - 2)*Pi^4 - 24 * Pi^2 * z1) * log(n) + 2*Pi^4 * (1 - 4*g + 5*g^2 - 6*sg1) + 288 * z1^2 - 24 * Pi^2 * (-z1 + 4*g*z1 + z2)), where g is the Euler-Mascheroni constant A001620, sg1 is the first Stieltjes constant A082633, z1 = Zeta'(2) = A073002, z2 = Zeta''(2) = A201994. - Vaclav Kotesovec, Feb 01 2019
a(n) = (1/n)*Sum_{i=1..n} sigma(gcd(n,i^2)). - Ridouane Oudra, Dec 30 2020
a(n) = Sum_{k=1..n} gcd(gcd(n,k),n/gcd(n,k))/phi(n/gcd(n,k)), where phi = A000010. - Richard L. Ollerton, May 09 2021

A061884 a(n) = Sum_{ d | n } phi(lcm(d,n/d)), where phi(n) = Euler totient A000010.

Original entry on oeis.org

1, 2, 4, 5, 8, 8, 12, 12, 14, 16, 20, 20, 24, 24, 32, 26, 32, 28, 36, 40, 48, 40, 44, 48, 44, 48, 48, 60, 56, 64, 60, 56, 80, 64, 96, 70, 72, 72, 96, 96, 80, 96, 84, 100, 112, 88, 92, 104, 90, 88, 128, 120, 104, 96, 160, 144, 144, 112, 116, 160, 120, 120, 168, 116, 192
Offset: 1

Views

Author

Vladeta Jovovic, May 12 2001

Keywords

Crossrefs

Programs

  • Maple
    A061884 := proc(n) local b,d: b := 0; for d from 1 to n do if irem(n,d)=0 then b := b+phi(lcm(d,n/d)); fi; od; RETURN(b); end:
  • Mathematica
    Table[Plus @@ Map[ EulerPhi[LCM[ #, n/# ]] &, Select[ Range@n, (Mod[n, # ] == 0) &]], {n, 65}] (* Robert G. Wilson v, Sep 30 2006 *)
  • PARI
    a(n)=sumdiv(n,d,eulerphi(lcm(d,n/d))) \\ Charles R Greathouse IV, Feb 21 2013

A332619 a(n) = Sum_{d|n} lcm(d, n/d) / d.

Original entry on oeis.org

1, 3, 4, 6, 6, 12, 8, 12, 11, 18, 12, 24, 14, 24, 24, 23, 18, 33, 20, 36, 32, 36, 24, 48, 27, 42, 32, 48, 30, 72, 32, 45, 48, 54, 48, 66, 38, 60, 56, 72, 42, 96, 44, 72, 66, 72, 48, 92, 51, 81, 72, 84, 54, 96, 72, 96, 80, 90, 60, 144, 62, 96, 88, 88, 84, 144, 68, 108, 96, 144
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 17 2020

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> add(d/igcd(d, n/d), d=numtheory[divisors](n)):
    seq(a(n), n=1..80);  # Alois P. Heinz, Feb 17 2020
  • Mathematica
    Table[Sum[LCM[d, n/d]/d, {d, Divisors[n]}], {n, 1, 70}]
    f[p_, e_] := If[EvenQ[e], (p^(e + 2) - 1)/(p^2 - 1) + e/2, (p^(e + 2) - p)/(p^2 - 1) + (e + 1)/2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Dec 05 2022 *)
  • PARI
    A332619(n) = sumdiv(n,d,lcm(d,n/d)/d); \\ Antti Karttunen, Nov 12 2021

Formula

a(n) = Sum_{d|n} d / gcd(d, n/d).
From Amiram Eldar, Dec 05 2022: (Start)
Multiplicative with a(p^e) = (p^(e+2)-1)/(p^2-1) + e/2 if e is even, and (p^(e+2)-p)/(p^2-1) + (e + 1)/2 if e is odd.
Sum_{k=1..n} a(k) ~ c * n^2, where c = 7*zeta(6)/(8*zeta(5)) = 0.740543... . (End)

A345302 a(n) = Sum_{p|n, p prime} lcm(p,n/p).

Original entry on oeis.org

0, 2, 3, 2, 5, 12, 7, 4, 3, 20, 11, 18, 13, 28, 30, 8, 17, 24, 19, 30, 42, 44, 23, 36, 5, 52, 9, 42, 29, 90, 31, 16, 66, 68, 70, 30, 37, 76, 78, 60, 41, 126, 43, 66, 60, 92, 47, 72, 7, 60, 102, 78, 53, 72, 110, 84, 114, 116, 59, 150, 61, 124, 84, 32, 130, 198, 67, 102, 138, 210
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 13 2021

Keywords

Comments

If p is prime, a(p) = Sum_{p|p} lcm(p,p/p) = p.

Examples

			a(12) = Sum_{p|12} lcm(p,12/p) = lcm(2,6) + lcm(3,4) = 6 + 12 = 18.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[LCM[k, n/k] (PrimePi[k] - PrimePi[k - 1]) (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 100}]

Formula

a(p^k) = p^(k-1+floor(1/k)) for p prime and k>=1. - Wesley Ivan Hurt, Jul 09 2025

A332618 a(n) = Sum_{d|n} lcm(d, n/d) / gcd(d, n/d).

Original entry on oeis.org

1, 4, 6, 9, 10, 24, 14, 20, 19, 40, 22, 54, 26, 56, 60, 41, 34, 76, 38, 90, 84, 88, 46, 120, 51, 104, 60, 126, 58, 240, 62, 84, 132, 136, 140, 171, 74, 152, 156, 200, 82, 336, 86, 198, 190, 184, 94, 246, 99, 204, 204, 234, 106, 240, 220, 280, 228, 232, 118, 540
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 17 2020

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> n*add(1/igcd(d, n/d)^2, d=numtheory[divisors](n)):
    seq(a(n), n=1..80);  # Alois P. Heinz, Feb 17 2020
  • Mathematica
    Table[Sum[LCM[d, n/d]/GCD[d, n/d], {d, Divisors[n]}], {n, 1, 60}]
    f[p_, e_] := If[EvenQ[e], (2*p^(e+2) - p^2 - 1)/(p^2 - 1), 2*(p^(e+2) - p)/(p^2 - 1)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Dec 05 2022 *)
  • PARI
    A332618(n) = sumdiv(n,d,lcm(d,n/d)/gcd(d,n/d)); \\ Antti Karttunen, Nov 12 2021

Formula

a(n) = n * Sum_{d|n} 1 / gcd(d, n/d)^2.
Multiplicative with a(p^e) = (2*p^(e+2) - p^2 - 1)/(p^2 - 1) if e is even, a(p^e) = 2*(p^(e+2) - p)/(p^2 - 1) if e is odd. - Sebastian Karlsson, May 07 2022
From Peter Bala, Jan 24 2024: (Start)
a(n) = Sum_{d divides n} A007913(d)*n/d.
Dirichlet g.f.: zeta(2*s)*zeta(s-1)^2/zeta(2*s-2). (End)

A353776 a(n) = Sum_{d|n} (n/d mod d).

Original entry on oeis.org

0, 1, 1, 1, 1, 4, 1, 3, 1, 4, 1, 7, 1, 4, 6, 3, 1, 7, 1, 8, 5, 4, 1, 14, 1, 4, 4, 10, 1, 14, 1, 7, 6, 4, 8, 11, 1, 4, 5, 17, 1, 16, 1, 10, 13, 4, 1, 19, 1, 9, 6, 8, 1, 16, 7, 17, 5, 4, 1, 32, 1, 4, 13, 7, 9, 19, 1, 8, 6, 23, 1, 27, 1, 4, 10, 10, 12, 16, 1, 23
Offset: 1

Views

Author

Sebastian Karlsson, May 07 2022

Keywords

Crossrefs

Programs

  • Haskell
    import Math.NumberTheory.ArithmeticFunctions
    a n = sum $ map (\d -> n `quot` d `rem` d) $ divisorsList n
    
  • Mathematica
    a[n_] := DivisorSum[n, Mod[n/#, #] &]; Array[a, 100] (* Amiram Eldar, May 07 2022 *)
  • PARI
    A353776(n) = sumdiv(n,d,((n/d)%d)); \\ Antti Karttunen, May 08 2022
Showing 1-6 of 6 results.