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.
%I A160847 #15 Nov 26 2017 09:52:48 %S A160847 0,1,51,100,181,274,405,536,709,894,1111,1330,1591,1858,2167,2482, %T A160847 2825,3180,3577,3974,4413,4860,5339,5824,6351,6884,7455,8032,8641, %U A160847 9262,9925,10584,11285,11998,12743,13494,14283,15078,15915,16758,17633,18516 %N A160847 Number of lines through at least 2 points of a 7 X n grid of points. %H A160847 Seiichi Manyama, <a href="/A160847/b160847.txt">Table of n, a(n) for n = 0..1000</a> %H A160847 S. Mustonen, <a href="http://www.survo.fi/papers/PointsInGrid.pdf">On lines and their intersection points in a rectangular grid of points</a> %F A160847 a(n) = (1/2)*(f(m,n,1)-f(m,n,2)) where f(m,n,k) = Sum((n - |kx|)*(m - |ky|)); -n < kx <n, -m < ky <m, (x,y)=1, m=7. %F A160847 For another more efficient formula, see Mathematica code below. %F A160847 Empirical g.f.: -x*(7*x^14 + 8*x^12 + 43*x^11 + 50*x^10 + 117*x^9 + 135*x^8 + 204*x^7 + 173*x^6 + 211*x^5 + 142*x^4 + 131*x^3 + 50*x^2 + 50*x + 1) / ((x - 1)^3*(x + 1)*(x^2 - x + 1)*(x^2 + 1)*(x^2 + x + 1)*(x^4 + x^3 + x^2 + x + 1)). - _Colin Barker_, May 24 2015 %t A160847 m=7; %t A160847 a[0]=0; a[1]=1; %t A160847 a[2]=m^2+2; %t A160847 a[3]=2*m^2+3-Mod[m,2]; %t A160847 a[n_]:=a[n]=2*a[n-1]-a[n-2]+2*p1[m,n]+2*p4[m,n] %t A160847 p1[m_,n_]:=Sum[p2[m,n,y], {y,1,m-1}] %t A160847 p2[m_,n_,y_]:=If[GCD[y,n-1]==1,m-y,0] %t A160847 p[i_]:=If[i>0,i,0] %t A160847 p2[m_,n_,x_,y_]:=p2[m,n,x,y]=(n-x)*(m-y)-p[n-2*x]*p[m-2*y] %t A160847 p3[m_,n_,x_,y_]:=p2[m,n,x,y]-2*p2[m,n-1,x,y]+p2[m,n-2,x,y] %t A160847 p4[m_,n_]:=p4[m,n]=If[Mod[n,2]==0,0,p42[m,n]] %t A160847 p42[m_,n_]:=p42[m,n]=Sum[p43[m,n,y], {y,1,m-1}] %t A160847 p43[m_,n_,y_]:=If[GCD[(n-1)/2,y]==1,p3[m,n,(n-1)/2,y],0] %t A160847 Table[a[n],{n,0,41}] %K A160847 nonn %O A160847 0,3 %A A160847 _Seppo Mustonen_, May 28 2009