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

A344598 a(n) = Sum_{k=1..n} phi(k) * (floor(n/k)^2 - floor((n-1)/k)^2).

Original entry on oeis.org

1, 4, 7, 12, 13, 24, 19, 32, 33, 44, 31, 68, 37, 64, 75, 80, 49, 108, 55, 124, 109, 104, 67, 176, 105, 124, 135, 180, 85, 240, 91, 192, 177, 164, 199, 300, 109, 184, 211, 320, 121, 348, 127, 292, 333, 224, 139, 432, 217, 340, 279, 348, 157, 432, 323, 464, 313, 284, 175, 660, 181
Offset: 1

Views

Author

Seiichi Manyama, May 24 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[EulerPhi[k] * First @ Differences @ (Quotient[{n - 1, n}, k]^2), {k, 1, n}]; Array[a, 50] (* Amiram Eldar, May 24 2021 *)
  • PARI
    a(n) = sum(k=1, n, eulerphi(k)*((n\k)^2-((n-1)\k)^2));
    
  • PARI
    my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, eulerphi(k)*x^k*(1+x^k)/(1-x^k)^2))

Formula

Sum_{k=1..n} a(k) = A018806(n).
G.f.: Sum_{k>=1} phi(k) * x^k * (1 + x^k)/(1 - x^k)^2.
Conjecture: a(n) = Sum_{k = 1..2*n} (-1)^k * gcd(k, 4*n). Cf. A344372. - Peter Bala, Jan 01 2024

A345754 Number of 2 X 2 matrices over Z_n whose permanent equals their determinant.

Original entry on oeis.org

1, 16, 45, 192, 225, 720, 637, 2048, 1701, 3600, 2541, 8640, 4225, 10192, 10125, 20480, 9537, 27216, 13357, 43200, 28665, 40656, 23805, 92160, 40625, 67600, 59049, 122304, 47937, 162000, 58621, 196608, 114345, 152592, 143325, 326592, 99937, 213712, 190125
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] =  Sum[If[Mod[Permanent[{{a, b}, {c, d}}] - Det[{{a, b}, {c, d}}],n] == 0, 1, 0], {a, 0, n - 1}, {b, 0, n - 1}, {c, 0, n - 1}, {d,0, n - 1}] ; Array[a,22]
    f[p_, e_] := p^(3*e - 1)*((p - 1)*e + p); f[2, e_] := (e + 1)*8^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 50] (* Amiram Eldar, Dec 06 2022 *)

Formula

a(n) = A344372(n) * n^2 (conjectured).
From Sebastian Karlsson, Aug 31 2021: (Start)
The formula is correct. Proof:
Let A = ([a, b], [c, d]) be an arbitrary 2 X 2 matrix over Z_n. So det(A) = a*d - b*c and perm(A) = a*d + b*c. Then, det(A) = perm(A) iff -b*c = b*c, i.e., 2*b*c = 0.
Suppose first that n is odd. Then 2*b*c = 0 iff b*c = 0. The number of solutions to this equation over Z_n is A018804(n). Furthermore, the value of a and b in A can be anything, so there are n possible choices for a and n possible choices for b. Thus, there are n*n*A018804(n) = n^2 * A344372(n) matrices A over Z_n such that det(A) = perm(A).
Suppose now that n is even. Then 2*b*c = 0 in Z_n iff b'*c' = 0 in Z_{n/2}, where b' and c' are b and c reduced modulo n/2. The latter equation has A018804(n/2) distinct solutions in Z_{n/2}. As the preimage of both b' and c' contains precisely 2 elements each, the number of solutions to 2*b*c = 0 in Z_n is 2*2*A018804(n/2). Hence, a(n) = n*n*4*A018804(n/2) = n^2 * A344372(n). Q.E.D.
The formula implies that the sequence is multiplicative with a(2^e) = (e+1)*8^e, a(p^e) = p^(3*e-1)*((p-1)*e+p) for odd primes p. (End)

A368624 a(n) = Sum_{k = 1..n} (-1)^(n+k) * gcd(2*k, n).

Original entry on oeis.org

1, 0, 3, 4, 5, 0, 7, 16, 9, 0, 11, 20, 13, 0, 15, 48, 17, 0, 19, 36, 21, 0, 23, 80, 25, 0, 27, 52, 29, 0, 31, 128, 33, 0, 35, 84, 37, 0, 39, 144, 41, 0, 43, 84, 45, 0, 47, 240, 49, 0, 51, 100, 53, 0, 55, 208, 57, 0, 59, 180, 61, 0, 63, 320, 65, 0, 67, 132, 69, 0
Offset: 1

Views

Author

Peter Bala, Jan 01 2024

Keywords

Crossrefs

Programs

  • Maple
    seq(add((-1)^(n+k) * gcd(2*k, n), k = 1..n), n = 1..70)
  • Mathematica
    Table[Sum[(-1)^(n+k) GCD[2k,n],{k,n}],{n,70}] (* Harvey P. Dale, Jun 16 2024 *)

Formula

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

A368739 a(n) = Sum_{k = 1..n} gcd(4*k, n).

Original entry on oeis.org

