OFFSET
1,4
COMMENTS
For any i and k such that i < k: the point (i, a(i)) is visible from the point (k, a(k)) if there are no j such that i < j < k and the three points (i, a(i)), (j, a(j)), (k, a(k)) are aligned.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 5:
- we consider the following points:
. . . X
/ (4,2)
. . X .
/ (3,1)
X X . .
(1,0) (2,0)
- (1,0) and (3,1) are visible from (4,2)
- whereas (2,0) is not visible from (4,2),
- hence a(5) = 2.
PROG
(PARI) g(z) = z/gcd(real(z), imag(z))
for (n=1, #a=vector(69), print1 (a[n] = #Set(apply(k -> g((k+a[k]*I)-(n-1+a[n-1]*I)), [1..n-2])) ", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 13 2020
STATUS
approved