it takes a lot of time and patient to come up with a function that works for all n and also have a short length, let me try if I can solve this problem it may takes a few hours or days or maybe months I'll post the solution here so stay tuned. but if you want to make your life easier you can generate the function in a meta language so you can always be sure that your software does not have a halting problem