%I #12 Nov 04 2015 03:46:21
%S 0,1,2,0,1,2,3,0,0,1,2,3,4,5,6,0,1,2,3,4,5,6,7,8,0,1,0,1,2,3,4,0,1,2,
%T 3,0,1,2,3,4,5,6,7,8,9,10,11,12,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,0,
%U 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
%N a(n) = n - largest perfect power <= n.
%C a(n) = 0 if n = m^p that is if n is a full power (square, cube etc.).
%C As Catalan's conjecture is now proved, n=8=2^3, n+1=9=3^2 is the only solution for a(n+1) = a(n) = 0.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/news/2002-05-05/catalan/">Catalan's conjecture</a>
%o (PARI) a(n) = {m = n; while(!ispower(m), m--; if (m==0, return (n-1))); n-m;} \\ _Michel Marcus_, Nov 04 2015
%Y Cf. A001597, a(n)=n-A081676(n).
%K easy,nonn
%O 1,3
%A _Amarnath Murthy_, Mar 24 2002
%E Edited by _Reinhard Zumkeller_, Mar 26 2003
|