The final cache is at:
N 34 17.Q
W 118 31.0P
If the address is a prime number, then multiple the fourth digit by the result of the sum of 4 times the second digit and the third digit. Then multiple that result by 5 to get Q.
If the address is not a prime number, then multiply the second largest factor by the third largest factor. Then multiple that result by 5 to get Q.
To get P, add all the digits together and then multiple the result by 4. Subtract one to get P.
Don't forget to write down the code from log sheet.