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.

Showing 1-5 of 5 results.

A295707 Square array A(n,k), n >= 1, k >= 1, read by antidiagonals, where A(n,k) is the number of lines through at least 2 points of an n X k grid of points.

Original entry on oeis.org

0, 1, 1, 1, 6, 1, 1, 11, 11, 1, 1, 18, 20, 18, 1, 1, 27, 35, 35, 27, 1, 1, 38, 52, 62, 52, 38, 1, 1, 51, 75, 93, 93, 75, 51, 1, 1, 66, 100, 136, 140, 136, 100, 66, 1, 1, 83, 131, 181, 207, 207, 181, 131, 83, 1, 1, 102, 164, 238, 274, 306, 274, 238, 164, 102, 1
Offset: 1

Views

Author

Seiichi Manyama, Nov 26 2017

Keywords

Examples

			Square array begins:
   0,  1,  1,   1,   1, ...
   1,  6, 11,  18,  27, ...
   1, 11, 20,  35,  52, ...
   1, 18, 35,  62,  93, ...
   1, 27, 52,  93, 140, ...
   1, 38, 75, 136, 207, ...
		

Crossrefs

Main diagonal gives A018808. Reading up to the diagonal gives A107348.

Programs

  • Mathematica
    A[n_, k_] := (1/2)(f[n, k, 1] - f[n, k, 2]);
    f[n_, k_, m_] := Sum[If[GCD[mx/m, my/m] == 1, (n - Abs[mx])(k - Abs[my]), 0], {mx, -n, n}, {my, -k, k}];
    Table[A[n - k + 1, k], {n, 1, 11}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 04 2023 *)

Formula

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

A160842 Number of lines through at least 2 points of a 2 X n grid of points.

Original entry on oeis.org

0, 1, 6, 11, 18, 27, 38, 51, 66, 83, 102, 123, 146, 171, 198, 227, 258, 291, 326, 363, 402, 443, 486, 531, 578, 627, 678, 731, 786, 843, 902, 963, 1026, 1091, 1158, 1227, 1298, 1371, 1446, 1523, 1602, 1683, 1766, 1851, 1938, 2027, 2118, 2211, 2306, 2403, 2502
Offset: 0

Views

Author

Seppo Mustonen, May 28 2009

Keywords

Crossrefs

Programs

  • Magma
    [0,1] cat [n^2 + 2: n in [2..100]]; // G. C. Greubel, Apr 30 2018
  • Mathematica
    a[n_]:=If[n<2,n,n^2+2] Table[a[n],{n,0,50}]
    Join[{0,1},Range[2,50]^2+2] (* Harvey P. Dale, Feb 06 2015 *)
  • PARI
    Vec(-x*(2*x^3-4*x^2+3*x+1) / (x-1)^3 + O(x^100)) \\ Colin Barker, May 24 2015
    

Formula

a(n) = n^2 + 2 = A059100(n) = A010000(n) for n > 1.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 4. - Colin Barker, May 24 2015
G.f.: -x*(2*x^3 - 4*x^2 + 3*x + 1) / (x-1)^3. - Colin Barker, May 24 2015
Sum_{n>=1} 1/a(n) = Pi * coth(sqrt(2)*Pi) / 2^(3/2) - 1/4. - Vaclav Kotesovec, May 01 2018

A160843 Number of lines through at least 2 points of a 3 X n grid of points.

Original entry on oeis.org

0, 1, 11, 20, 35, 52, 75, 100, 131, 164, 203, 244, 291, 340, 395, 452, 515, 580, 651, 724, 803, 884, 971, 1060, 1155, 1252, 1355, 1460, 1571, 1684, 1803, 1924, 2051, 2180, 2315, 2452, 2595, 2740, 2891, 3044, 3203, 3364, 3531, 3700, 3875, 4052, 4235, 4420
Offset: 0

Views

Author

Seppo Mustonen, May 28 2009

Keywords

Crossrefs

3rd row/column of A107348, A295707.

