Timeline for Find the nth term of a sequence that consists of Fibonacci and prime numbers interleaved
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 15, 2019 at 5:49 | history | edited | MrJoe | CC BY-SA 4.0 |
changed in line with suggestions
|
Jun 15, 2019 at 4:21 | comment | added | cdlane |
The prime number code in this solution is flawed performance-wise. It keeps a list of primes found, but only uses it to return the final element -- no need to allocate a list in this case. However, if it has this list of primes, it should be using it for the divisor tests instead of range(2, counter) by 1 (which is flawed for not treating even early on and looping only over odd divisors.)
|
|
Jun 15, 2019 at 4:18 | comment | added | cdlane | The parity is of this rework is inconsistent with the OP's code. Inputs 1 and 2 produce outputs 1 (fib) and 2 (prime) in the OP's code whose sequence starts with the 1st element. This example does the reverse with a sequence that starts with the zeroth element. | |
Jun 13, 2019 at 20:25 | vote | accept | coderina | ||
Jun 13, 2019 at 20:25 | |||||
Jun 13, 2019 at 11:52 | comment | added | Justin | Hi @EML, this a great answer for your first time! You can keep up the good job my making a detailed review of the whole program, places you think could be improved and places you think are unnecessary. | |
Jun 13, 2019 at 10:46 | history | edited | MrJoe | CC BY-SA 4.0 |
edited body
|
Jun 13, 2019 at 10:24 | history | edited | MrJoe | CC BY-SA 4.0 |
added 3 characters in body
|
Jun 13, 2019 at 10:22 | history | undeleted | MrJoe | ||
Jun 13, 2019 at 10:21 | history | deleted | MrJoe | via Vote | |
Jun 13, 2019 at 10:19 | history | answered | MrJoe | CC BY-SA 4.0 |