Generate a list a(n) is not of the form prime + a(k), k < n

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Generate a list a(n) is not of the form prime + a(k), k < n



How to generate this list in Python?
a(n) is not of the form prime + a(k), k < n.



Here is the list on oeis http://oeis.org/A025043



It goes as 0, 1, 9, 10, 25, 34, 35, 49, 55, 85, 91, 100, 115, 121.



I've tried the bold way, didn't turn out well. Now I'm looking for a sophisticated solution, like Sieve of Eratosthenes for primes.
The bold way requires iterating over every prime, and for every iteration of prime to iterate over every number already in the sequence which takes a really long time.



This table has been generated by someone smart: http://oeis.org/A025043/b025043.txt
They either used a lot of computational power, or used a sophisticated algorithm, for which I'm looking for.




1 Answer
1



Sorry but i'm not getting series you want to print. Why don't use any user defined function which will take that formula and print the series.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard