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.
%I A240940 #17 Aug 11 2014 22:52:47 %S A240940 0,1,2,8,20,44,127,320,476,3584,12311,4604,74879,414119,2071775, %T A240940 5703551,11551671,45680444,442548224,1960632176,2657058876, %U A240940 24923993276,130518272975,1478154932316,5446454455004,38610655379975,204033398880671,538347188396016,3809155729331900,27460809907547975,52607402757814775 %N A240940 Least number k >= 0 such that n! - k is a perfect power. %o A240940 (PARI) %o A240940 a(n)=for(k=0,n!,s=n!-k;if(ispower(s)||s==1,return(k))) %o A240940 n=1;while(n<50,print1(a(n),", ");n++) %o A240940 (PARI) %o A240940 a(n)=for(k=1, n!, if(2^k>n!, kk=k; break)); if(kk==1, return(0)); L=List([]); for(i=2, kk, listinsert(L, n!-floor(n!^(1/i))^i, 1)); listsort(L); L[1] %o A240940 vector(40, n, a(n)) \\ faster program %Y A240940 Cf. A066857 (n! - k is a square), A226973. %K A240940 nonn %O A240940 1,3 %A A240940 _Derek Orr_, Aug 04 2014