Write a function P2:
P2
input parameter: a list A containing several integers
A
return value: the sum of square numbers that are in the prime index