login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A018808 Number of lines through at least 2 points of an n X n grid of points. 3
0, 0, 6, 20, 62, 140, 306, 536, 938, 1492, 2306, 3296, 4722, 6460, 8830, 11568, 14946, 18900, 23926, 29544, 36510, 44388, 53586, 63648, 75674, 88948, 104374, 121032, 139966, 160636, 184466, 209944, 239050, 270588, 305478, 342480, 383370, 427020 (list; graph; refs; listen; history; internal format)
OFFSET

0,3

LINKS

T. D. Noe, Table of n, a(n) for n=0..100

S. Mustonen, On lines and their intersection points in a rectangular grid of points [From Seppo Mustonen (seppo.mustonen(AT)helsinki.fi), Apr 18 2009]

FORMULA

(1/2) * (f(n, 1) - f(n, 2)) where f(n, k) = Sum ((n - |x|)(n - |y|)); -n<x<n, -n<y<n, (x, y)=k.

(1/2) * (f(n, 1) - f(n, 2)) where f(n, k) = Sum ((n - |kx|)(n - |ky|)); -n<kx<n, -n<ky<n, (x, y)=1. [From Seppo Mustonen (seppo.mustonen(AT)helsinki.fi), Apr 18 2009]

a[0]=L(0,1)=R1(0)=0, a(n)=L(n,n)=2L(n-1,n)-L(n-1,n-1)+R1(n), L(n-1,n)=2L(n-1,n-1)-L(n-2,n-1)+R2(n), R1(n)=R1(n-1)+4(phi(n-1)-e(n)), e(n)=0, n even, e(n)=phi((n-1)/2), n odd, R2(n)=(n-1)phi(n-1), n even, R2(n)=(n-1)phi(n-1)/2, n=1 mod 4, R2(n)=0, n=3 mod 4. [From Seppo Mustonen (seppo.mustonen(AT)helsinki.fi), Apr 25 2009]

MATHEMATICA

L[0]=0; L1[1]=0; R1[1]=0; L[n_]:=L[n]=2*L1[n]-L[n-1]+R1[n] L1[n_]:=L1[n]=2*L[n-1]-L1[n-1]+R2[n] R1[n_]:=R1[n]=R1[n-1]+4*(EulerPhi[n-1]-e[n]) e[n_]:=If[Mod[n, 2]==0, 0, EulerPhi[(n-1)/2]] R2[n_]:= If[Mod[n, 2]==0, (n-1)*EulerPhi[n-1], If[Mod[n, 4]==1, (n-1)*EulerPhi[n-1]/2, 0]] Table[L[n], {n, 0, 37}] [From Seppo Mustonen (seppo.mustonen(AT)helsinki.fi), Apr 25 2009]

CROSSREFS

Sequence in context: A127982 A109164 A027984 * A027107 A096487 A050930

Adjacent sequences:  A018805 A018806 A018807 * A018809 A018810 A018811

KEYWORD

nonn,nice

AUTHOR

David W. Wilson (davidwwilson(AT)comcast.net)

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 16 17:46 EST 2012. Contains 205939 sequences.