login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A240940 Least number k >= 0 such that n! - k is a perfect power. 0
0, 1, 2, 8, 20, 44, 127, 320, 476, 3584, 12311, 4604, 74879, 414119, 2071775, 5703551, 11551671, 45680444, 442548224, 1960632176, 2657058876, 24923993276, 130518272975, 1478154932316, 5446454455004, 38610655379975, 204033398880671, 538347188396016, 3809155729331900, 27460809907547975, 52607402757814775 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

LINKS

Table of n, a(n) for n=1..31.

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

Cf. A066857 (n! - k is a square), A226973.

Sequence in context: A131128 A296954 A203604 * A066857 A146168 A058405

Adjacent sequences:  A240937 A240938 A240939 * A240941 A240942 A240943

KEYWORD

nonn

AUTHOR

Derek Orr, Aug 04 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 26 15:09 EDT 2022. Contains 357000 sequences. (Running on oeis4.)