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.

A344372 a(n) = Sum_{k = 1..n} gcd(2*k, n).

Original entry on oeis.org

1, 4, 5, 12, 9, 20, 13, 32, 21, 36, 21, 60, 25, 52, 45, 80, 33, 84, 37, 108, 65, 84, 45, 160, 65, 100, 81, 156, 57, 180, 61, 192, 105, 132, 117, 252, 73, 148, 125, 288, 81, 260, 85, 252, 189, 180, 93, 400, 133, 260, 165, 300, 105, 324, 189, 416, 185, 228, 117, 540, 121, 244, 273
Offset: 1

Views

Author

Max Alekseyev, May 16 2021

Keywords

Comments

For all n, a(n) >= 2*n - 1, where the equality holds if n is 1 or an odd prime.
a(n) equals the number of solutions to the congruence 2*x*y == 0 (mod n) for 1 <= x, y <= n. - Peter Bala, Jan 11 2024

Examples

			a(6) = 20: the 20 solutions to the congruence 2*x*y == 0 (mod 6) for 1 <= x, y <= 6 are the pairs (x, y) = (k, 6) for 1 <= k <= 6, the pairs (6, k) for 1 <= k <= 5, the pairs (3, k) for 1 <= k <= 5 and the pairs (1, 3), (2, 3), (4, 3) and (5, 3). - _Peter Bala_, Jan 11 2024
		

Crossrefs

Negated bisection of A199084.

