login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A334044
a(1) = 0, and for any n > 1, a(n) is the number of points of the set { (k, a(k)), k = 1..n-2 } that are not visible from the point (n-1, a(n-1)).
2
0, 0, 0, 1, 0, 2, 1, 0, 4, 1, 1, 2, 2, 2, 3, 2, 3, 5, 2, 6, 4, 3, 3, 4, 4, 7, 1, 5, 5, 2, 6, 5, 4, 6, 6, 9, 0, 6, 9, 3, 4, 7, 5, 8, 5, 6, 6, 10, 8, 10, 7, 7, 7, 5, 6, 11, 6, 11, 8, 6, 14, 8, 8, 10, 11, 9, 8, 15, 8, 12, 8, 12, 11, 6, 14, 8, 12, 14, 10, 13, 8
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
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
See A334043 for a similar sequence.
Sequence in context: A139360 A326759 A140882 * A143724 A143425 A323376
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 13 2020
STATUS
approved