# Proving that 31123319 is the largest number with a self-accounting property (A047841)

22 is special because it contains the number of its numbers. The next smallest number with this self-accounting property (see A047841) is 10213223. What is the largest such number?

I've figured out the numbers work in pairs, so the number must have an even number of digits, be at least 8 digits and that within each pair, 0 can never be first. Ex. 1002 has a 2, so there can't be 0 2's in the number. Beyond these parameters, I'm not sure how else to approach this problem. I'm was thinking that maybe something could be done with permutations and combinations, since the numbers work as pairs and there are some conditions, but I'm not sure how I would actually do this.

All help is appreciated!

• This is A047841, next one is $10311233$. Apparently there are $109$ of them.
– lulu
Jan 14 at 18:32
• How exactly is the "number of numbers" defined ? Jan 16 at 12:45
• It means self-accounting. 22 has 2 2's, so it has the numbers of its numbers. 10213223 has 1 0, 2 1's, 3 2's and 2 3's so it has the number of its numbers. Each pair (ex. the first 2 digits, 10 for 10213223) works this way, with the first digit (1 in , this case) telling you how many of the second digit (0) are in the number. Jan 16 at 14:53
• Note that 101112213141516171819 has an odd number of digits since there are 11 ones. Jan 18 at 15:56
• The $191817161514132211110$ is greater, the OEIS you link to has additional restriction you do not mention anywhere (the counted digits appear in increasing order).
– Sil
Jan 18 at 18:32