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