Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Programming Languages
Python
Number Finder
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="WhiteCube, post: 5178863, member: 92459"] You need a prime test function. For small numbers, a modulo test inside a loop is good enough. Before you code it, have a look in your math library, it might already exist. To test if a number has 2 as one of its digits, convert the number into a string, then search for a "2" inside the string. A list of prime numbers that contain a 2 is not something where you can apply a simple formula. You need a loop, and it will slow down the higher you go. If you are trying to generate a list, and you suspect there is a formula, generate the first 7 or so numbers by hand, then type them into the online encyclopedia of integer sequences. There's a good chance that someone has discovered it. Great web site. [/QUOTE]
Verification
Post reply
Forums
Programming Languages
Python
Number Finder
Top