Roger Hui wrote:
> Well, it can not be exactly the same formula because
> the J one finds semiprimes less than n while the
> MathWorld one finds those less than or equal to n .
> I derived the J computation before I saw the MathWorld
> one and saw that they are very similar.
>
The difference is pi versus plt: otherwise I think they are the same.
> As a mathematician, do you find the MathWorld formula?
>
> pi<sup>(2)</sup>(x)=sigma(k=1,pi(sqrt(n))) [pi(n/p<sub>k</sub>-k+1]
The MathWorld formula is expressed badly: I think it was hastily copied
without much understanding.
> The following are a list questions I have:
>
> - pi<sup>(2)</pi>(x) is non-standard, at least unusual.
I agree. It is also superfluous here: it is never referred to in the rest
of the article. An editor would strike it.
> Superscript usually means exponentiation.
...or functional iteration or.... The form here is most often seen with
derivatives. Again, it is not doing anything useful.
> - x should be n (I assume this is a typo)
Yes
> - Square brackets sometimes mean the nearest integer.
> In this case I think it just denotes grouping; the author
> could have used parens.
Given the number theory context, I initially assumed [] meant nearest
integer or floor. But the argument is integral, so the brackets are just
used for grouping. (The pi function is (strangely) defined to have real
arguments.) The real problem is the ill defined scope of the sum operator.
The author could have avoided this by writing
sum pi(n/p_k)-(k-1)
Since both terms contain the index of summation, they are in the sum.
Here is my rewrite of the formula (requires LaTeX):
\documentclass{article}
\begin{document}
\thispagestyle{empty}\noindent
Let $P$ be the set of primes $p$ such that $p^2<n$,
and let $m=\left| P\right|$.
Then the number of semiprimes less than or equal to $n$ is given by
$$\sum_{p\in P} \left(\pi(n/p)-\pi(p)\right)=
\sum_{p\in P} \pi(n/p)- \frac{m(m-1)}2.$$
\end{document}
> In J, with the same reasoning, one readily derives a computation
> that produces the actual semiprimes. That is an illustration
> of the power of J in dealing with arrays.
>
I agree.
Best wishes,
John
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm