Prime number generator ?

Augustine Bannatyne - Leudar's icon

Anyone know of a simple prime number generator for max masp on windows ? I tried tap.prime but cant find it on github or the objects database - I downloaded tap objects 4 and it doesnt find the tap.prime object -a ny others ?

andrea agostini's icon

The bach library ( www.bachproject.net ) contains a prime number generator. It is probably overkill to install the bach library if you only need that feature, but you might want to have a look anyway.

aa

andrea agostini's icon

The bach library ( www.bachproject.net ) contains a prime number generator. It is probably overkill to install the whole package if you only need that feature, but you might want to have a look anyway.

aa

yerps's icon

hi
I just made a prime number finder. V1 was a fail, but here is V2

it's the yerps slow prime number finder patch.

it's slow just because if it goes much faster it has errors in the coll where the results are kept. however v2 is a bit quicker. : P

I'd like to know how to make it go ultra fast, so fast that it makes the cpu run at 100 percent and makes the user consider water cooling. lol. like prime 95. at present it makes my CPU run at approx 1 percent (peak). So a bit disappointing in that respect; However one could actually turn the cpu fan off if there is need to find primes in stealth mode :).

Perhaps someone could give a few pointers on how to make it faster?

patch is below. >

Max Patch
Copy patch and select New From Clipboard in Max.

yerps's icon

You can tell a prime number by there being only a '1' next to an entry in the coll. it is inefficient and slow but I believe it to be accurate.