Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Help needed: calculating a grid layout for a given number...?

  • 04-11-2018 7:25pm
    #1
    Registered Users Posts: 3,393 ✭✭✭


    Is there a way of working out if a given number can be can be expressed as a grid?

    E.g. 100 can be expressed as 10 x 10, 5 x 20, 2 x 50, whatever...

    So, if I have a much larger number, is there a way of seeing if it can be expressed as a grid, without any gaps, if you see what I mean?

    E.g. 2578, 2738, whatever...

    Thanks.

    D.


Comments

  • Closed Accounts Posts: 4,121 ✭✭✭amcalester


    Would all numbers not be gridable? Even prime numbers could be 1 x N where N is the prime number.

    Conversely all numbers bar prime numbers have more than 1 grid option.


  • Registered Users Posts: 3,393 ✭✭✭Dinarius


    amcalester wrote: »
    Would all numbers not be gridable? Even prime numbers could be 1 x N where N is the prime number.

    Conversely all numbers bar prime numbers have more than 1 grid option.

    Thanks.

    So, let’s say 2738. Is that a prime number? Can it be expressed in any grid formation?

    Thanks.

    D.


  • Closed Accounts Posts: 4,121 ✭✭✭amcalester


    Dinarius wrote: »
    Thanks.

    So, let’s say 2738. Is that a prime number? Can it be expressed in any grid formation?

    Thanks.

    D.

    2738 is an even number so isn’t a prime, it can be

    2 x 1369
    37 x 74

    And then the opposite

    1369 x 2
    74 x 37

    You just want the factors of the number in question and those are your grids.


  • Registered Users Posts: 3,393 ✭✭✭Dinarius


    amcalester wrote: »
    2738 is an even number so isn’t a prime, it can be

    2 x 1369
    37 x 74

    And then the opposite

    1369 x 2
    74 x 37

    You just want the factors of the number in question and those are your grids.

    Brilliant!

    So, apart from 74 x 37, what other grid options do I have?

    Really grateful for this.

    Thanks!

    D.

    Ps. 2 x 1369 is way to elongated. 74 x 37 is much closer to the kind of rectangle I want.


  • Closed Accounts Posts: 4,121 ✭✭✭amcalester


    Dinarius wrote: »
    Brilliant!

    So, apart from 74 x 37, what other grid options do I have?

    Really grateful for this.

    Thanks!

    D.

    Ps. 2 x 1369 is way to elongated. 74 x 37 is much closer to the kind of rectangle I want.


    For 2738? None, those are the only factors. No other combination of 2 whole numbers can be multiplied to give you 2738.


  • Advertisement
  • Registered Users Posts: 3,393 ✭✭✭Dinarius


    That sorts it.

    Many thanks!

    D.


Advertisement