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.

A047973 Distance of n-th prime to nearest cube.

This page as a plain text file.
%I A047973 #9 Jan 11 2017 13:53:37
%S A047973 1,2,3,1,3,5,9,8,4,2,4,10,14,16,17,11,5,3,3,7,9,15,19,25,28,24,22,18,
%T A047973 16,12,2,6,12,14,24,26,32,38,42,43,37,35,25,23,19,17,5,7,11,13,17,23,
%U A047973 25,35,41,47,53,55,61,62,60,50,36,32,30,26,12,6,4,6,10,16,24,30,36,40
%N A047973 Distance of n-th prime to nearest cube.
%H A047973 Harvey P. Dale, <a href="/A047973/b047973.txt">Table of n, a(n) for n = 1..1000</a>
%F A047973 For each prime, find the closest cube (preceding or succeeding); subtract, take absolute value.
%e A047973 For 179, 125 is the preceding cube, 216 is the succeeding. 179-125 = 54, 216-179 = 37, so the distance is 37.
%t A047973 dnc[n_]:=Module[{c=Surd[n,3]},Min[Ceiling[c]^3-n,n-Floor[c]^3]]; dnc/@ Prime[Range[80]] (* _Harvey P. Dale_, Jan 11 2017 *)
%o A047973 (PARI) a(n) = {p = prime(n); sc = sqrtnint(p, 3); min(p - sc^3, (sc+1)^3 - p);} \\ _Michel Marcus_, Jun 05 2014
%Y A047973 Cf. A047972.
%K A047973 easy,nonn
%O A047973 1,2
%A A047973 _Enoch Haga_