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.

Showing 1-1 of 1 results.

A374179 a(n) is the least prime p such that the binary expansions of p and of the next prime q > p differ at exactly n positions, and p and q have the same binary length.

Original entry on oeis.org

2, 11, 47, 139, 157, 191, 1151, 1531, 3067, 7159, 20479, 36857, 49139, 98299, 360439, 917503, 1310719, 786431, 6291449, 5242877, 20971507, 58720253, 83886053, 201326557, 335544301, 402653171, 3489660919, 1879048183, 5368709117, 25769803751, 21474836479, 77309411323
Offset: 1

Views

Author

Hugo Pfoertner, Jul 09 2024

Keywords

Examples

			  a(n): 2       11           47               139                157
   np   3       13           53               149                163
      [1 0]  [1 0 1 1]  [1 0 1 1 1 1]  [1 0 0 0 1 0 1 1]  [1 0 0 1 1 1 0 1]
      [1 1]  [1 1 0 1]  [1 1 0 1 0 1]  [1 0 0 1 0 1 0 1]  [1 0 1 0 0 0 1 1]
         ^      ^ ^        ^ ^   ^            ^ ^ ^ ^          ^ ^ ^ ^ ^
  n:     1       2            3                  4                 5
		

Crossrefs

Programs

  • Python
    from sympy import nextprime
    def A374179(n):
        p, pb = 2, 2
        while (q:=nextprime(p)):
            if pb==(qb:=q.bit_length()) and (p^q).bit_count() == n:
                return p
            p, pb = q, qb  # Chai Wah Wu, Jul 10 2024
Showing 1-1 of 1 results.