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.

Showing 1-2 of 2 results.

A334046 a(n) is the number of points of the set { (k, prime(k)), k = 1..n-1 } that are not visible from the point (n, prime(n)) (where prime(n) denotes the n-th prime number).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 2, 2, 1, 1, 2, 3, 2, 4, 4, 3, 5, 2, 3, 6, 5, 6, 4, 2, 3, 5, 4, 4, 6, 2, 2, 5, 4, 4, 6, 7, 5, 7, 7, 6, 6, 7, 6, 8, 8, 7, 5, 4, 4, 5, 8, 8, 6, 7, 7, 8, 8, 12, 10, 11, 12, 6, 7, 11, 10, 5, 5, 7, 6, 10, 10, 10, 11, 11, 12, 15, 12, 13, 13, 11
Offset: 1

Views

Author

Rémy Sigrist, Apr 13 2020

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

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

Formula

a(n) = n-1-A375421(n). - Pontus von Brömssen, Feb 14 2025

A375420 a(n) is the number of straight lines passing through the points (i, prime(i)) and (j, prime(j)) with i < j <= n (where prime(k) denotes the k-th prime number).

Original entry on oeis.org

0, 1, 3, 4, 8, 13, 17, 20, 25, 32, 40, 48, 56, 66, 74, 84, 94, 105, 120, 135, 148, 162, 176, 191, 211, 230, 247, 267, 287, 306, 333, 361, 385, 410, 437, 462, 488, 517, 545, 571, 601, 633, 663, 696, 730, 761, 796, 836, 879, 921, 962, 1000, 1038, 1080, 1122
Offset: 1

Views

Author

Rémy Sigrist, Aug 14 2024

Keywords

Examples

			The first terms, alongside the new lines passing through (n, prime(n)), are:
  n  a(n)  New lines passing through (n, prime(n))
  -  ----  --------------------------------------------
  1     0  {}
  2     1  {x + 1}
  3     3  {2*x - 1, 3/2*x + 1/2}
  4     4  {5/3*x + 1/3}
  5     8  {4*x - 9, 3*x - 4, 8/3*x - 7/3, 9/4*x - 1/4}
		

Crossrefs

Programs

  • PARI
    { L = []; for (n = 1, #p = primes(55), print1 (#L = setunion(L, Set(vector(n-1, i, polinterpolate([i, n], [p[i], p[n]]))))", ");); }

Formula

a(n) <= A000217(n+1).
Showing 1-2 of 2 results.