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.

A154840 Distance to nearest cube different from n.

This page as a plain text file.
%I A154840 #5 Mar 30 2019 10:23:13
%S A154840 1,1,1,2,3,3,2,1,7,1,2,3,4,5,6,7,8,9,9,8,7,6,5,4,3,2,1,19,1,2,3,4,5,6,
%T A154840 7,8,9,10,11,12,13,14,15,16,17,18,18,17,16,15,14,13,12,11,10,9,8,7,6,
%U A154840 5,4,3,2,1,37,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
%N A154840 Distance to nearest cube different from n.
%C A154840 Equals A074989(n) if this is not zero, else 1+A055400(n-1), the distance to the nearest cube < n.
%e A154840 a(8)=7, because the two cubes below and above 8 are 1^3=1 and 3^3=27, and the distance to 1 is smaller, namely 8-1=7.
%p A154840 distNearstDiffCub := proc(n) local iscbr ; iroot(n,3,'iscbr') ; if iscbr then 1+A055400(n-1); else A074989(n) ; end if; end proc;
%t A154840 dnc[n_]:=Module[{c=Surd[n,3]},If[IntegerQ[c],n-(c-1)^3,Min[n-Floor[ c]^3, Ceiling[c]^3-n]]]; Array[dnc,90,0] (* _Harvey P. Dale_, Mar 30 2019 *)
%Y A154840 Cf. A066635, A163497.
%K A154840 nonn,easy
%O A154840 0,4
%A A154840 _R. J. Mathar_, Nov 01 2009