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.

A177720 Number of line segments connecting exactly 4 points in an n x n grid of points.

This page as a plain text file.
%I A177720 #6 Jul 22 2025 08:09:25
%S A177720 0,0,0,10,28,54,104,170,252,394,568,774,1068,1410,1800,2374,3028,3762,
%T A177720 4656,5646,6732,8190,9792,11538,13636,15910,18360,21334,24532,27954,
%U A177720 31856,36014,40428,45798,51504,57546,64228,71278,78696,87466,96700
%N A177720 Number of line segments connecting exactly 4 points in an n x n grid of points.
%C A177720 a(n) is also the number of pairs of points visible to each other exactly through 2 points in an n x n grid of points.
%H A177720 S. Mustonen, <a href="http://www.survo.fi/papers/LinesInGrid2.pdf">On lines going through a given number of points in a rectangular grid of points</a>
%H A177720 Seppo Mustonen, <a href="/A141255/a141255.pdf">On lines going through a given number of points in a rectangular grid of points</a> [Local copy]
%F A177720 See Mathematica code.
%t A177720 j=3;
%t A177720 a[n_]:=a[n]=If[n<=j,0,2*a1[n]-a[n-1]+R1[n]]
%t A177720 a1[n_]:=a1[n]=If[n<=j,0,2*a[n-1]-a1[n-1]+R2[n]]
%t A177720 R1[n_]:=R1[n]=If[n<=j,0,R1[n-1]+4*S[n]]
%t A177720 R2[n_]:=(n-1)*S[n]
%t A177720 S[n_]:=If[Mod[n-1,j]==0,EulerPhi[(n-1)/j],0]
%t A177720 Table[a[n],{n,1,50}]
%K A177720 nonn
%O A177720 1,4
%A A177720 _Seppo Mustonen_, May 13 2010