|
|
A253549
|
|
Maximal prime written in decimal among the base-k representations of the n-th prime, read in base 16, for k=2,3,...,16.
|
|
1
|
|
|
2, 17, 257, 19, 19, 19, 65537, 37, 65809, 53, 307, 257, 53, 547, 563, 293, 101, 277, 4099, 577, 4129, 8737, 787, 137, 577, 257, 593, 4643, 4657, 773, 577, 821, 311, 313, 268501249, 74017, 74257, 8707, 359, 8753, 8963, 613, 9011, 12289, 285212929, 577, 135697
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
For n = 19, 67 is the 19th prime, and written in base 2, ..., is '1000011', '2111', '1003', '232', '151', '124', '103', '74', '67', '61', '57', '52', '4b', '47', '43'. Out of these, when read in as hexadecimal numbers, the first prime is 1003_16 which is 4099_10.
|
|
PROG
|
(Python)
from sympy import prime, isprime
....p = prime(n)
....for b in range(2, 17):
........x, y, z = p, 0, 1
........while x >= b:
............x, r = divmod(x, b)
............y += r*z
............z *= 16
........y += x*z
........if isprime(y):
............return y
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|