View Single Post
 
Old 07-02-2022, 05:22 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2019
Expert
 
Join Date: Apr 2014
Posts: 866
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Paulrwoolley, if, as you say just 3 numbers (1,2,3) lead to 6 permutations then 13 numbers will lead to 6.23 billion permutations (6.23 *10^9).


I stole some code from
https://digitalcommons.wayne.edu/cgi...&context=jmasm
and without looking at it too closely I made a few tweaks.
It outputs the permutations to a text file (hard coded in the macro so you'll have to adjust that).
It uses the value in cell B4 of the active sheet to decide how many numbers of your prime number sequence to permute; I chose 10 because it didn't take too long (just over a minute to produce 3.6 million permutations in the text file (sized 135Mb))
Choosing 13 looks like it'll take some 40 hours and might produce a 230Gb file.
It takes the prime numbers from the left of cells A3:M3 of the active sheet (as many numbers as the value in B4).



See attached. There's a button to press to run the macro.


As you'd expect, the text file starts of with:
2 3 5 7 11 13 17 19 23 29
2 3 5 7 11 13 17 19 29 23
2 3 5 7 11 13 17 23 19 29
2 3 5 7 11 13 17 23 29 19
2 3 5 7 11 13 17 29 19 23
2 3 5 7 11 13 17 29 23 19
2 3 5 7 11 13 19 17 23 29



and finishes with:
29 23 19 17 13 11 5 7 3 2
29 23 19 17 13 11 7 2 3 5
29 23 19 17 13 11 7 2 5 3
29 23 19 17 13 11 7 3 2 5
29 23 19 17 13 11 7 3 5 2
29 23 19 17 13 11 7 5 2 3
29 23 19 17 13 11 7 5 3 2



What are you going to do with all these data?!
Attached Files
File Type: xlsm msofficeforums49289Sample.xlsm (21.5 KB, 6 views)
Reply With Quote