Using an allocatable array, an array constructor and the WHERE statement, write an HPF program implement the following algorithm for finding prime numbers:
Print out all non-zero entries of the vector (the prime numbers).
Hint: the WHERE statement is an array assignment statement and not a control construct therefore it cannot contain a PRINT statement. The PACK intrinsic can accept an array argument and a conformable MASK and will return a 1D vector of all the elements of the array where the corresponding mask elements are .TRUE..
Print*, PACK(Array,Mask)
Choose a suitable distribution for the Prime vector; look at the element reference patterns in order to make your decision.