OFFSET
1,3
COMMENTS
The corresponding values of A079584(k) are 1, 1, 2, 4, 6, 6, 12, 12, 18, 42, ...
This sequence is infinite as it contains A000225. - Rémy Sigrist, May 23 2022
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..1000
EXAMPLE
MATHEMATICA
s[n_] := s[n] = DigitCount[n!, 2, 1]; Select[Range[0, 4000], s[#] == s[# + 1] &]
PROG
(Python)
from itertools import count, islice
def wt(n): return bin(n).count("1")
def agen(): # generator of terms
n, fn, fnplus, wtn, wtnplus = 0, 1, 1, 1, 1
for n in count(0):
if wtn == wtnplus: yield n
fn, fnplus = fnplus, fnplus*(n+2)
wtn, wtnplus = wtnplus, wt(fnplus)
print(list(islice(agen(), len(data)))) # Michael S. Branicky, May 23 2022
(PARI) isok(k) = hammingweight(k!) == hammingweight((k+1)!); \\ Michel Marcus, May 23 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, May 23 2022
STATUS
approved