Hardcoding the Cops and Robbers (Cops)
cQuents, 4 bytes (Cracked)

"::$


Try it online!

Here are eight (n=8) cases:

1 1
2 12
3 123
4 1234
5 12345
6 123456
7 1234567
8 12345678


Code explanation:

"      Stringify sequence (join on "", remove it and see what happens)
 ::    Given input n, output all items in the sequence up to and including n
   $   Each item in the sequence equals the index


So the sequence is 1,2,3,4,5 ..., it is joined on "" so it becomes 12345 ..., and :: means that it prints up to the input.