33
6
It's all in the title...
Take as input a positive integer n>=12
and... do what the title says.
Yes, this is on OEIS A187924.
Some test cases
12 -> 912
13 -> 11713
14 -> 6314
15 -> 915
16 -> 3616
17 -> 15317
18 -> 918
19 -> 17119
20 -> 9920
40 -> 1999840
100-> 99999999999100
This is code-golf. Shortest code in bytes wins!
Comments are not for extended discussion; this conversation has been moved to chat.
– Martin Ender – 2017-12-09T14:12:08.713To close up a part of what was moved to chat: my edit to the OEIS proving that 11 is the only number without a solution was just approved. – Ørjan Johansen – 2018-01-21T04:55:59.860