login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A182106 Number of tilings of an n X n square with rectangles with integer sides and area n. 1
1, 1, 2, 2, 9, 2, 46, 2, 250, 37, 254, 2, 31052, 2, 1480, 896, 306174, 2, 2097506, 2, 6025516, 6638, 59930, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Table of n, a(n) for n=0..23.

Dividing a square into equal-sized rectangles at math.stackexchange

PROG

(Java)

public class Question130758 {

    final static int maxn = 23;

    static int n;

    static int [] divisors = new int [maxn];

    static int ndivisors;

    static boolean [] [] grid;

    static int count;

    public static void main (String [] args) {

        for (n = 0; n <= maxn; n++) {

            ndivisors = 0;

            for (int divisor = 1; divisor <= n; divisor++)

                if (n % divisor == 0)

                    divisors [ndivisors++] = divisor;

            grid = new boolean [n] [n];

            count = 0;

            recurse (0, 0, 0);

            System.out.print (count + ", ");

        }

        System.out.println ();

    }

    static void recurse (int x, int y, int depth) {

        if (depth == n) {

            count++;

            return;

        }

        while (grid [x] [y])

            if (++x == n) {

                x = 0;

                y++;

            }

        outer:

        for (int k = 0; k < ndivisors; k++) {

            int w = divisors [k];

            int h = n / w;

            if (x + w > n || y + h > n)

                continue;

            for (int i = 0; i < w; i++)

                for (int j = 0; j < h; j++)

                    if (grid [x + i] [y + j])

                        continue outer;

            for (int i = 0; i < w; i++)

                for (int j = 0; j < h; j++)

                    grid [x + i] [y + j] = true;

            recurse (x, y, depth + 1);

            for (int i = 0; i < w; i++)

                for (int j = 0; j < h; j++)

                    grid [x + i] [y + j] = false;

        }

    }

}

CROSSREFS

Diagonal of A220122. - Alois P. Heinz, Dec 07 2012

Sequence in context: A108462 A327859 A343824 * A308037 A011403 A113554

Adjacent sequences:  A182103 A182104 A182105 * A182107 A182108 A182109

KEYWORD

nonn

AUTHOR

Felix A. Pahl, Apr 12 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 8 03:17 EST 2021. Contains 349590 sequences. (Running on oeis4.)