I'm trying to use the Count function for this purpose, but it's not working how I'd like it to. Does anybody know a simple way to do this counting?
I would like to be counting the number of "p"s in expressions like
p[1,2][1]^2 p[3,4][3]
or
p[3,3][1]
I would like the count to return 2 on the first one (even though one of the p's has a squared term), and 1 on the second.
edit: I realized for the purpose of counting I can remove the "square" so the first expression would just look like
p[1,2][1]p[3,4][3]
if that makes it any easier.
p[a, b][t]
? $\endgroup$f[p]
? $\endgroup$Principle of don't-ask-questions-to-expand-the-scope-of-the-question
. :) $\endgroup$