OFFSET
0,3
COMMENTS
A010784 is the sequence of distinct terms in this sequence, thus 9876543210 is the largest term here also, as no digit occurs more than once in any given term. Each term except 0 appears infinitely often in this sequence. - Rick L. Shepherd, Oct 03 2020
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000 (corrected by Andrew Howroyd at the suggestion of Rodolfo Kurchan and Omar E. Pol, Oct 04 2020)
EXAMPLE
a(100)=10 as a (second) 0 digit is dropped. a(1211323171)=1237.
a(10...1) = 10 for any number of 0's and/or 1's in any order replacing the "..." in the term's index. - Rick L. Shepherd, Oct 03 2020
MATHEMATICA
Table[FromDigits@ DeleteDuplicates@ IntegerDigits@ n, {n, 74}] (* Michael De Vlieger, Jun 01 2016 *)
PROG
(PARI) a(n)={my(d=digits(n)); fromdigits(vecextract(d, vecsort(vecsort(d, , 9))))} \\ Andrew Howroyd, Oct 04 2020
(Perl) sub a {my($n)=@_; my @seen; $n =~ s{.}{!$seen[$&]++ && $&}eg; $n} # Kevin Ryde, Oct 04 2020
(Python)
def a(n):
seen, out, s = set(), "", str(n)
for d in s:
if d not in seen: out += d; seen.add(d)
return int(out)
print([a(n) for n in range(113)]) # Michael S. Branicky, Jul 23 2022
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Rick L. Shepherd, Jan 25 2008
STATUS
approved