Notation without cases? $f(x)=\begin{cases}p,&\text{if $x=p^k$}\\1,&\text{otherwise}\end{cases}$

64 Views Asked by At

Is there any other way to write the function $f:\Bbb N\to\Bbb N$ such that $$f(x)=\begin{cases}p,&\text{if $x=p^k$}\\1,&\text{otherwise}\end{cases}$$ when $p$ is prime and $k\in\Bbb N$?

2

There are 2 best solutions below

1
On BEST ANSWER

The von Mangoldt function $\Lambda(n)$ is well-known in number theory. It is $\ln p$ for $n$ a power of a prime $p$ and 0 otherwise, so your $f(x)=e^{\Lambda(x)}$. However it is normally only defined on the positive integers. So it is not so good if you want your function defined on the reals.

0
On

We have $\displaystyle f(x) = p^{\min(v_p(x), 1)(1-\min(\sum_{l \ne p} v_l(x), 1))}$, not that the expression makes the function much easier to work with.