A123291 Numbers that are sum of a square and a nonnegative cube (with repetition).
0, 1, 1, 2, 4, 5, 8, 9, 9, 10, 12, 16, 17, 17, 24, 25, 26, 27, 28, 31, 33, 36, 36, 37, 43, 44, 49, 50, 52, 57, 63, 64, 64, 65, 65, 68, 72, 73, 76, 80, 81, 82, 89, 89, 91, 100, 100, 101, 108, 108, 113, 121, 122, 125, 126, 127, 128, 129, 129, 134, 141, 144, 145, 145, 148
Offset: 1
Keywords
Examples
Each of 1, 9, 17, 36 appear two times because 1=0^2+1^3=1^2+0^3, 9=1^2+2^3=3^2+0^3, 17=3^2+2^3==4^2+1^3, 36=3^2+3^3==6^2+0^3; 225 appears three times because 225=3^2+6^3=10^2+5^3=15^2+0^3; 1025 appears four times because 1025=5^2+10^3=30^2+5^3=31^2+4^3=32^2+1^3, etc.
Programs
-
Mathematica
Lim=148; s=Ceiling[Sqrt[Lim]];c=Ceiling[Lim^(1/3)];sq=Range[0,s]^2;cb=Range[0,c]^3;seq={};Do[AppendTo[seq,sq[[i]]+cb[[j]]],{i,s+1},{j,c+1}];Sort[Select[seq,#<=Lim&]] (* James C. McMahon, Nov 19 2024 *)
Comments