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

Original entry on oeis.org

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, 21, 25, 23, 26, 28, 27, 25, 29, 25, 31, 27, 34, 34, 28, 39, 35, 36, 41, 36, 40, 41, 41, 42, 45, 35, 49, 45, 47, 46, 49, 47, 49, 47, 54, 54, 52, 56, 54, 54, 58, 56, 59
Offset: 1

Views

Author

Rémy Sigrist, Apr 13 2020

Keywords

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.

Examples

			For n = 5:
- we consider the following points:
        .   .   .   X
                  /  (4,2)
        .   .   X   .
              /  (3,1)
        X   X   .   .
   (1,0)     (2,0)
- (1,0) and (3,1) are visible from (4,2)
- whereas (2,0) is not visible from (4,2),
- hence a(5) = 2.
		

Crossrefs

See A334044 for a similar sequence.
Cf. A231334.

Programs

  • PARI
    g(z) = z/gcd(real(z), imag(z))
    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])) ", "))