Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #26 Aug 08 2014 14:46:36
%S 0,6,2,3,5,9,792,2555,10368,23464,84888,1047087,2483200,54721675,
%T 228537856,1394007616,5090444477,51286309703,608427634303,
%U 3260058995493,11314112766137,51848285189219,1034026438223449,11075640379838488,181108172062981288,1566869630866485093
%N Least number k >= 0 such that n! + k is a cube.
%H Robert Israel, <a href="/A240937/b240937.txt">Table of n, a(n) for n = 1..524</a>
%p f:= proc(n) local N; N:= n!; ceil(N^(1/3))^3 - N end proc:
%p seq(f(n), n=1..30); # _Robert Israel_, Aug 04 2014
%t f[n_] := Block[{c = n! - 1}, (1 + Floor[c^(1/3)])^3 - c - 1]; Array[f, 26] (* _Robert G. Wilson v_, Aug 04 2014 *)
%o (PARI)
%o a(n)=for(k=0,10^10,s=n!+k;if((ispower(s)&&ispower(s)%3==0)||s==1,return(k)))
%o n=1;while(n<20,print1(a(n),", ");n++)
%o (PARI) vector(50, n, ceil(n!^(1/3))^3-n!) \\ faster program
%Y Cf. A068869.
%K nonn
%O 1,2
%A _Derek Orr_, Aug 03 2014
%E a(15) onward from _Robert G. Wilson v_, Aug 04 2014