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!)
A081676 Largest perfect power <= n. 2
1, 1, 1, 4, 4, 4, 4, 8, 9, 9, 9, 9, 9, 9, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 25, 25, 27, 27, 27, 27, 27, 32, 32, 32, 32, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
a(n) = n if n is in A001597, otherwise a(n) = a(n-1). - Robert Israel, Dec 17 2015
LINKS
FORMULA
a(n) = n - A069584(n).
MAPLE
N:= 1000: # to get a(1) to a(N).
Powers:= {1, seq(seq(b^p, p=2..floor(log[b](N))), b=2..isqrt(N))}:
Powers:= sort(convert(Powers, list)):
j:= 1:
for i from 1 to N do
if i >= Powers[j+1] then j:= j+1 fi;
A[i]:= Powers[j];
od:
seq(A[i], i=1..N); # Robert Israel, Dec 17 2015
MATHEMATICA
Array[SelectFirst[Range[#, 1, -1], Or[And[! PrimeQ@ #, GCD @@ FactorInteger[#][[All, -1]] > 1], # == 1] &] &, 72] (* Michael De Vlieger, Jun 14 2017 *)
PROG
(PARI) a(n) = {while(!ispower(n), n--; if (n==0, return (1))); n; } \\ Michel Marcus, Nov 04 2015
(Sage)
p = [i for i in (1..81) if i.is_perfect_power()]
r = [[p[i]]*(p[i+1]-p[i]) for i in (0..10)]
print([y for x in r for y in x]) # Peter Luschny, Jun 13 2017
CROSSREFS
Sequence in context: A056629 A245356 A167185 * A114555 A361471 A124570
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Mar 26 2003
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 16 03:21 EDT 2024. Contains 371696 sequences. (Running on oeis4.)