OFFSET
1,2
COMMENTS
EXAMPLE
MATHEMATICA
s[n_] := s[n] = DigitCount[n!, 2, 1]; Select[Range[0, 300], s[#] == s[# + 1] == s[# + 2] &]
PROG
(Python)
from itertools import count, islice
def wt(n): return bin(n).count("1")
def agen(): # generator of terms
n, fn, fn1, fn2, wtn, wtn1, wtn2 = 0, 1, 1, 2, 1, 1, 1
for n in count(0):
if wtn == wtn1 == wtn2: yield n
fn, fn1, fn2 = fn1, fn2, fn2*(n+3)
wtn, wtn1, wtn2 = wtn1, wtn2, wt(fn2)
print(list(islice(agen(), 4))) # Michael S. Branicky, May 23 2022
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Amiram Eldar, May 23 2022
STATUS
approved