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.

A303545 For any n > 0 and prime number p, let d_p(n) be the distance from n to the nearest p-smooth number; a(n) = Sum_{i prime} d_i(n).

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 3, 0, 1, 3, 6, 4, 7, 5, 2, 0, 6, 2, 9, 6, 9, 11, 14, 8, 8, 10, 5, 6, 12, 4, 10, 0, 4, 9, 5, 4, 15, 16, 13, 12, 24, 18, 28, 18, 16, 22, 28, 16, 17, 16, 20, 20, 25, 10, 12, 12, 17, 22, 24, 8, 21, 13, 3, 0, 5, 8, 26, 18, 16, 10, 25, 8, 28, 21
Offset: 1

Views

Author

Rémy Sigrist, Apr 26 2018

Keywords

Comments

For any n > 0 and prime number p >= A006530(n), d_p(n) = 0; hence the series in the name contains only finitely many nonzero terms and is well defined.
See also A303548 for a similar sequence.

Examples

			For n = 42:
- d_2(42) = |42 - 32| = 10,
- d_3(42) = |42 - 36| = |42 - 48| = 6,
- d_5(42) = |42 - 40| = 2,
- d_p(42) = 0 for any prime number p >= 7,
- hence a(42) = 10 + 6 + 2 = 18.
		

Crossrefs

Programs

  • PARI
    gpf(n) = if (n==1, 1, my (f=factor(n)); f[#f~, 1])
    a(n) = my (v=0, pi=primepi(gpf(n))); for (d=0, oo, my (o=min(primepi(gpf(n-d)), primepi(gpf(n+d)))); if (o
    				

Formula

a(n) = 0 iff n is a power of 2.
a(2 * n) <= 2 * a(n).
a(n) >= A053646(n) + A301574(n) (as d_2 = A053646 and d_3 = A301574).

A302721 Square array T(n, k) read by antidiagonals upwards, n > 0 and k > 0: T(n, k) is the distance from n to the nearest prime(k)-smooth number (where prime(k) denotes the k-th prime number).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Rémy Sigrist, Apr 29 2018

Keywords

Examples

			Array T(n, k) begins:
  n\k|  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
  ---+------------------------------------------------------------
    1|  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    2|  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    3|  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    4|  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    5|  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    6|  2  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    7|  1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    8|  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    9|  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   10|  2  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   11|  3  1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   12|  4  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   13|  3  1  1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
		

Crossrefs

Cf. A053646 (first column), A061395, A301574 (second column), A303545 (row sums).

Programs

  • PARI
    gpf(n) = if (n==1, 1, my (f=factor(n)); f[#f~, 1])
    T(n,k) = my (p=prime(k)); for (d=0, oo, if (gpf(n-d) <= p || gpf(n+d) <= p, return (d)))

Formula

a(2^i, k) = 0 for any i >= 0.
a(2*n, k) <= 2*a(n, k).
a(n, k+1) <= a(n, k).
abs(T(n+1, k) - T(n, k)) <= 1.
a(n, A061395(n)) = 0 for any n > 1.
a(n, 1) = A053646(n).
a(n, 2) = A301574(n).
Sum_{k > 0} a(n, k) = A303545(n).
Showing 1-2 of 2 results.