# Subset of the integers with certain properties

How would one find the maximal $n$ such that there exists an $n$-subset $S$ of $\mathbb{Z}^+$ such that $\forall A\subseteq S, \sum_{a\in A}a$ is either a perfect square or a perfect cube, or can one go arbitrarily large. This is the case if one loosens the restrictions to any perfect power. Also, what about the slightly more general case for perfect squares, cubes, $...$ up to $k$th powers for some $k$.

-
I think it is unknown that for S with, say 5 or more elements, that at least a third of it subsets add up to perfect powers or even squarefull numbers with common gcd 1. I have no references to support this more general assertion. –  The Masked Avenger Jul 25 '14 at 2:59
Of course, I then think of S being the first 5 positive integers. Very well, let's say one-half to be safe. –  The Masked Avenger Jul 25 '14 at 3:05
If you can find a set of 3 non-zero integers such that all subsets sum to squares, you will have solved the notorious integer cuboid problem. –  Gerry Myerson Jul 25 '14 at 3:19
I'd consider first two related questions: what is the largest $n$ for which there exists an $n$-set $S \subseteq \{1\ 2\ \ldots\}$ such that for every $A\subseteq S$ the sum $\sum_{a\in A}\ a^2$ is a square or a third power; and for the other question replace $a^2$ by $a^3$, and otherwise the question would look the same. Indeed, when a set of squares and cubes is large than the set of its squares or its cubes is at least half that large. –  Włodzimierz Holsztyński Jul 25 '14 at 9:06
All but at most two of the integers is a multiple of 4. Don't know if that helps. –  Brendan McKay Jul 26 '14 at 3:38

Dietmann and Elsholtz (Hilbert cubes in progression-free sets and in the set of squares, Israel J. Math. 192 (2012), 59–66) have shown that if $S\subseteq[1, x]$ is a set such that all subset sums are contained in the set of squares, then $|S|\leq (8/e+o(1))(\log\log x)^2$, and if all subset sums are contained in the set of $k$-th powers, $k\geq 3$, then $|S|\leq (4+o(1))\log\log x$. Their method is pretty flexible, so it should apply to your setting as well.