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.

A331761 a(n) = Sum_{i=1..n, j=1..n, gcd(i,j)=2} (n+1-i)*(n+1-j).

Original entry on oeis.org

0, 1, 4, 15, 32, 71, 124, 211, 320, 499, 716, 999, 1328, 1799, 2340, 3023, 3792, 4767, 5852, 7135, 8544, 10319, 12260, 14471, 16864, 19775, 22916, 26467, 30272, 34587, 39188, 44347, 49824, 56195, 62948, 70311, 78080, 86975
Offset: 1

Views

Author

N. J. A. Sloane, Feb 04 2020

Keywords

Crossrefs

Cf. A115004.
The main diagonal of A331762.

Programs

  • Mathematica
    Table[Sum[Boole[GCD[i, j] == 2] (n + 1 - i) (n + 1 - j), {i, n}, {j, n}], {n, 38}] (* Michael De Vlieger, Feb 04 2020 *)
  • Python
    from sympy import totient
    def A331761(n): return (n-1)**2 + 2*sum(totient(i)*(n+1-2*i)*(n+1-i) for i in range(2,n//2+1)) # Chai Wah Wu, Aug 16 2021

Formula

Conjecture: As n -> oo, a(n) ~ C*n^4/Pi^2, where C is about 0.3775. - N. J. A. Sloane, Jul 03 2020
a(n) = (n-1)^2 + 2*Sum_{i=2..floor(n/2)} (n+1-2*i)*(n+1-i)*phi(i). - Chai Wah Wu, Aug 16 2021