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!)
A240939 Least number k >= 0 such that n! + k is a perfect power. 0
0, 2, 2, 1, 1, 9, 1, 81, 729, 225, 324, 39169, 82944, 176400, 215296, 3444736, 26167684, 114349225, 255004929, 1158920361, 11638526761, 42128246889, 191052974116, 97216010329, 2430400258225, 1553580508516, 4666092737476, 565986718738441, 2137864362693921, 5112360635841936 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

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

MATHEMATICA

nextPerfectPower[n_] := Min@ Table[(Floor[n^(1/k)] + 1)^k, {k, 2, 1 + Floor@ Log2@ n}]; f[n_] := nextPerfectPower[n!] - n!; f[1] = 0; Array[f, 30] (* Robert G. Wilson v, Aug 04 2014 *)

PROG

(PARI)

a(n)=for(k=0, 10^10, 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, ceil(n!^(1/i))^i-n!, 1)); listsort(L); L[1]

vector(40, n, a(n)) \\ faster program

CROSSREFS

Cf. A068869, A240937.

Sequence in context: A176602 A322194 A174120 * A016739 A158452 A208929

Adjacent sequences:  A240936 A240937 A240938 * A240940 A240941 A240942

KEYWORD

nonn

AUTHOR

Derek Orr, Aug 03 2014

EXTENSIONS

a(18) onward from Robert G. Wilson v, 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 October 4 04:26 EDT 2022. Contains 357237 sequences. (Running on oeis4.)