Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A160850
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A160850 Number of lines through at least 2 points of an 10 X n grid of points +0
1
0, 1, 102, 203, 370, 563, 836, 1111, 1470, 1855, 2306, 2757, 3298, 3857, 4506, 5159, 5868, 6603, 7428, 8255, 9172, 10105, 11098, 12101, 13194, 14305, 15496, 16697, 17964, 19251, 20628, 21997, 23456, 24941, 26492, 28053, 29688, 31341, 33084 (list; graph; listen)
OFFSET

0,3

LINKS

S. Mustonen, On lines and their intersection points in a rectangular grid of points

FORMULA

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=10

For another more efficient formula, see Mathematica code below.

MATHEMATICA

m=10;

a[0]=0; a[1]=1;

a[2]=m^2+2;

a[3]=2*m^2+3-Mod[m, 2];

a[n_]:=a[n]=2*a[n-1]-a[n-2]+2*p1[m, n]+2*p4[m, n]

p1[m_, n_]:=Sum[p2[m, n, y], {y, 1, m-1}]

p2[m_, n_, y_]:=If[GCD[y, n-1]==1, m-y, 0]

p[i_]:=If[i>0, i, 0]

p2[m_, n_, x_, y_]:=p2[m, n, x, y]=(n-x)*(m-y)-p[n-2*x]*p[m-2*y]

p3[m_, n_, x_, y_]:=p2[m, n, x, y]-2*p2[m, n-1, x, y]+p2[m, n-2, x, y]

p4[m_, n_]:=p4[m, n]=If[Mod[n, 2]==0, 0, p42[m, n]]

p42[m_, n_]:=p42[m, n]=Sum[p43[m, n, y], {y, 1, m-1}]

p43[m_, n_, y_]:=If[GCD[(n-1)/2, y]==1, p3[m, n, (n-1)/2, y], 0]

Table[a[n], {n, 0, 39}]

CROSSREFS

Sequence in context: A044334 A044715 A078787 this_sequence A140062 A127655 A158127

Adjacent sequences: A160847 A160848 A160849 this_sequence A160851 A160852 A160853

KEYWORD

nonn

AUTHOR

Seppo Mustonen (seppo.mustonen(AT)helsinki.fi), May 28 2009

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research