login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A354301
Numbers k such that k!, (k+1)! and (k+2)! have the same binary weight (A000120).
1
0, 7, 12, 262, 12887667
OFFSET
1,2
COMMENTS
Numbers k such that A079584(k) = A079584(k+1) = A079584(k+2).
The corresponding values of A079584(k) are 1, 6, 12, 747, 136453086, ...
EXAMPLE
7 is a term since A079584(7) = A079584(8) = A079584(9) = 6.
12 is a term since A079584(12) = A079584(13) = A079584(14) = 12.
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
Subsequence of A354300.
Sequence in context: A298678 A219777 A157808 * A225227 A217793 A299472
KEYWORD
nonn,base,more
AUTHOR
Amiram Eldar, May 23 2022
STATUS
approved