login
A295753
The longest side of a minimal rectangle made from n squares.
0
1, 2, 3, 2, 4, 3, 4, 4, 3, 4, 5, 4, 4, 5, 5, 4, 5, 6, 5, 5, 6, 5, 7, 6, 5, 7, 6, 6, 7, 6, 7, 7, 6, 7, 7, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 7, 8, 8, 7, 8, 9, 8, 8, 9, 8, 8, 9, 8, 9, 9, 8, 9, 9, 8, 9, 9, 9, 10, 9, 9, 10, 9, 9, 10, 9, 10, 10, 9, 10, 10, 9, 10, 10
OFFSET
1,2
COMMENTS
A rectangle is minimal with respect to its longest side.
FORMULA
a(k^2 - 1) = k + 1.
a(k^2) = k.
EXAMPLE
The longest side of a minimal rectangle of n = 5 squares has side length a(5) = 4:
+---+---+---+---+ +---+---+---+---+
| 1 | 1 | | | 1 | | 1 |
+---+---+ 2 + or +---+ 2 +---+
| 1 | 1 | | | 1 | | 1 |
+---+---+---+---+ +---+---+---+---+
a(6) = 3:
+---+---+---+ +---+---+
| 1 | 1 | 1 | | 1 | 1 |
+---+---+---+ +---+---+
| 1 | | or | 1 | 1 |
+---+ 2 + +---+---+
| 1 | | | 1 | 1 |
+---+---+---+ +---+---+
a(7) = 4:
+---+---+---+---+
| 1 | 1 | |
+---+---+ 2 +
| 1 | 1 | |
+---+---+---+---+
| | |
+ 2 + 2 +
| | |
+---+---+---+---+
MATHEMATICA
good[s_, w_] := w == {} || s >= Ceiling[Sqrt[Length[w]]] Max[w]; no1[w_] := Select[w, # > 1 &]; a[n_] := Block[{m = Ceiling@ Sqrt@ n, x, p, ok = False}, While[! ok, Do[p = Select[Sqrt@ IntegerPartitions[m x, {n}, Range[Sqrt@ n]^2], good[x, no1[#]] &]; If[p != {}, ok = True; Print["a[", n, "]=", m, " (", x, " x ", m, ") = ", no1@ First@ p]; ok = True; Break[]], {x, m}]; m++]; m - 1]; Array[a, 100] (* correct at least for n <= 1000, Giovanni Resta, Nov 28 2017 *)
CROSSREFS
Sequence in context: A004596 A118653 A173753 * A144968 A239328 A076753
KEYWORD
nonn
AUTHOR
Peter Kagey, Nov 26 2017
EXTENSIONS
More terms from Giovanni Resta, Nov 28 2017
STATUS
approved