login
This site is supported by donations 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

Neven Sajko, Table of n, a(n) for n = 1..10000

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

Cf. A001597, A069584.

Sequence in context: A056629 A245356 A167185 * A114555 A124570 A213083

Adjacent sequences:  A081673 A081674 A081675 * A081677 A081678 A081679

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 | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified July 23 05:58 EDT 2017. Contains 289686 sequences.