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.

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

This page as a plain text file.
%I A302558 #16 Aug 20 2018 06:00:19
%S A302558 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,
%T A302558 29,54,55,29,0,31,63,41,16,51,87,124,162,201,241,252,231,207,180,150,
%U A302558 117,73,113,152,192,233,275,318,362,364,321,275,226,174,119,61
%N 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).
%C A302558 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.
%C A302558 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}.
%C A302558 See A303545 for a similar sequence.
%H A302558 Rémy Sigrist, <a href="/A302558/b302558.txt">Table of n, a(n) for n = 1..10000</a>
%H A302558 Rémy Sigrist, <a href="/A302558/a302558.png">Colored logarithmic pin plot of the first 1024 terms</a> (where the color is function of the number m in the term d_m(n))
%H A302558 <a href="/index/Di#distance_to_the_nearest">Index entries for sequences related to distance to nearest element of some set</a>
%F A302558 a(n) = 0 iff n is a power of 2.
%F A302558 a(n) >= A053646(n) (as d_2 = A053646).
%e A302558 For n = 10:
%e A302558 - d_2(10) = |10 - 8| = 2,
%e A302558 - d_m(10) = |10 - 9| = 1 for m = 3..9,
%e A302558 - d_m(10) = 0 for any m >= 10,
%e A302558 - hence a(10) = 2 + 7*1 = 9.
%o A302558 (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)))
%Y A302558 Cf. A001597, A053646, A303545.
%K A302558 nonn
%O A302558 1,5
%A A302558 _Rémy Sigrist_, Aug 15 2018