cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A334043 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)).

This page as a plain text file.
%I A334043 #17 Apr 28 2020 00:48:54
%S A334043 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 A334043 21,25,23,26,28,27,25,29,25,31,27,34,34,28,39,35,36,41,36,40,41,41,42,
%U A334043 45,35,49,45,47,46,49,47,49,47,54,54,52,56,54,54,58,56,59
%N A334043 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 A334043 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 A334043 Rémy Sigrist, <a href="/A334043/b334043.txt">Table of n, a(n) for n = 1..10000</a>
%e A334043 For n = 5:
%e A334043 - we consider the following points:
%e A334043         .   .   .   X
%e A334043                   /  (4,2)
%e A334043         .   .   X   .
%e A334043               /  (3,1)
%e A334043         X   X   .   .
%e A334043    (1,0)     (2,0)
%e A334043 - (1,0) and (3,1) are visible from (4,2)
%e A334043 - whereas (2,0) is not visible from (4,2),
%e A334043 - hence a(5) = 2.
%o A334043 (PARI) g(z) = z/gcd(real(z), imag(z))
%o A334043 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 A334043 See A334044 for a similar sequence.
%Y A334043 Cf. A231334.
%K A334043 nonn
%O A334043 1,4
%A A334043 _Rémy Sigrist_, Apr 13 2020