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.

A290132 The number of edges in a graph induced by a regular drawing of K_{n,n}.

Original entry on oeis.org

1, 6, 24, 74, 170, 362, 642, 1110, 1766, 2706, 3894, 5558, 7602, 10326, 13562, 17510, 22178, 28006, 34634, 42722, 51922, 62570, 74450, 88462, 103994, 121862, 141482, 163610, 187886, 215578, 245430, 279198, 315958, 356390, 399830, 447542, 498626, 555278, 615698, 681206
Offset: 1

Views

Author

R. J. Mathar, Jul 20 2017

Keywords

Crossrefs

Programs

  • Maple
    A290132 := proc(n)
        2*n+A290131(n)+A159065(n)-1 ;
    end proc:
    seq(A290132(n),n=1..40);
  • Mathematica
    b[n_] := Sum[(n-i+1)(n-j+1) Boole[GCD[i, j] == 1], {i, n}, {j, n}];
    A290131[n_] := b[n-1] + (n-1)^2;
    A159065[n_] := Module[{x, y, s1 = 0, s2 = 0}, For[x = 1, x <= n - 1, x++, For[y = 1, y <= n - 1, y++, If[GCD[x, y] == 1, s1 += (n - x)(n - y); If[2x <= n - 1 && 2y <= n - 1, s2 += (n - 2x)(n - 2y)]]]]; s1 - s2];
    a[n_] := 2n + A290131[n] + A159065[n] - 1;
    Table[a[n], {n, 1, 40}] (* Jean-François Alcover, May 24 2023, after Joerg Arndt in A159065 *)
  • Python
    from math import gcd
    def a115004(n):
        r=0
        for a in range(1, n + 1):
            for b in range(1, n + 1):
                if gcd(a, b)==1:r+=(n + 1 - a)*(n + 1 - b)
        return r
    def a159065(n):
        c=0
        for a in range(1, n):
            for b in range(1, n):
                if gcd(a, b)==1:
                    c+=(n - a)*(n - b)
                    if 2*aIndranil Ghosh, Jul 20 2017

Formula

a(n) = 2*n + A290131(n) + A159065(n) - 1.