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.

A337306 a(n) is the least start of a run of exactly n consecutive prime numbers which are digitally balanced numbers in base 2 (A031443).

Original entry on oeis.org

2, 37, 557, 647, 9803, 192583, 698653, 150287, 34449209, 136017109, 191058199, 618408991, 564779279, 40434774727, 52195951979, 149416079731, 598718776379, 802636910771
Offset: 1

Views

Author

Amiram Eldar, Nov 21 2020

Keywords

Examples

			a(1) = 2 since 2 is a prime and a digitally balanced number and the next prime, 3, is not.
a(2) = 37 since 37 is a prime, 37 and the next prime, 41, are both digitally balanced in base 2, and the primes previous to 37 (31) and next to 41 (43) are not.
		

Crossrefs

Programs

  • Mathematica
    digBalQ[n_] := Module[{d = IntegerDigits[n, 2], m}, EvenQ@(m = Length@d) && Count[d, 1] == m/2]; s[max_] := Module[{seq = Table[0, {max}], count = 0, p = 2, pp, n}, While[count < max, If[digBalQ[p], pp = NextPrime[p]; n = 1; While[digBalQ[pp], n++; pp = NextPrime[pp]]; If[n <= max && seq[[n]] == 0, count++; seq[[n]] = p]; p = NextPrime[pp], p = NextPrime[p]]]; seq]; s[8]
Showing 1-1 of 1 results.