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.

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).

This page as a plain text file.
%I A303545 #26 Apr 28 2018 19:53:24
%S A303545 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,
%T A303545 4,9,5,4,15,16,13,12,24,18,28,18,16,22,28,16,17,16,20,20,25,10,12,12,
%U A303545 17,22,24,8,21,13,3,0,5,8,26,18,16,10,25,8,28,21
%N 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).
%C A303545 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.
%C A303545 See also A303548 for a similar sequence.
%H A303545 Rémy Sigrist, <a href="/A303545/b303545.txt">Table of n, a(n) for n = 1..32768</a>
%H A303545 Rémy Sigrist, <a href="/A303545/a303545.png">Colored pin plot of the first 3 * 512 terms</a> (where the color is function of the prime p in the term d_p(n))
%H A303545 <a href="/index/Di#distance_to_the_nearest">Index entries for sequences related to distance to nearest element of some set</a>
%F A303545 a(n) = 0 iff n is a power of 2.
%F A303545 a(2 * n) <= 2 * a(n).
%F A303545 a(n) >= A053646(n) + A301574(n) (as d_2 = A053646 and d_3 = A301574).
%e A303545 For n = 42:
%e A303545 - d_2(42) = |42 - 32| = 10,
%e A303545 - d_3(42) = |42 - 36| = |42 - 48| = 6,
%e A303545 - d_5(42) = |42 - 40| = 2,
%e A303545 - d_p(42) = 0 for any prime number p >= 7,
%e A303545 - hence a(42) = 10 + 6 + 2 = 18.
%o A303545 (PARI) gpf(n) = if (n==1, 1, my (f=factor(n)); f[#f~, 1])
%o A303545 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<pi, v += d*(pi-o); pi=o); if (o<=1, return (v)))
%Y A303545 Cf. A006530, A053646, A301574, A303548.
%K A303545 nonn,look
%O A303545 1,5
%A A303545 _Rémy Sigrist_, Apr 26 2018