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.

A337258 Primes p such that p and the prime next to p are both digitally balanced numbers in base 2 (A031443).

Original entry on oeis.org

37, 139, 557, 563, 613, 647, 653, 659, 2389, 2467, 2699, 2851, 8311, 8423, 8627, 8677, 8681, 8807, 8819, 9011, 9043, 9049, 9157, 9319, 9323, 9419, 9613, 9803, 9811, 9817, 9829, 9923, 10331, 10343, 10453, 10597, 11279, 11317, 11353, 11399, 11587, 11783, 11789
Offset: 1

Views

Author

Amiram Eldar, Nov 21 2020

Keywords

Comments

Prime p such that p and the prime next to p are both terms of A066196.

Examples

			37 is a term since it is a prime number, and both 37 and the next prime, 41, are digitally balanced in base 2: the binary representation of 37 is 100101, the binary representation of 41 is 101001, and both contain 3 0's and 3 1's.
		

Crossrefs

Programs

  • Mathematica
    digBalQ[n_] := Module[{d = IntegerDigits[n, 2], m}, EvenQ@(m = Length@d) && Count[d, 1] == m/2]; p = Select[Range[3*10^4], PrimeQ]; p[[Position[Partition[digBalQ /@ p, 2, 1], {True, True}] // Flatten]]