login
A245632
Least number k such that n concatenated with k is a perfect power.
2
6, 5, 2, 9, 12, 4, 29, 1, 61, 0, 56, 1, 31, 4, 21, 9, 28, 49, 6, 25, 6, 5, 104, 3, 6, 244, 44, 9, 16, 25, 25, 4, 64, 3, 344, 1, 21, 44, 69, 0, 209, 25, 56, 1, 369, 24, 61, 4, 13, 41, 2, 9, 29, 76, 225, 25, 6, 32, 29, 84, 504, 5, 504, 516, 61, 564, 6, 59, 169, 56, 289, 9, 96, 529, 69, 176, 44, 4, 21, 656
OFFSET
1,1
LINKS
EXAMPLE
16 is the smallest perfect power > 9 beginning with 1. Thus a(1) = 6.
MAPLE
conc:= proc(n, k) if k = 0 then 10*n else 10^(1+ilog10(k))*n+k fi end proc:
ispow:= proc(x) local F; F:= ifactors(x)[2];
evalb(igcd(seq(f[2], f=F))>1) end proc:
a:= proc(n) local k; for k from 0 do if ispow(conc(n, k)) then return k fi od end proc;
seq(a(n), n=1..100); # Robert Israel, Jul 28 2014
PROG
(PARI)
a(n)=p=""; for(k=0, oo, p=concat(Str(n), Str(k)); if(ispower(eval(p)), return(k)))
n=1; while(n<100, print1(a(n), ", "); n++)
(Python)
from sympy import perfect_power
def a(n):
s, k = str(n), 0
while not perfect_power(int(s+str(k))): k += 1
return k
print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Jun 05 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Derek Orr, Jul 27 2014
STATUS
approved