"Muhuhuhahahah!" The mad scientist laughs. "You're trapped in my own little game!"
In front of you is a deadly pit of snakes, while behind you is a bottomless chasm. There's no way out, you're stuck!
"Two steps in front of you is the snake pit, and two steps behind you is the chasm. But! Before you move, you MUST write down a sequence of steps, forwards and backwards, and give them to me. But! because I'm feeling a bit evil today, I can make you take, instead of every step, every
nth step, where
n is less than your sequence length!
Choose wisely, now."
What's the maximum number of steps you can take before your imminent death?
The intro above is a twist on the Erdős discrepancy conjecture, which was recently proven true (if you want to understand more about this, go to this video, by James Grime - I "stole" the twist question off of him).
The answer to the intro is
11 steps, but I won't go too in-depth with a proof. The answer, if the distance between you and the two "dangers" were
3 steps, is
1160 steps, although that isn't validated properly yet.
Your task is to make a program that generates the longest sequence of steps you can achieve for a larger
x is the number of steps between you and the two "dangers". Your program must take an input for
x, and output a valid sequence for that
For the purposes of this challenge,
+ represents a step forward, and
- represents a step back.
So, an output for an input
Which works, no matter what
n the mad scientist chooses. For our challenge,
x = 5.
NOTE: This challenge is not a dupe of this challenge or this challenge, as my challenge focuses on the output, as opposed to the code itself - in other words, it's not a code golf challenge. As well as that, these challenges are based off of
x = 3, which already has an established upper bound.
- Your entire program should fit into your answer. However, if it doesn't fit, please provide an additional Github repository, or something similar.
- You may update both your answer and your program, if you can get a better score via optimising your code - but by doing so, you must update everything in the list below.
- In your answer, you must have:
- Your program, in its entirety, or a link to a GH repository hosting your code
- The amount of steps generated - this will be your final score.
- You must also provide an online version of the sequence in a Pastebin, or something similar. This is so we can check your answer.
- The time your final score was last updated, so I don't have to check your history
- You may NOT hardcode sequences beforehand.
- Your program must work for all
xis the number of steps between you and the pit & chasm), but you only need to provide the score for
x = 5.
The answer with the largest score wins!