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-4 of 4 results.

A303548 For any n > 0 and h > 0, let d_h(n) be the distance from n to the nearest number with Hamming weight at most h; a(n) = Sum_{i > 0} d_i(n).

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 2, 0, 1, 2, 4, 4, 4, 4, 3, 0, 1, 2, 4, 4, 6, 8, 9, 8, 8, 8, 9, 8, 7, 6, 4, 0, 1, 2, 4, 4, 6, 8, 9, 8, 10, 12, 15, 16, 17, 18, 18, 16, 16, 16, 17, 16, 17, 18, 18, 16, 15, 14, 14, 12, 10, 8, 5, 0, 1, 2, 4, 4, 6, 8, 9, 8, 10, 12, 15, 16, 17, 18
Offset: 1

Views

Author

Rémy Sigrist, Apr 26 2018

Keywords

Comments

For any n > 0 and h >= A000120(n), d_h(n) = 0, hence the series in the name contains only finitely many nonzero terms and is well defined.
See also A303545 for a similar sequence.

Examples

			For n = 42:
- d_1(n) = |42 - 32| = 10,
- d_2(n) = |42 - 40| = 2,
- d_h(n) = 0 for any h >= 3,
- hence a(42) = 10 + 2 = 12.
		

Crossrefs

Programs

  • PARI
    a(n) = my (v=0, h=hamming weight(n)); for (d=0, oo, my (o=min(hamming weight(n-d), hamming weight(n+d))); if (o
    				

Formula

a(n) = 0 iff n is a power of 2.
Apparently, a(2 * n) = 2 * a(n).
a(n) >= A053646(n) (as d_1 = A053646).

A302558 For any n > 0 and m > 1, let d_m(n) be the distance from n to the nearest power of a number <= m (i.e., the distance to the nearest number of the form x^k with x <= m and k >= 0); a(n) = Sum_{i > 1} d_i(n).

Original entry on oeis.org

0, 0, 1, 0, 3, 7, 5, 0, 1, 9, 18, 28, 30, 23, 13, 0, 15, 31, 48, 66, 73, 64, 50, 33, 11, 29, 5, 29, 54, 55, 29, 0, 31, 63, 41, 16, 51, 87, 124, 162, 201, 241, 252, 231, 207, 180, 150, 117, 73, 113, 152, 192, 233, 275, 318, 362, 364, 321, 275, 226, 174, 119, 61
Offset: 1

Views

Author

Rémy Sigrist, Aug 15 2018

Keywords

Comments

For any n > 1 and m >= n, d_m(n) = 0, hence the series in the name contains only finitely many nonzero terms and is well defined.
The set of local minima (i.e., indices n > 1 where a(n) < min(a(n-1), a(n+1))) seem to correspond to A001597 minus {1, 9}.
See A303545 for a similar sequence.

Examples

			For n = 10:
- d_2(10) = |10 - 8| = 2,
- d_m(10) = |10 - 9| = 1 for m = 3..9,
- d_m(10) = 0 for any m >= 10,
- hence a(10) = 2 + 7*1 = 9.
		

Crossrefs

Programs

  • PARI
    a(n) = my (v=0, d=oo); for (m=2, oo, my (k=logint(n,m)); d = min(d, min(n-m^k, m^(k+1)-n)); if (d, v+=d, return (v)))

Formula

a(n) = 0 iff n is a power of 2.
a(n) >= A053646(n) (as d_2 = A053646).

A303711 For any n > 0 and f > 0, let d_f(n) be the distance from n to the nearest number congruent mod f! to some divisor of f!; a(n) = Sum_{i > 0} d_i(n).

Original entry on oeis.org

0, 0, 0, 1, 2, 0, 3, 0, 2, 3, 8, 0, 9, 4, 3, 6, 19, 8, 19, 4, 5, 11, 20, 0, 5, 12, 8, 5, 26, 0, 27, 6, 12, 19, 8, 4, 35, 24, 11, 5, 42, 10, 46, 13, 8, 26, 50, 8, 17, 18, 28, 29, 64, 16, 15, 8, 19, 41, 56, 0, 57, 30, 9, 14, 23, 27, 85, 36, 31, 15, 78, 12, 80
Offset: 1

Views

Author

Rémy Sigrist, Apr 29 2018

Keywords

Comments

For any n > 0 and f >= A002034(n), d_f(n) = 0; hence the series in the name contains only finitely many nonzero terms and is well defined.
See also A303545 and A303548 for similar sequences; unlike these sequences, the indexed family {d_i, i > 0} used here does not satisfy for any n > 0 and f < g the inequality d_f(n) >= d_g(n); also d_i is i!-periodic for any i > 0.

Examples

			For n = 42:
- d_1(n) = 0,
- d_2(n) = 0,
- d_3(n) = 0,
- d_4(n) = |42 - 36| = |42 - 48| = 6,
- d_5(n) = |42 - 40| = 2,
- d_6(n) = |42 - 40| = 2,
- d_f(n) = 0 for any f >= 7,
- hence a(42) = 6 + 2 + 2 = 10.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = 0 iff n belongs to A303703.

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-4 of 4 results.