login
A354300
Numbers k such that k! and (k+1)! have the same binary weight (A000120).
2
0, 1, 3, 5, 7, 8, 12, 13, 15, 31, 63, 88, 127, 129, 131, 244, 255, 262, 263, 288, 300, 344, 511, 793, 914, 1012, 1023, 1045, 1116, 1196, 1538, 1549, 1565, 1652, 1817, 1931, 1989, 2047, 2067, 2096, 2459, 2548, 2862, 2918, 2961, 3372, 3478, 3540, 3588, 3673, 3707
OFFSET
1,3
COMMENTS
Numbers k such that A079584(k) = A079584(k+1).
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
EXAMPLE
1 is a term since A079584(1) = A079584(2) = 1.
3 is a term since A079584(3) = A079584(4) = 2.
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
A354301 is a subsequence.
Sequence in context: A276112 A228075 A309405 * A032420 A127458 A039003
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, May 23 2022
STATUS
approved