# Find numbers with cubes?

GROUPS:
 Hi, Community! I'm trying to find numbers (calculted with some formula) only with cubes (54=27 * 2, 8 * 7=56 etc). For squares is a function SquareFreeQ in Mathematica, but i found nothing for cubes. I write smthng, but it doesn't works: For[t = 1, t <= 5, t++, If[StringFreeQ[ToString[FactorInteger[6 t^2 + 4719 t]], ",3}"], Print["{", t, ",",FactorInteger[6 t^2 + 4719 t], "},"]]] Real answer (if construction "StringFreeQ[ToString[FactorInteger..." works OK - answer'll be without first string) : {1,{{3,3},{5,2},{7,1}}}, {2,{{2,1},{3,1},{19,1},{83,1}}}, {3,{{3,2},{1579,1}}}, {4,{{2,2},{3,2},{17,1},{31,1}}}, {5,{{3,1},{5,1},{1583,1}}}, So, what's wrong?
 Neil Singer 3 Votes Alexey, cubeFind[x_Integer] := Select[FactorInteger[x], #[[2]] >= 3 &] This will find your cubes. You can return True or False instead by checking for Empty Set: cubeQ[x_Integer] := Not[Select[FactorInteger[x], #[[2]] >= 3 &] === {}] You can obviously just return the first part (the factor) or a list of factors by editing this.Regards