OFFSET
1,5
COMMENTS
For this sequence, an i X j array and a j X i array are considered identical.
The number of different squares in an m X k array is S(m,k) = k(k+1)(3m-k+1)/6 = A082652(m,k) so that a(n) = the number of solutions to S(m,k) = n with m >= k.
a(n) has no upper bound.
It appears all natural numbers appear in the sequence. This is merely conjectured, but is provably true if there are an infinite amount of Sophie-Germain primes.
FORMULA
a(n) = Sum_{k=1...N} [n == k(k+1)(2k+1)/6 (mod k(k+1)/2)] where [] is the Iverson bracket and N is the largest natural number such that N(N+1)(2N+1)/6 <= n.
EXAMPLE
For n=8, the a(8) = 2 rectangular arrays are
-------------------------
|A |B |C |D |E |F |G |H |
-------------------------
and
----------
|A |B |C |
----------
|D |E |F |
----------
The first contains n = 8 unit squares (and none bigger).
The second contains 6 unit squares and two 2 X 2 squares (ABDE, BCEF), for S(3,2) = 8 = n squares.
PROG
(Python)
def a(n):
output = 0
k = 1
while k*(k+1)*((2*k)+1) <= 6*n:
if (n - (k*(k+1)*((2*k)+1)//6)) % (k*(k+1)//2) == 0:
output += 1
k += 1
return output
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Adams, Jan 02 2025
STATUS
approved