Re Mathematica 10.3 under Windows 7.
From the list {1,2,3,4,5} I want to zero in on 1 and 3 and return the list of their squares, i.e., {1,9}.
This is easy enough to do using
Cases[Range@5,1|3]^2.
Noting that this example is a grossly oversimplified instance of something else, I want to do this using a form like
Cases[Range@5, (1|3) :> #^2&]
(this returns an empty list). Can this be done? I've looked at the documentation PatternOverview
and don't find an answer (although may have missed it).
Thanks.