Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My favorite "1 not behaving as a prime" example.

Here are two simple javascript functions:

function f(n,k){ var t = 0; for( var j = 2; j <= n; j++ )t += 1/k - f(n/j, k+1); return t;} function p(n){ return f(n,1)-f(n-1,1); }

If you call p(n) when n is prime, it will return 1. If you call p(n) when n is a prime power (so, say, 4 or 9 or 16), it will return 1/power (so p(4) is .5, p(8) is .3333..., etc). If you call p(n) with a number with multiple prime bases (so 6 or 14 or 30 or...), it will return 0.

And if you call p(1), it will return 0, NOT 1.

In fact, f(n,1) here is a compact (and slow) way of computing the Riemann Prime Counting function: http://mathworld.wolfram.com/RiemannPrimeCountingFunction.ht...

Another way to compute this exact same function (given as (8) on that link) uses the famous Riemann Zeta function zeroes, although that is much harder to follow.

Now, the behavior of the Riemann Prime Counting function doesn't PROVE that 1 isn't a prime, which, as noted, is a question about definition. But what it does do is show that, in an extremely important context, a context that seems to be, mathematically, solely about identifying primes, 1 isn't behaving like the primes at all.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: