This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A069584 #18 Apr 04 2025 22:32:01 %S A069584 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 A069584 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 A069584 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 A069584 a(n) = n - largest perfect power <= n. %C A069584 a(n) = 0 if n = m^p that is if n is a full power (square, cube etc.). %C A069584 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 A069584 Robert Israel, <a href="/A069584/b069584.txt">Table of n, a(n) for n = 1..10000</a> %H A069584 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/news/2002-05-05/catalan/">Catalan's conjecture</a> %p A069584 N:= 100: # for a(1) .. a(N), where N is a perfect power %p A069584 S:= {seq(seq(i^p,i=1.. floor(N^(1/p))),p=2..ilog2(N))}: %p A069584 P:= sort(convert(S,list)): %p A069584 A:= [seq(seq(i-P[j],i=P[j]..P[j+1]-1),j=1..nops(P)-1),0]; # _Robert Israel_, Apr 04 2025 %o A069584 (PARI) a(n) = {m = n; while(!ispower(m), m--; if (m==0, return (n-1))); n-m;} \\ _Michel Marcus_, Nov 04 2015 %Y A069584 Cf. A001597, a(n)=n-A081676(n). %K A069584 easy,nonn %O A069584 1,3 %A A069584 _Amarnath Murthy_, Mar 24 2002 %E A069584 Edited by _Reinhard Zumkeller_, Mar 26 2003