OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..9999
Rémy Sigrist, Colored scatterplot of the first 10000 terms (where the color is function of the smallest digit of n)
Rémy Sigrist, PARI program for A338831
EXAMPLE
For n = 77:
- the numbers with 2 digits and smallest digit 7 are: 77, 78, 79, 87 and 97,
- so a(77) = 97,
a(78) = 87,
a(79) = 79,
a(87) = 78,
a(97) = 77.
MATHEMATICA
Block[{a = {}, f, k}, f[x_] := Min@ IntegerDigits@ x; Do[k = f[i]; AppendTo[a, SelectFirst[Range[10^# - 1, 10^(# - 1), -1] &@ Floor[1 + Log10[i]], And[f[#] == k, FreeQ[a, #]] &]], {i, 67}]; a] (* Michael De Vlieger, Nov 13 2020 *)
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Nov 11 2020
STATUS
approved