Skip to main content
added 1 character in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87

#Mathematica, 140141 bytes

B=Subsets;Count[Table[FreeQ[IntegerQCount[FreeQ[IntegerQ/@Sqrt[FromDigits/@s[[i]]]@#],1<0]1<0]&/@(FoldPairList[TakeDrop,{is,Length[s=Union@Select[B@Rest@B[r=#]#]&/@Flatten[Permutations/@IntegerPartitions[Length[s=#]],Sort@Flatten@#==Sort@r&]]}]1]),1>0]&

**input** (a list of digits) >[{1,6,4}]

#Mathematica, 140 bytes

B=Subsets;Count[Table[FreeQ[IntegerQ/@Sqrt[FromDigits/@s[[i]]],1<0],{i,Length[s=Union@Select[B@Rest@B[r=#],Sort@Flatten@#==Sort@r&]]}],1>0]&

**input** (a list of digits) >[{1,6,4}]

#Mathematica, 141 bytes

Count[FreeQ[IntegerQ/@Sqrt[FromDigits/@#],1<0]&/@(FoldPairList[TakeDrop,s,#]&/@Flatten[Permutations/@IntegerPartitions[Length[s=#]],1]),1>0]&

**input** (a list of digits) >[{1,6,4}]
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87

#Mathematica, 140 bytes

B=Subsets;Count[Table[FreeQ[IntegerQ/@Sqrt[FromDigits/@s[[i]]],1<0],{i,Length[s=Union@Select[B@Rest@B[r=#],Sort@Flatten@#==Sort@r&]]}],1>0]&

**input** (a list of digits) >[{1,6,4}]