Introduction and Credit
We all know and love our awesome rules to test whether a number is divisble by 11 or 3, which is just some clever sum over the digits of the number. Now this challenge takes this to a new level, by requiring you to compute the sum of the digits and then checking whether the result is a perfect integer square, neither of which operations usually can be done very short. As this property is also very hard to see when looking at a number, we want this to be done for entire lists of numbers so we can save human work. So this is your challenge now!
This was an assignment at my university functional programming course. This assignment is now closed and has been discussed in class and I have my professor's permission to post it here (I asked explicitely).
Specification
Input
Your input is a list of non-negative integers, in any standard I/O format.
You may choose the list format as your language needs it
Output
The output is a list of integers, in any standard I/O format.
What to do?
Filter out every integer from the input list for which the sum of the digits is not a a square (of an integer).
The order of the elements may not be changed, e.g. if you get [1,5,9]
you may not return [9,1]
Potential corner cases
0 is a non-negative integer and thus a valid input and 0 is also a valid integer root, e.g. 0 counts as an integer square.
The empty list is a valid input and output as well.
Who wins?
This is code-golf so the shortest answer in bytes wins!
Standard rules apply of course.
Test Cases
[1,4,9,16,25,1111] -> [1,4,9,1111]
[1431,2,0,22,999999999] -> [1431,0,22,999999999]
[22228,4,113125,22345] -> [22228,4,22345]
[] -> []
[421337,99,123456789,1133557799] -> []
Step-by-Step Example
Example input: [1337,4444]
Handling first number:
Sum of the digits of 1337: 1+3+3+7=14
14 is not an integer square, thus will be dropped!
Handling second number:
Sum of the digits of 4444: 4+4+4+4=16
16 is an integer square because 4*4=16, can get into the output list!
Example output: [4444]