%I #14 May 03 2018 17:45:35
%S 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,
%T 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,
%U 19,41,56,0,57,30,9,14,23,27,85,36,31,15,78,12,80
%N 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).
%C 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.
%C 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.
%H Rémy Sigrist, <a href="/A303711/b303711.txt">Table of n, a(n) for n = 1..10000</a>
%H Rémy Sigrist, <a href="/A303711/a303711.png">Colored pin plot of the first 2000 terms</a> (where the color is function of the number f in the term d_f(n))
%H Rémy Sigrist, <a href="/A303711/a303711.gp.txt">PARI program for A303711</a>
%H <a href="/index/Di#distance_to_the_nearest">Index entries for sequences related to distance to nearest element of some set</a>
%F a(n) = 0 iff n belongs to A303703.
%e For n = 42:
%e - d_1(n) = 0,
%e - d_2(n) = 0,
%e - d_3(n) = 0,
%e - d_4(n) = |42 - 36| = |42 - 48| = 6,
%e - d_5(n) = |42 - 40| = 2,
%e - d_6(n) = |42 - 40| = 2,
%e - d_f(n) = 0 for any f >= 7,
%e - hence a(42) = 6 + 2 + 2 = 10.
%o (PARI) See Links section.
%Y Cf. A002034, A303545, A303548, A303703.
%K nonn,look
%O 1,5
%A _Rémy Sigrist_, Apr 29 2018