Problem 3646 · Hard

Next Special Palindrome Number

Scan upward from n and accept the first number that reads the same both ways and has each digit d appearing exactly d times.

Open the interactive visualisation