login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A373696
a(n) is the least m >= 0 with the same number of digits as n such that for some permutation p of 0..9, applying p to the digits of n yields the digits of m.
1
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 10
OFFSET
0,11
COMMENTS
Leading zeros are ignored.
For n > 0, a(n) is the least m > 0 such that A358497(n) = A358497(m).
All positive terms belong to A266946.
FORMULA
a(n) <= n with equality iff n = 0 or n belongs to A266946.
a(a(n)) = a(n).
EXAMPLE
For n = 65507668: the different digits appearing in 65507668 are 6, 5, 0, 7 and 8; so we replace 6's by 1's, 5's by 0's, 0's by 2's, 7's by 3's and 8's by 4's, and a(65507668) = 10023114.
PROG
(PARI) a(n, base = 10) = { my (d = digits(n, base), m = vector(base, i, -1), u = 1); for (i = 1, #d, if (m[1+d[i]] < 0, m[1+d[i]] = u; u = if (u==1, 0, u==0, 2, u+1); ); d[i] = m[1+d[i]]; ); fromdigits(d, base); }
CROSSREFS
Cf. A137564, A266946, A358497, A373712 (ternary analog).
Sequence in context: A352390 A004499 A020509 * A103181 A100813 A085209
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Aug 04 2024
STATUS
approved