A235923 Minimal k > 1 such that the base-k representation of the n-th Ramanujan prime (A104272), read in decimal, is also a Ramanujan prime.
3, 10, 4, 7, 10, 2, 10, 6, 5, 6, 5, 10, 7, 10, 8, 10, 2, 10, 10, 2, 10, 7, 4, 10, 10, 8, 3, 4, 10, 3, 3, 3, 10, 10, 4, 10, 3, 10, 10, 6, 7, 10
Offset: 1
Examples
The third Ramanujan prime is 17. If k=2, we have 10001, if k=3, we have 122, if k=4, we have 101. In this list, read in decimal, 101 is the first prime. Since 101 is a Ramanujan prime, then a(3)=4.
Programs
-
PARI
ramanujan_prime_list(n) = {my(L=vector(n), s=0, k=1); for(k=1, prime(3*n)-1, if(isprime(k), s++); if(k%2==0 && isprime(k/2), s--); if(s
A104272 a(n, vp, pmax) = {my(p=vp[n], d, np); for (b=2, 10, d = digits(p, b); np = fromdigits(d, 10); if (np > pmax, return (0)); if (vecsearch(vp, np), return (b)););} lista(nn) = {my(vp = ramanujan_prime_list(nn), pmax = vecmax(vp)); for (n=1, nn, my(result = a(n, vp, pmax)); if (result, print1(result, ", "), break););} \\ use nn=10^7 to get 42 terms \\ Michel Marcus, Dec 17 2018
Extensions
a(11)-a(42) from Michel Marcus, Dec 17 2018
Comments