Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 07-02-2022, 05:22 AM
p45cal's Avatar
p45cal p45cal is offline Permutations of a list of numbers Windows 10 Permutations of a list of numbers Office 2019
Expert
 
Join Date: Apr 2014
Posts: 962
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, 8 views)
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aligning numbers (to the right) in a numbered list OneNote45 PowerPoint 1 03-09-2021 07:51 AM
parsing numbers from a list JBF Excel 2 10-14-2018 12:33 PM
Permutations of a list of numbers Pasting With Original Numbers From List BarnabyS Word 15 08-16-2018 11:53 PM
Picking Highest numbers out of List JBF Excel 7 03-12-2018 01:14 AM
Permutations of a list of numbers How to add 10000 numbers in a list without dragging down Pleasehelpmewithexcel Excel 3 12-18-2015 06:46 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft