cp's OEIS Frontend

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.

Showing 1-1 of 1 results.

A240940 Least number k >= 0 such that n! - k is a perfect power.

Original entry on oeis.org

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
Offset: 1

Views

Author

Derek Orr, Aug 04 2014

Keywords

Crossrefs

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

Programs

  • 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
Showing 1-1 of 1 results.