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!)
A075772 Difference between the n-th perfect power and the closest perfect power. 6
3, 3, 1, 1, 7, 2, 2, 4, 4, 13, 15, 17, 19, 4, 3, 3, 16, 25, 20, 9, 9, 13, 13, 33, 19, 18, 18, 39, 41, 28, 17, 17, 47, 49, 51, 53, 55, 57, 59, 39, 24, 24, 65, 67, 69, 35, 35, 38, 75, 77, 79, 47, 36, 36, 85, 87, 23, 23, 68, 10, 10, 12, 95, 97, 99, 101, 40, 40, 65, 107, 100, 11, 11 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Let {b(n)} be the sequence of perfect powers (A001597); then a(n) = min { b(n)-b(n-1), b(n+1)-b(n) }.
LINKS
FORMULA
a(n) = min A053289({n, n-1}\{0}), where A053289(n) = A001597(n+1) - A001597(n). - M. F. Hasler, May 08 2018
EXAMPLE
The perfect powers are 1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, etc. The 7th is 27. This is 2 larger than the 6th (25) and 5 smaller than the 8th (32). So a(7)=2.
MATHEMATICA
pp = {-2, 1}; Do[ If[ !PrimeQ[n] && Apply[GCD, Last[ Transpose[ FactorInteger[n]]]] > 1, pp = Append[pp, n]], {n, 2, 10^4}]; Table[ Min[pp[[n + 1]] - pp[[n]], pp[[n + 2]] - pp[[n + 1]]], {n, 1, 75}]
perfPQ[n_]:=GCD@@FactorInteger[n][[All, 2]]>1; Join[{3, 3}, Min[ Differences[ #]]&/@Partition[Select[Range[5000], perfPQ], 3, 1]] (* Harvey P. Dale, May 04 2021 *)
PROG
(PARI) for(n=L=3+P=-2, 99, ispower(n)&&print1(min(-P+P=L, -L+L=n)", ")) \\ Note: ispower(1)=0. - M. F. Hasler, May 08 2018
CROSSREFS
Sequence in context: A174116 A270273 A026515 * A142157 A119608 A364633
KEYWORD
nonn
AUTHOR
Neil Fernandez, Oct 09 2002
EXTENSIONS
More terms from Robert G. Wilson v and John W. Layman, Oct 10 2002
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 April 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)