05AB1E, \$\infty\$ characters
20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390525XY20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390525M₁BD.VÁ.V
Try it online!
This technique is capable of generating arbitrarily long solutions, and given here is a 657 characters one.
When removing each character, this outputs
-20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390525000
-20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390524999
...
-20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390524679
-20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390524678
-20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390527
-20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390526
-20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390525
...
-20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390204
-20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390203
-3
01
625
997
998
20369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390526
203691417459121541025956170746023725010219798381481292613670424841878397808208758216407259824975285354781743274097692954052414823827468252380161076797065742343594758578468019426891795218753047192723687494394131876739715230394212416812027980179249247414629187458572126582167367825613839106425675453516593954592132878123905259
203691417459121541025956170746023725010219798381481292613670424841878397808208758216407259824975285354781743274097692954052414823827468252380161076797065742343594758578468019426891795218753047192723687494394131876739715230394212416812027980179249247414629187458572126582167367825613839106425675453516593954592132878123905270
920369141745912154102595617074602372501021979838148129261367042484187839780820875821640725982497528535478174327409769295405241482382746825238016107679706574234359475857846801942689179521875304719272368749439413187673971523039421241681202798017924924741462918745857212658216736782561383910642567545351659395459213287812390525
Explanation
This code has a pattern of <number>XY<number>M₁BD.VÁ.V
, when <number>
doesn't have any equal consecutive digits.
If one of ₁B
is removed then the code will output 01
or 625
respectively. Otherwise, the number will be base256 decoded and then run as an 05AB1E. This code inspects the stack, to detect which character was removed, if it wasn't one of .VÁ.V
, output the correct number, and exit.
If the first .
is removed, then V
saves the code to the Y
variable, which we can also detect and output 998
.
If the first V
is removed, we get .Á.V
, where .Á
rotates the stack, so this is detected by inspection of the stack.
Otherwise, we leave 10N+20, 10N+9
on the stack after the first .V
:
- If the
Á
was removed, then 10N+9
is executed and returns itself.
- If the
.
was removed, then V
pops the 10N+9
and 10N+20
is returned.
- If the
V
was removed, Á
rotates the top number, so the output is rot(10N+9)
.
This is what the number base256 decodes to:
)D g4Qi D21 S èOsθ.ï><₄ * -(Y2Ê+,q} ¤.ïi θ>,q}D30Sè` ›iD 30Sè€Sø€ËO sà ₄*-,qB} D30Sè `‹iD30 Sè€S ø€ËOsà- ,q }àDsÌ10*s 9ªJ0i a a }
This code isn't especially interesting, but notice that there are a lot of spaces there which were inserted by trial-and-error to make sure there aren't any equal consecutive digits (because in that case we can't know which was removed).
<number>XY<number>M
leaves <number>
at top of the stack even after one character removal: If M
was removed, then it's obvious, otherwise at least one instance of <number>
must be valid, and it will be the bigger one, which M
(which pushes the biggest number on the stack) will push.