Jump to content
Developer Wiki and Function Reference Links ×

Prime number generator node


Benson Shaw

Recommended Posts

Thanks to help from a programmer/coder friend (Mr J), internet posts of python prime number generators, and tips on Community Board I was able to modify a Series node to become a Prime Number Generator with range inputs. Sample attached as a v1. (Note - I am totally not educated or capable in python or other scripting.  Dependent on others.)

 

Any comments, improvements or alternatives welcome.

 

Here is the prime generator python script from Scanftree.com

http://scanftree.com/programs/python/python-program-to-print-all-prime-numbers-in-an-interval/

 

image.thumb.png.94f2ce93ce4f9ef6e0140eb87f0287a9.png
 

 

 

 

The Standard Series node uses a List [ ] output.

Mr J and I could not make that work, so commented it out.

He tried .append instead which apparently works well.

See it in action in this thread:

 

Prime Series Node.vwx

Edited by Benson Shaw
oops! attached the vwx file with prime number node
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...