A071764 Number of minimal rectangular envelopes (up to rotation) that enclose n contiguous squares.
1, 1, 1, 2, 3, 4, 6, 8, 11, 14, 17, 21, 26, 30, 36, 42, 48, 54, 62, 69, 78, 86, 95, 105, 116, 125, 136, 148, 160, 172, 186, 198, 213, 227, 242, 258, 274, 288, 306, 324, 342, 359, 379, 397, 418, 438, 458, 480, 503, 523, 546, 569, 593, 617, 643, 667, 693, 718, 745
Offset: 0
Examples
From _Francois Alcover_, Feb 28 2017: (Start) a(3) = 2: The two possible envelopes are |*| |*| |*| [3,1] and |*| | |*|*| [2,2] (End)
Links
- K. S. Brown, More info
Programs
-
Mathematica
a[0] = 1; a[n_] := (1/2)*(Floor[(n+1)/2] - Floor[Sqrt[n-1]] + n*(n+1)/2 - Sum[Floor[(n-1)/i], {i, 1, n}]); Table[a[n], {n, 0, 58}] (* Jean-François Alcover, Feb 01 2018, from PARI *)
-
PARI
for(n=1,100,print1(1/2*(n*(n+1)/2+floor((n+1)/2)-floor(sqrt(n-1))-sum(i=1,n,floor((n-1)/i))),","))
-
Python
from math import isqrt def A071764(n): return ((s:=isqrt(n-1))*(s-1)+1+(n>>1)+(n*(n+1)>>1)>>1)-sum((n-1)//k for k in range(1,s+1)) if n else 1 # Chai Wah Wu, Oct 31 2023
Comments