Programs

  • Magma
    [0, 1] cat [2*n^2 + 3 - n mod 2: n in [2..100]]; // G. C. Greubel, Apr 30 2018
  • Mathematica
    a[n_]:=If[n<2,n,2*n^2+3-Mod[n,2]] Table[a[n],{n,0,47}]
    Join[{0, 1}, LinearRecurrence[{2, 0, -2, 1}, {11, 20, 35, 52}, 20]] (* G. C. Greubel, Apr 30 2018 *)
  • PARI
    Vec(-x*(3*x^4-3*x^3-2*x^2+9*x+1)/((x-1)^3*(x+1)) + O(x^100)) \\ Colin Barker, May 24 2015
    

Formula

a(n) = 2*n^2 + 3 - n mod 2.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 5. - Colin Barker, May 24 2015
G.f.: -x*(3*x^4 - 3*x^3 - 2*x^2 + 9*x + 1) / ((x-1)^3*(x+1)). - Colin Barker, May 24 2015

A160844 Number of lines through at least 2 points of a 4 X n grid of points.

Original entry on oeis.org

0, 1, 18, 35, 62, 93, 136, 181, 238, 299, 370, 445, 532, 621, 722, 827, 942, 1061, 1192, 1325, 1470, 1619, 1778, 1941, 2116, 2293, 2482, 2675, 2878, 3085, 3304, 3525, 3758, 3995, 4242, 4493, 4756, 5021, 5298, 5579, 5870, 6165, 6472, 6781, 7102, 7427, 7762
Offset: 0

Views

Author

Seppo Mustonen, May 28 2009

Keywords

Crossrefs

4th row/column of A107348, A295707.

Programs

  • Magma
    I:=[18, 35, 62, 93, 136, 181]; [0,1] cat [n le 6 select I[n] else Self(n-1) +Self(n-2) -Self(n-4) -Self(n-5) +Self(n-6): n in [1..30]]; // G. C. Greubel, Apr 30 2018
    
  • Mathematica
    a[0]=0; a[1]=1; a[2]=18; a[3]=35; a[n_]:=a[n]=a[n]=2*a[n-1]-a[n-2]+R[n] c4={10,4,12,2,12,4}; R[n_]:=c4[[Mod[n+2,6]+1]] Table[a[n],{n,0,46}]
    Join[{0,1}, LinearRecurrence[{1,1,0,-1,-1,1}, {18, 35, 62, 93, 136, 181}, 50]] (* G. C. Greubel, Apr 30 2018 *)
  • PARI
    my(x='x+O('x^30)); concat([0], Vec(x*(4*x^6-3*x^4+9*x^3+16*x^2+ 17*x+1 )/((1-x)^3*(x+1)*(x^2+x+1)))) \\ G. C. Greubel, Apr 30 2018

Formula

a(n) = 2*a(n-1) - a(n-2) + C(mod(n+2,6) + 1), C=(10,4,12,2,12,4), for n >= 4.
From Colin Barker, May 24 2015: (Start)
a(n) = a(n-1) + a(n-2) - a(n-4) - a(n-5) + a(n-6) for n > 5.
G.f.: x*(4*x^6 - 3*x^4 + 9*x^3 + 16*x^2 + 17*x + 1) / ((1-x)^3*(x + 1)*(x^2 + x + 1)).
(End)

A160845 Number of lines through at least 2 points of a 5 X n grid of points.

Original entry on oeis.org

0, 1, 27, 52, 93, 140, 207, 274, 361, 454, 563, 676, 809, 944, 1099, 1258, 1433, 1614, 1815, 2016, 2237, 2464, 2707, 2954, 3221, 3490, 3779, 4072, 4381, 4696, 5031, 5366, 5721, 6082, 6459, 6840, 7241, 7644, 8067, 8494, 8937, 9386, 9855, 10324, 10813
Offset: 0

Views

Author

Seppo Mustonen, May 28 2009

Keywords

Crossrefs

5th row/column of A107348, A295707.

Programs

  • Mathematica
    m=5;
    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,44}]

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=5.
For another more efficient formula, see Mathematica code below.
Conjectures from Colin Barker, May 24 2015: (Start)
a(n) = a(n-1) + a(n-3) - a(n-5) - a(n-7) + a(n-8) for n > 7.
G.f.: x*(5*x^8 + x^6 + 16*x^5 + 20*x^4 + 40*x^3 + 25*x^2 + 26*x + 1) / ((1 - x)^3*(x + 1)*(x^2 + 1)*(x^2 + x + 1)).
(End)
Showing 1-5 of 5 results.