1,3

a(n) = 0 if n = m^p that is if n is a full power (square, cube etc.).

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.

Table of n, a(n) for n=1..95.

Eric Weisstein's World of Mathematics, Catalan's conjecture

(PARI) a(n) = {m = n; while(!ispower(m), m--; if (m==0, return (n-1))); n-m; } \\ Michel Marcus, Nov 04 2015

Cf. A001597, a(n)=n-A081676(n).

Sequence in context: A080099 A268040 A127711 * A199238 A181347 A014587

Adjacent sequences: A069581 A069582 A069583 * A069585 A069586 A069587

easy,nonn

Amarnath Murthy, Mar 24 2002

Edited by Reinhard Zumkeller, Mar 26 2003

approved