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.

A177723 Number of line segments connecting exactly 7 points in an n X n grid of points.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 16, 40, 72, 112, 160, 216, 308, 416, 540, 680, 836, 1008, 1276, 1576, 1908, 2272, 2668, 3096, 3660, 4272, 4932, 5640, 6396, 7200, 8308, 9496, 10764, 12112, 13540, 15048, 16788, 18624, 20556, 22584, 24708, 26928, 29772, 32760
Offset: 1

Views

Author

Seppo Mustonen, May 13 2010

Keywords

Comments

a(n) is also the number of pairs of points visible to each other exactly through 5 points in an n X n grid of points.

Programs

  • Mathematica
    j=6;
    a[n_]:=a[n]=If[n<=j,0,2*a1[n]-a[n-1]+R1[n]]
    a1[n_]:=a1[n]=If[n<=j,0,2*a[n-1]-a1[n-1]+R2[n]]
    R1[n_]:=R1[n]=If[n<=j,0,R1[n-1]+4*S[n]]
    R2[n_]:=(n-1)*S[n]
    S[n_]:=If[Mod[n-1,j]==0,EulerPhi[(n-1)/j],0]
    Table[a[n],{n,1,50}]

Formula

See Mathematica code.