Collection from a sequence that constitute a perfect square Given the sequence OEIS A033581, which is the infinite sequence, the n'th term (0-indexing) is given by the closed form formula 6 × n2 .

Your task is to write code, which outputs all the subsets of the set of N first numbers in the sequence, such that the sum of the subset is a perfect square.

Rules


The integer N is given as input.
You cannot reuse a number already used in the sum. (that is, each number can appear in each subset at most once)
Numbers used can be non-consecutive.
Code with the least size wins.


Example

The given sequence is {0,6,24,54,96,...,15000}

One of the required subsets will be {6,24,294}, because

6+24+294 = 324 = 18^2


You need to find all such sets of all possible lengths in the given range.
05AB1E, 10 bytes
Ý¨n6*æʒOÅ²

Try it online!
How?

Ý¨n6*æʒOÅ² || Full program. I'll call the input N.

Ý          || 0-based inclusive range. Push [0, N] ∩ ℤ.
 ¨         || Remove the last element.
  n        || Square (element-wise).
   6*      || Multiply by 6.
     æ     || Powerset.
      ʒ    || Filter-keep those which satisfy the following:
       O   ||---| Their sum...
        Å² ||---| ... Is a perfect square?