OFFSET
1,3
COMMENTS
The numbers with nonincreasing digits, A009994, form a subsequence which first differs at a(73)=132 (not in A009994) from this one.
EXAMPLE
The number 10 is excluded from this sequence because its "rotation" 01 is smaller than the number itself.
The same is the case for any number whose first digit is not the smallest one: rotating a smaller digit to the front will always yield a smaller number, independently of the other digits. For this reason, all terms must be in A072544.
a(73)=132 is in the sequence because the nontrivial rotations of its digits are 321 and 213, both larger than 132.
PROG
(PARI) is_A239016(n)=vecsort(d=digits(n))==d||!for(i=1, #d-1, n>[1, 10^(#d-i)]*divrem(n, 10^i)&&return)
(Python)
def ok(n):
s = str(n)
if "".join(sorted(s)) == s: return True
return all(n <= int(s[i:] + s[:i]) for i in range(1, len(s)))
print(list(filter(ok, range(133)))) # Michael S. Branicky, Aug 21 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Mar 08 2014
STATUS
approved