|
|
A351598
|
|
Digitally balanced numbers b (A031443) such that b^b is also digitally balanced.
|
|
0
|
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
MATHEMATICA
|
balQ[n_] := Module[{d = IntegerDigits[n, 2], m}, EvenQ @ (m = Length @ d) && Count[d, 1] == m/2]; Select[Range[10000], balQ[#] && balQ[#^#] &] (* Amiram Eldar, May 03 2022 *)
|
|
PROG
|
(Python)
from itertools import count, islice
def isdb(n): b = bin(n)[2:]; return b.count("0") == b.count("1")
def agen(): yield from (b for b in count(1) if isdb(b) and isdb(b**b))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,hard,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|