1, 4, 5, 16, 9, 20, 13, 48, 21, 36, 21, 80, 25, 52, 45, 128, 33, 84, 37, 144, 65, 84, 45, 240, 65, 100, 81, 208, 57, 180, 61, 320, 105, 132, 117, 336, 73, 148, 125, 432, 81, 260, 85, 336, 189, 180, 93, 640, 133, 260, 165, 400, 105, 324, 189, 624, 185, 228, 117, 720, 121, 244, 273, 768
Offset: 1

Views

Author

Peter Bala, Jan 07 2024

Keywords

Crossrefs

Programs

  • Maple
    seq(add(gcd(4*k, n), k = 1..n), n = 1..70);
    # alternative faster program for large n
    with(numtheory): seq(add(gcd(4,d)*phi(d)*n/d, d in divisors(n)), n = 1..70);
  • Mathematica
    Table[Sum[GCD[4*k, n], {k, 1, n}], {n, 1, 100}] (* Vaclav Kotesovec, Jan 12 2024 *)

Formula

a(4*n) = 16*A018804(n); a(4*n+2) = 4*A018804(2*n+1); a(4*n+r) = A018804(4*n+r) for r = 1 and 3.
a(n) = Sum_{d divides n} gcd(4, d)*phi(d)*n/d, where phi(n) = A000010(n)
Multiplicative: a(2^k) = k*2^(k+1) for k >= 1; for odd prime p, a(p^k) = (k + 1)*p^k - k*p^(k-1).
Define D(n) = Sum_{d divides n} a(d). Then
D(4*n+r) = (4*n + r)*tau(4*n+r) for r = 1 and r = 3, where tau(n) = A000005(n), the number of divisors of n.
D(4*n+2) = (5/4)*(4*n + 2)*tau(4*n+2).
The sequence defined for n >= 1 by u(n) = (1/4)*( D(4*n) - D(n) ) begins {5, 16, 30, 44, 50, 96, 70, 112, 135, 160, 110, 264, 130, 224, 300, 272, 170, 432, 190, 440, 420, 352, ...} and appears to be multiplicative: that is, u(1)*u(n*m) = u(n)*u(m) for n and m coprime.
Dirichlet g.f.: (1 + 4/4^s)/(1 - 1/2^s) * zeta(s-1)^2/zeta(s).
Sum_{k=1..n} a(k) ~ n^2 * (5*log(n) - 5/2 + 10*gamma - 11*log(2)/3 - 30*zeta'(2)/Pi^2) / Pi^2, where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Jan 12 2024

A368740 a(n) = Sum_{k = 1..n} gcd(5*k, n).

Original entry on oeis.org

1, 3, 5, 8, 25, 15, 13, 20, 21, 75, 21, 40, 25, 39, 125, 48, 33, 63, 37, 200, 65, 63, 45, 100, 225, 75, 81, 104, 57, 375, 61, 112, 105, 99, 325, 168, 73, 111, 125, 500, 81, 195, 85, 168, 525, 135, 93, 240, 133, 675, 165, 200, 105, 243, 525, 260, 185, 171, 117, 1000, 121, 183, 273, 256, 625
Offset: 1

Views

Author

Peter Bala, Jan 07 2024

Keywords

Comments

a(n) equals the number of solutions to the congruence 5*x*y == 0 (mod n) for 1 <= x, y <= n.

Examples

			a(10) = 75: each of the 100 pairs (x, y), 1 <= x, y <= 10, is a solution to the congruence 5*x*y == 0 (mod 10) except for the 25 pairs (x, y) with both x and y odd.
		

Crossrefs

Programs

  • Maple
    seq(add(gcd(5*k, n), k = 1..n), n = 1..70);
    # alternative faster program for large n
    with(numtheory): seq(add(gcd(5,d)*phi(d)*n/d, d in divisors(n)), n = 1..70);
  • Mathematica
    Table[Sum[GCD[5*k, n], {k, 1, n}], {n, 1, 100}] (* Vaclav Kotesovec, Jan 12 2024 *)

Formula

a(5*n) = 25*A018804(n); a(5*n+r) = A018804(5*n+r) for 1 <= r <= 4.
a(n) = Sum_{d divides n} gcd(5, d)*phi(d)*n/d, where phi(n) = A000010(n).
Multiplicative: a(5^k) = (4*k + 1)*5^k and for prime p not equal to 5, a(p^k) = (k + 1)*p^k - k*p^(k-1).
Define D(n) = Sum_{d divides n} a(d). Then
D(5*n+r) = (5*n + r)*tau(5*n+r) for 1 <= r <= 4, where tau(n) = A000005(n), the number of divisors of n.
The sequence {(1/25)*( D(5*n) - D(n) ) : n >= 1} begins {1, 4, 6, 12, 9, 24, 14, 32, 27, 36, 22, 72, 26, 56, 54, 80, 34, 108, 38, 108, 84, 88, ...} and appears to be multiplicative.
Dirichlet g.f.: (1 + 15/5^s)/(1 - 1/5^s) * zeta(s-1)^2/zeta(s).
Sum_{k=1..n} a(k) ~ n^2 * (5*log(n) - 5/2 + 10*gamma - 25*log(5)/12 - 30*zeta'(2)/Pi^2) / Pi^2, where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Jan 12 2024
Previous Showing 11-15 of 15 results.