OFFSET
1,6
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 = 6:
- we consider the following points:
. . . X .
(4,1)
X X X . X
(1,0) (2,0) (3,0) (5,0)
- the points (1,0) and (2,0) are not visible from (5,0)
(as they are hidden by (3,0)),
- whereas the points (3,0) and (4,1) are visible from (5,0)
- hence a(6) = 2.
PROG
(PARI) g(z) = z/gcd(real(z), imag(z))
for (n=1, #a=vector(81), print1 (a[n] = max(0, n-2) - #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