I'm really no math expert but a decent web developer with a simple problem.
I have a gallery with items. I can decide how many items I show on each page. I'll give an example...
Example with 9 in a row
Match row length
Each line is filled up with 3 in a row. Nice!
|x|x|x|
|x|x|x|
|x|x|x|
Does not match row length
When having 4 in a row, it "breaks".
|x|x|x|x|
|x|x|x|x|
|x|
Conclusion: 9 is only a good items number for 1, 3 and 9 in a row. But not for 2, 4 and 5.
Question
- The number 9 is not a very good number, because it's often get uneven to the row length.
- The number 12 is much better as it match 1, 2, 3 and 4. It starts perfectly with the first four numbers dividable. I could only wish it would be dividable with 5 etc as well. The number 12 is better than 9 in this case.
Are there more perfect numbers? I don't need more than 8 in a row.
For other readers here, I guess a math formula would be really helpful as well.
it's a perfect number as it's possible to divide with the first four numbersBut not with $,5, 7, 8, 9, 10, 11,$, so what makes it "perfect" for your use-case?. You'll need to explain that better. Maybe you mean the least common multiple of the first $,n,$ positive integers? – dxiv Apr 06 '18 at 05:59for 1 to 3 columns: 6 items
for 1 to 4 columns: 12 items
for 1 to 5 columns: 60 items
for 1 to 6 columns: Also 60 items - making it work for 2 and 3 gives you 6 for free.
for 1 to 7 columns: 420 items. 7 is a troublemaker.
for 1 to 8 columns: 840 items. For 1 to 8, exculding 7, 120 items.
for 1 to 9 columns: 2520 items. And making it work for 2 and 5 gives you 10 for free.
Leaving the troublemaking 5 and 7 out: 72 fits neatly into 1,2,3,4,6,8,9,12,etc cols. Or, bringing 5 back, 360 items fits neatly into 1,2,3,4,5,6,8,9,10,etc columns.
– Michael Hartley Apr 06 '18 at 06:19