OFFSET
1,1
EXAMPLE
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.
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]
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Amiram Eldar, Nov 21 2020
STATUS
approved