login
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 visible from the point (n-1, a(n-1)).
4

%I #17 Apr 28 2020 00:48:54

%S 0,0,1,2,2,3,5,4,5,7,8,8,10,8,9,12,11,13,16,14,15,16,14,17,20,20,17,

%T 21,25,23,26,28,27,25,29,25,31,27,34,34,28,39,35,36,41,36,40,41,41,42,

%U 45,35,49,45,47,46,49,47,49,47,54,54,52,56,54,54,58,56,59

%N 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 visible from the point (n-1, a(n-1)).

%C 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.

%H Rémy Sigrist, <a href="/A334043/b334043.txt">Table of n, a(n) for n = 1..10000</a>

%e For n = 5:

%e - we consider the following points:

%e . . . X

%e / (4,2)

%e . . X .

%e / (3,1)

%e X X . .

%e (1,0) (2,0)

%e - (1,0) and (3,1) are visible from (4,2)

%e - whereas (2,0) is not visible from (4,2),

%e - hence a(5) = 2.

%o (PARI) g(z) = z/gcd(real(z), imag(z))

%o 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])) ", "))

%Y See A334044 for a similar sequence.

%Y Cf. A231334.

%K nonn

%O 1,4

%A _Rémy Sigrist_, Apr 13 2020