Although it is commonly said that Archimedes summed the geometric series in Quadrature of the Parabola, and summed squares of integers in On Conoids and Spheroids and On Spirals, that is not what he did. He "sums" not even areas of figures (as in numbers associated to them) but figures themselves, and he certainly does not relate any of that to stacking pebbles into triangular numbers, let alone to any algebraic manipulations. Those date to neo-Pythagoreans at least three centuries after Archimedes.
To see how different what Archimedes did is from a formula here is the relevant passage from On Spirals in Dijksterhuis's translation:
"If a series of any number of lines be given, which exceed one another by an equal amount, and the difference be equal to the least, and if other lines be given equal in number to these and in quantity to the greatest, the squares on the lines equal to the greatest, plus the square on the greatest and the rectangle contained by the least and the sum of all those exceeding one another by an equal amount will be the triplicate of all the squares on the lines exceeding one another by an equal amount."
"Translated" into a formula, nothing close to which could have been written until Vieta almost two millenia later, this becomes $$(n+1)L_n^2+L_1(L_1+L_2+\cdots+L_n)=3(L_1^2+L_2^2+\cdots+L_n^2),$$
where $L_{i+1}-L_i$ is constant.
How it was derived is discussed at length in section 1.2 of Mathematical Masterpieces by Knoebel et al., who remark that "while Archimedes expressed this as an equality of areas, today we tend to interpret it as just a formula about numbers, ignoring the dimensionality involved", and refer to Kanim's conjectural reconstruction of Archimedes’s geometric reasoning. The most detailed commentary on it with a step by step "discovery" guide is in Pengelley's Sums of Numerical Powers in Discrete Mathematics (pp. 8-10). Kanim, whose idea was published as a short note How Did Archimedes Sum Squares in the Sand? (freely available from MAA) accompanied by a "proof without words" (below), writes for her part:
"The modern transcriptions of his proof (Dijksterhuis, Heath, Heiberg) are completely algebraic and hard to follow. The geometry of Archimedes' proof is depicted visually below. Each step of his written proof is transparent in the geometry of the picture. One wonders if this is the picture Archimedes drew in the sand."
