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-2 of 2 results.

A355553 Number of ways to select 3 or more collinear points from an n X n grid.

Original entry on oeis.org

0, 0, 8, 54, 228, 708, 1980, 4890, 11528, 26004, 57384, 123786, 265596, 563664, 1192220, 2511474, 5279208, 11064216, 23156448, 48361110, 100859180, 209996772, 436635396, 906562842, 1879950384, 3893566872, 8054935784, 16645591974, 34363631412, 70872295524, 146036933100
Offset: 1

Views

Author

Thomas Garrison, Jul 14 2022

Keywords

Examples

			a(4)=54: There are 4 horizontal lines of length 4 and within a line of 4 dots are 5 ways to select a line 3 or longer. There are 2 diagonal lines of length 4 and 4 vertical lines of length 4. Finally there are 4 diagonals of length 3 these are: ((1,2),(2,3),(3,4)), ((2,1),(3,2),(4,3)), ((1,3),(2,2),(3,1)), ((2,4),(3,3),(4,2)). In total we have 5*10+4=54.
    4 . . . .
    3 . . . .
    2 . . . .
    1 . . . .
      1 2 3 4
		

Crossrefs

Cf. A000982 (1 X n), 2*A000982 (2 X n), A355551 (3 X n), A355552 (4 X n).

Extensions

Corrected and extended by Lucas A. Brown, Nov 06 2022

A355551 Number of ways to select 3 or more collinear points from a 3 X n grid.

Original entry on oeis.org

1, 2, 8, 23, 61, 144, 322, 689, 1439, 2954, 6004, 12123, 24385, 48932, 98054, 196325, 392899, 786078, 1572472, 3145295, 6290981, 12582392, 25165258, 50331033, 100662631, 201325874, 402652412, 805305539, 1610611849, 3221224524, 6442449934
Offset: 1

Views

Author

Thomas Garrison, Jul 06 2022

Keywords

Examples

			a(5)=61: there are 3*(2^5 - 1 - binomial(6,2)) ways to select 3 or more points on a horizontal line, 5 ways on a vertical line, 3 ways on a diagonal line with slope 1, 3 ways on a diagonal line with slope -1, 1 way on a diagonal line with slope 1/2, and 1 way on a diagonal line with slope -1/2; 48 + 5 + 6 + 2 = 61.
		

Crossrefs

Cf. A002662 (1 X n), 2*A002662 (2 X n), A355552 (4 X n), A355553 (n X n).

Programs

  • Mathematica
    LinearRecurrence[{4, -4, -2, 5, -2}, {1, 2, 8, 23, 61}, 50] (* Paolo Xausa, Oct 19 2024 *)
  • Python
    def a(n): return 3*((1<
    				

Formula

a(n) = 3*(2^n - 1 - n*(n+1)/2) + ceiling(n^2/2).
a(n) = A000982(n) + 3*A002662(n).
a(n) ~ 3*2^n.
From Stefano Spezia, Jul 10 2022: (Start)
G.f.: x*(1 - 2*x + 4*x^2 + x^3)/((1 - x)^3*(1 - x - 2*x^2)).
a(n) = (3*2^(n+2) - 4*n^2 - 6*n - 11 - (-1)^n)/4. (End)
Showing 1-2 of 2 results.