login
A391869
Delete from n all digits of opposite parity to its largest digit.
1
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 2, 13, 4, 15, 6, 17, 8, 19, 20, 2, 22, 3, 24, 5, 26, 7, 28, 9, 3, 31, 3, 33, 4, 35, 6, 37, 8, 39, 40, 4, 42, 4, 44, 5, 46, 7, 48, 9, 5, 51, 5, 53, 5, 55, 6, 57, 8, 59, 60, 6, 62, 6, 64, 6, 66, 7, 68, 9, 7, 71, 7, 73, 7, 75
OFFSET
0,3
COMMENTS
Look at the largest digit of n. If it is even, remove all odd digits of n. If it is odd, remove all even digits. The remaining digits form the term.
LINKS
FORMULA
a(k) = k for k in A059708.
EXAMPLE
a(1121) = 2 since the largest digit is 2, and we delete the odd 1 digits to obtain 2.
a(3674) = 37 since the largest digit is 7, and we delete the even digits 6 and 4 to obtain 37.
a(5060) = 60 since the largest digit is 6, and we delete the odd 5 digit to obtain (0)60.
MATHEMATICA
a[n_] := Module[{d = IntegerDigits[n]}, FromDigits@ DeleteCases[d, _?(Mod[#, 2] != Mod[Max[d], 2] &)]]; Array[a, 100, 0] (* Amiram Eldar, Jan 19 2026 *)
PROG
(Python)
def a(n):
s = str(n)
dmax = max(s)
digset = "02468" if (dmax in "13579") else "13579"
r = "".join(d for d in s if d not in digset)
return int(r)
print([a(n) for n in range(76)])
(PARI) a(n) = if (n, my(d=digits(n), p=vecmax(d) % 2, list=List()); for (i=1, #d, if ((d[i] % 2) == p, listput(list, d[i]))); fromdigits(Vec(list)), 0); \\ Michel Marcus, Jan 19 2026
CROSSREFS
Cf. A059708 (set of fixed points).
Sequence in context: A344487 A389420 A047813 * A084051 A069652 A055483
KEYWORD
nonn,base,easy
AUTHOR
Ali Sada and Michael S. Branicky, Jan 18 2026
STATUS
approved