cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Chai Wah Wu, Jan 03 2015

Keywords

Comments

A base 16 variant of A236174.

Examples

			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.
		

Crossrefs

Cf. A236174.

Programs

  • Python
    from sympy import prime, isprime
    def A253549(n):
        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