Programs

  • Maple
    seq(add((-1)^k*gcd(k, 2*n), k = 1..2*n), n = 1..70);
    # alternative faster program for large n
    with(numtheory): seq(add(gcd(2,d)*phi(d)*n/d, d in divisors(n)), n = 1..70); # Peter Bala, Jan 08 2024
  • Mathematica
    f[p_, e_] := (e + 1)*p^e - e*p^(e - 1); f[2, e_] := (e + 1)*2^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 20 2022 *)
    Table[Sum[GCD[2*k, n], {k, 1, n}], {n, 1, 60}] (* or *)
    Table[Sum[(-1)^k * GCD[k, 2*n], {k, 1, 2*n}], {n, 1, 60}] (* Vaclav Kotesovec, Jan 13 2024 *)
  • PARI
    { A344372(n) = my(f=factor(n)); prod(i=1,#f~, (f[i,2]+1)*f[i,1]^f[i,2] - if(f[i,1]>2,f[i,2]*f[i, 1]^(f[i,2]-1)) ); }
    
  • PARI
    a(n) = sum(k=1, 2*n, (-1)^k*gcd(k,2*n)); \\ Michel Marcus, May 17 2021

Formula

a(n) = Sum_{k = 1..2*n} (-1)^k * gcd(k,2*n).
a(n) is multiplicative with a(2^d) = (d+1)*2^d, and a(p^d) = (d+1)*p^d - d*p^(d-1) for an odd prime p, d >= 1.
a(n) = A344371(2*n) = -A199084(2*n) = 2*n - A106475(n-1).
a(n) = A018804(n) if n is odd, 4*A018804(n/2) if n is even. - Sebastian Karlsson, Aug 31 2021
From Peter Bala, Jan 11 2023: (Start)
a(n) = Sum_{d divides n} phi(2*d)*n/d, where phi(n) = A000010(n).
a(n) = - A332794(2*n); a(2*n+1) = A368736(2*n+1).
Dirichlet g.f.: 1/(1 - 1/2^s) * zeta(s-1)^2/zeta(s).
Define D(n) = Sum_{d divides n} a(d). Then
D(2*n+1) = (2*n + 1)*tau(2*n+1), where tau(n) = A000005(n), the number of divisors of n.
The sequence {(1/4)*( D(2*n) - D(n) ) : n >= 1} begins {1, 3, 6, 8, 10, 18, 14, 20, 27, 30, 22, 48, 26, 42, 60, 48, 34, 81, 38, 80, 84, 66, ...} and appears to be multiplicative. (End)
Sum_{k=1..n} a(k) ~ 4*n^2 * (log(n) - 1/2 + 2*gamma - log(2)/3 - 6*zeta'(2)/Pi^2) / Pi^2, where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Jan 12 2024

Extensions

New name according to the formula by Peter Bala from Vaclav Kotesovec, Jan 13 2024

A062803 Number of solutions to x^2 == y^2 (mod n).

Original entry on oeis.org

1, 2, 5, 8, 9, 10, 13, 24, 21, 18, 21, 40, 25, 26, 45, 64, 33, 42, 37, 72, 65, 42, 45, 120, 65, 50, 81, 104, 57, 90, 61, 160, 105, 66, 117, 168, 73, 74, 125, 216, 81, 130, 85, 168, 189, 90, 93, 320, 133, 130, 165, 200, 105, 162, 189, 312, 185, 114, 117, 360, 121, 122, 273
Offset: 1

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 19 2001

Keywords

Crossrefs

Programs

  • Mathematica
    f[2, e_] := e*2^e; f[p_, e_] := ((p-1)*e+p)*p^(e-1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 10 2020 *)

Formula

a(n) is multiplicative and, for an odd prime p, a(p) = 2*p - 1.
Multiplicative with a(2^e)=e*2^e and a(p^e)=((p-1)*e+p)*p^(e-1) for an odd prime p. - Vladeta Jovovic, Sep 22 2003
From Ridouane Oudra, Jun 17 2025: (Start)
a(n) = (-1)^n*gcd(n,2)*Sum_{d|n} (-1)^d*d*phi(n/d).
a(n) = A327767(n)*A332794(n).
a(2*n) = 2*A344372(n).
a(2*n+1) = A332794(2*n+1). (End)

Extensions

More terms from Vladeta Jovovic, Sep 22 2003

A368929 Dirichlet g.f.: zeta(s-2)^2 * (1 - 2^(3-s)) / zeta(s).

Original entry on oeis.org

1, -1, 17, -16, 49, -17, 97, -112, 225, -49, 241, -272, 337, -97, 833, -640, 577, -225, 721, -784, 1649, -241, 1057, -1904, 1825, -337, 2673, -1552, 1681, -833, 1921, -3328, 4097, -577, 4753, -3600, 2737, -721, 5729, -5488, 3361, -1649, 3697, -3856, 11025, -1057, 4417
Offset: 1

Views

Author

Vaclav Kotesovec, Jan 12 2024

Keywords

Comments

Dirichlet convolution of A007434 and A162395.

Crossrefs

Programs

  • Mathematica
    Table[Sum[Sum[d^2 * MoebiusMu[k/d], {d, Divisors[k]}] * (-1)^(n/k + 1) * n^2/k^2, {k, Divisors[n]}], {n, 1, 100}]
    f[p_, e_] := p^(2*e)*(1 + e*(1 - 1/p^2)); f[2, e_] := -(3*e - 2)*2^(2*e - 2); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 12 2024 *)
  • PARI
    a(n) = {my(f = factor(n), p, e); prod(i = 1, #f~, p = f[i, 1]; e = f[i, 2]; if(p == 2, -(3*e-2)*2^(2*e-2), p^(2*e)*(1 + e*(1-1/p^2))));} \\ Amiram Eldar, Jan 12 2024

Formula

Sum_{k=1..n} a(k) ~ log(2) * n^3 / (3*zeta(3)).
Multiplicative with a(2^e) = -(3*e-2)*2^(2*e-2), and a(p^e) = p^(2*e)*(1 + e*(1-1/p^2)) for an odd prime p. - Amiram Eldar, Jan 12 2024

A369101 Dirichlet g.f.: zeta(s-3)^2 * (1 - 2^(4-s)) / zeta(s).

Original entry on oeis.org

1, -1, 53, -64, 249, -53, 685, -960, 2133, -249, 2661, -3392, 4393, -685, 13197, -11264, 9825, -2133, 13717, -15936, 36305, -2661, 24333, -50880, 46625, -4393, 76545, -43840, 48777, -13197, 59581, -118784, 141033, -9825, 170565, -136512, 101305, -13717, 232829
Offset: 1

Views

Author

Vaclav Kotesovec, Jan 13 2024

Keywords

Comments

In general, for k > 0, if Dirichlet g.f. is zeta(s-k)^2 * (1 - 2^(k+1-s)) / zeta(s), then a(n) ~ log(2) * n^(k+1) / ((k+1) * zeta(k+1)).

Crossrefs

Cf. A048272 (k=0), A332794 (k=1), A368929 (k=2).

Programs

  • Mathematica
    Table[Sum[DivisorSum[k, #^3*MoebiusMu[k/#]&]*(-1)^(n/k+1)*(n/k)^3, {k, Divisors[n]}], {n, 1, 50}]
    f[p_, e_] := p^(3*e-3) * (1 + (e+1)*(p^3-1)); f[2, e_] := -(7*e-6)*8^(e-1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 13 2024 *)
  • PARI
    a(n) = {my(f = factor(n), p, e); prod(i = 1, #f~, p = f[i,1]; e=f[i,2]; if(p == 2, -(7*e-6)*8^(e-1), p^(3*e-3) * (1 + (e+1)*(p^3-1))));} \\ Amiram Eldar, Jan 13 2024

Formula

Sum_{k=1..n} a(k) ~ 45 * log(2) * n^4 / (2*Pi^4).
Multiplicative with a(2^e) = -(7*e-6)*8^(e-1), and a(p^e) = p^(3*e-3) * (1 + (e+1)*(p^3-1)) for an odd prime p. - Amiram Eldar, Jan 13 2024
Showing 1-4 of 4 results.