This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A354761 #13 Jul 29 2022 21:28:36 %S A354761 1,2,3,1,2,3,4,1,1,2,3,2,2,3,4,1,2,2,3,2,3,3,4,2,1,2,1,2,2,3,2,2,2,2, %T A354761 2,1,2,3,3,2,2,3,2,2,2,3,3,3,1,2,3,2,2,2,3,3,2,2,3,3,2,3,2,1,2,3,3,2, %U A354761 3,3,3,2,2,2,3,2,3,3,3,2,1,2,3,3,2,3 %N A354761 Least number of squares and cubes that add up to n. %C A354761 a(n) <= 4 since any number can be written as a sum of 4 squares (Lagrange's theorem). %C A354761 Sequence first differs from A063274, A225926 and A274459 at n = 32 since 32 is a powerful number, a prime power and a perfect power but neither a square nor a cube. %e A354761 a(1) = 1, a(4) = 1 (4 = 2^2), a(7) = 4 (7 = 2^2 + 1^2 + 1^2 + 1^2), a(8) = 1 (8 = 2^3), a(12) = 2 (12 = 2^3 + 2^2), a(17) = 2 (17 = 4^2 + 1^2), a(32) = 2 (32 = 4^2 + 4^2). %o A354761 (PARI) lista(n) = {my(v = vector(n)); for(j = 2, 3, for(i = 2, sqrtnint(n, j), v[i^j] = 1)); v[1]=1; v[2]=2; for(i=3, #v, if(v[i]==0, v[i] = vecmin(vector(i\2, k, v[k] + v[i-k])))); v} %Y A354761 Cf. A002760, A063274, A225926, A274459, A002376, A002828, A000290, A000578. %K A354761 nonn %O A354761 1,2 %A A354761 _Peter Schorn_, Jun 06 2022