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.

A348792 Numbers k such that the reverse concatenation of the first k binary numbers A098780(k) is prime.

Original entry on oeis.org

2, 3, 4, 7, 11, 13, 25, 97, 110, 1939
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2021

Keywords

Examples

			a(4) = 7 is because the binary number 111 110 101 100 11 10 1 (with no spaces), which is 128413 in decimal, is prime.
		

Crossrefs

Programs

  • Maple
    q:= n-> isprime(Bits[Join](['Bits[Split](i)[]'$i=1..n])):
    select(q, [$1..200])[];  # Alois P. Heinz, Dec 03 2021
  • Mathematica
    f[n_] := FromDigits[Flatten @ IntegerDigits[Range[n, 1, -1], 2], 2]; Select[Range[120], PrimeQ[f[#]] &] (* Amiram Eldar, Dec 03 2021 *)
  • Python
    from sympy import isprime
    def afind(limit):
        s, k = "", 1
        for k in range(1, limit+1):
            s += bin(k)[2:][::-1]
            t = int(s[::-1], 2)
            if isprime(t):
                print(k, end=", ")
    afind(200) # Michael S. Branicky, Dec 03 2021

Extensions

a(8)-a(10) from Amiram Eldar, Dec 03 2021