Write the shortest program possible such that when you combine the first character and every Nth character after it into a new program, the output is N. This must work for N = 1, 2, ..., 16.
Another way to say it is, if you remove all the characters from your program except for the first one and every Nth one after that, the output of the remaining code should be N.
Example
If your code was
ABCDEFGHIJKLMNOP
N = 1 results in ABCDEFGHIJKLMNOP
. Running this should output 1.
N = 2 results in ACEGIKMO
. Running this should output 2.
N = 3 results in ADGJMP
. Running this should output 3.
N = 4 results in AEIM
. Running this should output 4.
N = 5 results in AFKP
. Running this should output 5.
N = 6 results in AGM
. Running this should output 6.
N = 7 results in AHO
. Running this should output 7.
N = 8 results in AI
. Running this should output 8.
N = 9 results in AJ
. Running this should output 9.
N = 10 results in AK
. Running this should output 10.
N = 11 results in AL
. Running this should output 11.
N = 12 results in AM
. Running this should output 12.
N = 13 results in AN
. Running this should output 13.
N = 14 results in AO
. Running this should output 14.
N = 15 results in AP
. Running this should output 15.
N = 16 results in A
. Running this should output 16.
Details
- All characters are allowed, ASCII and non-ASCII. (Newlines and unprintable ASCII are allowed as well. Note that carriage return and line feed count as distinct characters.)
- Your score is the length in characters of your unaltered program (15 in example). The lowest score wins.
- A score below 16 is clearly impossible because then at least two of the altered programs would be identical.
- Output may be to a file or stdout or anything else reasonable. However, the output of the 16 different programs must all go to the same place (e.g. it's not ok if
AO
goes to stdout butA
goes to a file). There is no input. - The output must be in decimal, not hex. The actual output should only contain the 1 or 2 characters that make up the number from 1 to 16, nothing else. (Things like Matlab's
ans =
are ok.) - Your program does not have to work for N = 17 or above.
ABCDEFGHIJKLMNO
andN = 15
, result code is justA
. \$\endgroup\$