Hacker News new | past | comments | ask | show | jobs | submit login

It's often worthy to first check the OEIS[1] prior to committing a large number of cpu cycles to the effort.

[1] https://oeis.org/search?q=left+truncatable+primes+base&sort=...




I wonder why base 24 is such an extreme outlier. I had noticed it already when I was playing with this concept in Mathematica, it's the only one I couldn't exhaustively search.


These primes can be built up right to left, and the last "digit" of a prime, mod 24, can only take on phi(24) = 8 different values. (phi is Euler's phi function here.) So when you're considering adding on a digit (base 24) to the left of a prime, the chances of getting a prime are relatively high, since the last digit is already stacked in your favor. Notice that for example that sequence is really small when n is prime, because you don't get that same advantage. To get a lot of left truncatable primes you want your base n to be large (so you have a lot of choices at each step of the search) and you want phi(n)/n to be small (so you can stack the deck in your favor on the last digit).

And why does the sequence stop at 29? phi(30) = 8, setting a new minimum for phi(n)/n.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: