I just gotta say, if the answer turns out to be 19! factorial or something along those lines, I will laugh my ass off. Not that I expect it to happen, but it would be funny.
Pink cheeks continued…
How the heck did I get the right answer for N=5? Ah, there doesn’t seem to be any ‘legal’ way to put 2, 3, and 4 in between 1 and 5 (or 3, 4, and 5 between 1 and 2), so I lucked out on that one. Hmmm, what about N=7?
1-3-5-2-6-4-7
Okay, it’s not just the even-numbered N’s that’ll be a problem, then, but anything above N=5. Shoot.
Oh, well. I’ll redo the program tonight, probably. Just thinking about this has shown me a whole slew of optimizations I hadn’t thought of before. Besides which, my home machine is faster, anyway. It’ll probably be just 2,000 years instead of 5,000.
Being right on the first try isn’t exactly one of my strengths either, Dave. There was one proof in my dissertation - for a result I really needed, too - where I thought I’d proved it five different times, and every time I found a hole. (I finally nailed it for real on the sixth try, thank goodness.)
My wife got to where, when she heard me say “Oh shit!” for no apparent reason, she took it for granted that my latest ‘proof’ had unravelled yet again.
Brute-Force, round two:
N=5: 1 out of 12 (8.33%)
N=6: 3 out of 60 (5.00%)
N=7: 23 out of 360 (6.39%)
N=8: 177 out of 2,520 (7.02%)
N=9: 1,553 out of 20,160 (7.70%)
N=10: 14,963 out of 181,440 (8.25%)
N=11: 157,931 out of 1,814,400 (8.70%)
N=12: 1,814,453 out of 19,958,400 (9.09%)
N=13: 22,566,237 out of 239,500,800 (9.42%)
N=14: 302,267,423 out of 3,113,510,400 (9.71%)
Now, coming at this whole thing backwards, I was playing with the above numbers trying to see some relationship between them that could be ‘exploited’ into providing an equation. Given some function, f(N), which gives the number of good curwin-style solutions, it became quickly obvious that for N above 7, f(N) = (N-1)*f(N-1) + some fraction of f(N-1). For N greater than 8, the fraction one must add gets smaller (at N=14, it’s about 0.3947).
Dunno if this helps or hinders any of you out there making a serious attempt at the problem. I thought it might provide a clue of some sort.
Oh, RTFirefly, thanks for the sympathy, but I doubt I’ll live this down (in my own head, at least). It was, after all, such a rookie mistake to make (and I’ve been doing this for 23 years now).
N=15: 4,340,478,951 out of 43,589,145,600 (9.96%)
This took almost 4 hours to generate. If my guesstimation equation holds true, N=16 should take another 30 or so hours (well, 19 hours from now). N=17 should take another 16*30, or 480 hours (20 days). N=18 would then take another 340 days. N=19 another 17 years, 8 months. And N=20 an additional 336 years. I’ve assuredly made some speed increases here, and I might let it run and find N=16. But after that, I’m definitely going to give the computer a rest, and turn it off.
Shoot. Strange problem happened which forced me to reboot (keystrokes kept going to the wrong applications - for example, when typing my username here on SDMB, the D, A, and V would get entered just fine, but I’d hit the E and another copy of Windows Explorer would launch - anyone else ever have that happen under Win98?). Anyway, I’m not going to worry about N=16 anymore. Either someone’ll find an equation or someone won’t. I don’t see a lot of practical use for “curwin’s number,” and judging by the lack of prior work, I don’t think anyone else does, either.
You don’t know how often I hear that…