OFFSET
1,3
PROG
(PARI)
a(n)=for(k=0, n!, s=n!-k; if(ispower(s)||s==1, return(k)))
n=1; while(n<50, print1(a(n), ", "); n++)
(PARI)
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]
vector(40, n, a(n)) \\ faster program
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Aug 04 2014
STATUS
approved