Skip to main content
3 of 10
added 232 characters in body
user202729
  • 17.6k
  • 2
  • 39
  • 71

dc (GNU), 3 distinct characters (1+P), 1065 bytes

Throws a bunch of error messages.

Generator program: Try it online!

This is probably the optimal solution with a digit, + and P.

Analysis: There are some options of using the arithmetic operator instead of +.

  • v: results in a ~8 KiB solution. (you can get it from the generator program above by removing the solve(bestReprAdd), line in the generator)
  • -: will probably result in the approximately-same or slightly-shorter program.
  • %: obviously impossible. (because, for example, 11111 mod 111 is 11, so the constructible values are those already constructible with a literal or 0)
  • ~: (unfortunately) also impossible because there's no way to discard the remainder without printing it out.
  • / and |: should be possible. Analysis pending.
  • * and ^: probably impossible, because there can only be a small set of representable numbers.
  • i: An interesting possibility (11i to increase the input base, 1i to set the input base to 1); however the input base must be between 2 and 16, so there's no way to decrease the input base, so it's not very likely to work.

Other alternatives:

  • z, P, (arithmetic operator)
  • z, P, o (since the output radix is not used, it's the same as pop the stack and do nothing in this challenge)
user202729
  • 17.6k
  • 2
  • 39
  • 71