(and for your quick answers)
Now I know what to go after
Best regards
It is currently Thu Sep 03, 2026 5:48 pm

NOis the difference between the indices of the two pentagonal numbers 19?
I used a method that I think guarantees that the first solution found is the one with minimal |Pj - Pk| using the fact that Pn+Pn+1 = 3n2 + 2n + 1. As you go through Pn+Pn+2, Pn+Pn+3, ..., Pn+Pn+x, the equations evolve in a constant fashion. The only difficulty is determining what value of "x" is adequate to either accept or reject Pn as the lesser value of the desired pair [Pj, Pk]. I arbitrarily chose 1000, which resulted in an answer within 200ms, but I wonder if there is a more certain way?I used a similar method and got the correct answer, although it was awful slow. I still think it's the only way to ensure that the difference is minimized (many used faster algorithms that did not really minimize D, but nevertheless got the solution).




Entia non sunt multiplicanda praeter necessitatem
Entia non sunt multiplicanda praeter necessitatemThat's not a good idea as your Blog or Website is open to public.xe3tec wrote:Not here. Maybe on your Blog or Website if you have one (like I do).
You can PM me your solution, I'm not an admin but just interested in discussing the problem. I also solved it with no bounds, a priori.Francky wrote:I did the real chalenge (|Pj-Pk| minimised, not the sum)
with no bounds, a priori.
--
Find D took 0.95 s
The second D in the list is
?--?8562 (only last digits), and took me 555 s of Python.


Entia non sunt multiplicanda praeter necessitatem