How do I get this equation to multiply by itself?
*/-.%~.q:36
other than repeating the number 36 again. It's Euler's Totient Function by the way.
I'm lacking the last step of multiplying this by itself.
Yes, I know they already have the code for this function at jsoftware. But I'm trying to break down the codes and learn.
Sorry to ask such simple questions. It's really hard to find help for J on Google.
Short answer
is
Longer answer
You have a case of
where
f
is the dyad*
andg
is the function that you already had:*/-.%~.q:
. Now,y f (g(y))
transforms simply to the "train"(f g) y
(as you can see at the manual). Using Cap[:
* to parenthesizeg
:we finally have:
or
* You can use Atop and At to construct function
g
but Cap is usually clearer for trains.