Hacker News new | ask | show | jobs
by tess0r 3267 days ago
This remembers me of "primetime" a "clock" which draws a green bar every time the timestamp is a prime.

https://tessi.github.io/primetime

Did it in my student years, looks awful today, but I was proud back then ;)

edit:

I just remembered that you can give it a timestamp to display (instead of just displaying the current time). Unix Time 1,500M would be

https://tessi.github.io/primetime/?t=1500000000

and is (obviously) not a prime number.

3 comments

> looks awful today

I don't know what you don't like about it but I think not only that it looks great, but also to me that's a design that's got character.

* the green lines are somehow weirdly blurred (for god know what reason)

* it's hard to notice that the current timestamp is the most right (white or green) bar. Would be nice to have the current time in the center.

* It's hard to get the concept without explanation (at first glance people just see weird green bars moving).

But then, I never meant to make a perfectly polished clock. It's good for a quick experiment.

That's oddly compelling to watch. And there's that human urge to try and see a pattern in the prime groupings.
You can fiddle with the displayed time (by editing the url) -- it's fun to see that (very) early timestamps have much greater chance to be a prime number.

Also, sometimes, you can find "twin primes". https://tessi.github.io/primetime/?t=1500000000 has such a twin-pair in the center of the screen (the twins are 1499999927 and 1499999929).

I was interested when 10^n events would happen and ran in a nice litte bug. I like to believe that this marks the end of all times: https://tessi.github.io/primetime/?t=10000000000000
Javascript's maximum date is Sat, 13 Sep 275760 (=8640000000000), so you've actually gone some ~43,000 years past the end of all time.
A quick shell version:

   while true; do if test $(factor $(date +%s) | wc -w) = 2; then echo -n '|'; else echo -n ' '; fi; sleep 1; done
You can also just watch what the prime factorisation of the current time is like this:

    watch -n 1 'date +%s | factor'