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).
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
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.
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, Colored pin plot of the first 2000 terms (where the color is function of the number f in the term d_f(n))
- Rémy Sigrist, PARI program for A303711
- Index entries for sequences related to distance to nearest element of some set
Programs
-
PARI
See Links section.
Formula
a(n) = 0 iff n belongs to A303703.
Comments