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.

A029732 Palindromic primes in base 16 (or hexadecimal), but written here in base 10.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 257, 337, 353, 401, 433, 449, 787, 883, 947, 1301, 1381, 1429, 1493, 1831, 1847, 1879, 2039, 2377, 2393, 2441, 2473, 2521, 2843, 2939, 2971, 3019, 3067, 3373, 3389, 3469, 3517, 3533, 3581, 3919, 3967, 4079, 65537
Offset: 1

Views

Author

Keywords

Programs

  • Mathematica
    lst={};Do[p=Prime[n];If[IntegerDigits[p,16]==Reverse[IntegerDigits[p,16]],AppendTo[lst,p]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 31 2009 *)
  • PARI
    forprime(p=2,10^4, my(d=digits(p,16)); if(d==Vecrev(d),print1(p,", "))); \\ Joerg Arndt, Aug 17 2014
  • Python
    from itertools import chain
    from sympy import isprime
    from gmpy2 import digits
    A029732 = sorted((n for n in chain((int(digits(x,16)+digits(x,16)[::-1],16) for x in range(1,16**5)),(int(digits(x,16)+digits(x,16)[-2::-1],16) for x in range(1,16**5))) if isprime(n)))
    # Chai Wah Wu, Aug 16 2014