A355062 Perfect powers whose digits are in nondecreasing order.
4, 8, 9, 16, 25, 27, 36, 49, 125, 128, 144, 169, 225, 256, 289, 1156, 1225, 1369, 1444, 4489, 6889, 11236, 11449, 13456, 13689, 27889, 33489, 111556, 112225, 113569, 134689, 146689, 344569, 444889, 2666689, 2778889, 11115556, 11122225, 11135569, 11336689
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..261
Programs
-
Mathematica
perfectPowerQ[n_] := GCD @@ FactorInteger[n][[All, 2]] > 1; (* A001597 *) Select[Range[10^6], perfectPowerQ[#] && Min[Differences[IntegerDigits[#]]]>-1 &] (* Stefano Spezia, Jul 01 2025 *)
-
PARI
isok(m) = if (ispower(m), my(d=digits(m)); (d == vecsort(d))); \\ Michel Marcus, Jun 18 2022
-
Python
from sympy import perfect_power as pp from itertools import count, islice, combinations_with_replacement as mc def agen(): for d in count(1): ni = (int("".join(m)) for m in mc("123456789", d)) yield from filter(pp, ni) print(list(islice(agen(), 40))) # Michael S. Branicky, Jun 16 2022
Comments