login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A338830 a(n) is the greatest number not yet in the sequence with the same number of digits and the same largest digit as n. 2
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 10, 22, 33, 44, 55, 66, 77, 88, 99, 21, 20, 12, 32, 43, 54, 65, 76, 87, 98, 31, 30, 23, 13, 42, 53, 64, 75, 86, 97, 41, 40, 34, 24, 14, 52, 63, 74, 85, 96, 51, 50, 45, 35, 25, 15, 62, 73, 84, 95, 61, 60, 56, 46, 36, 26, 16, 72 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers.
LINKS
Rémy Sigrist, Colored scatterplot of the first 10000 terms (where the color is function of the largest digit of n)
FORMULA
A055642(a(n)) = A055642(n).
A054055(a(n)) = A054055(n).
EXAMPLE
For n = 20:
- the numbers with 2 digits and largest digit 2 are: 12, 20, 21 and 22,
- so a(12) = 22,
a(20) = 21,
a(21) = 20,
a(22) = 12.
MATHEMATICA
Block[{a = {}, f, k}, f[x_] := Max@ 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
Sequence in context: A065650 A358386 A065649 * A262037 A262039 A354719
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Nov 11 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 8 13:51 EDT 2024. Contains 375753 sequences. (Running on oeis4.)