Apolgies if this has been asked and answered, but I'm not even sure what to search for. I have two functions defined as follows:
F[n_]:=Max[Select[Divisors[n],#<=Sqrt[n]&]];
P[n_] := Select[Range[1, 1000], F[#] == n &];
I have two questions:
I have read the Mathematica help page on the
#symbol, and I think I understand most of that. I do not, however, understand what#and&do in this specific context.How can I write
P[n_ ]using a single line of code? It doesn't work if I simply copy and paste the definition for F into the definition of P:P[n_] := Select[ Range[1, 1000], Max[Select[Divisors[n],#<=Sqrt[n]&]] == n &]
With) is akin yours. – Leonid Shifrin Nov 04 '13 at 00:08