We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #221: Alexandrian Integers
Project Euler #221: Alexandrian Integers
Sort by
recency
|
13 Discussions
|
Please Login in order to post a comment
1000 queries of
n
th value in the known integer sequence : https://oeis.org/A147811Sample intput/output : https://oeis.org/A147811/b147811.txt
The numbers are of the form p(p+d)(p+(p^2+1)/d), where d runs over divisors of p^2+1 and p runs over all positive integers.
As the numbers are of the form p^4,
int64
is not sufficient.The real challenge seems to resides inside divisors of p^2+1.
Prime factors of
p^2+1
are always4k+1
or2
.Hi.. I'm trying to understand this problem but I can't realize how to get p, q and r values. Should I have to generate them? I understand that, but If I throw 3 loops to increase them, then when to stop the last one to move hte first forward and iterate again?..I think is missing explanation.
Is this doable without calculating every Alexandrian Integers from the beginning ? Is there a better equation than pq + pr + qr = 1?
Why does it shows terminated due to timeout ? My first test case is passed but rest all are not getting evaluated.
Please notice that the input stype
other test case may not in the ascending order, it could be 3,12,16,25
means: 3 outputs in total, 12th alex number, 16th alex number, 25th alex number,
OMG, got this wrong all the time, the test case is really confusing