cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A354301 Numbers k such that k!, (k+1)! and (k+2)! have the same binary weight (A000120).

This page as a plain text file.
%I A354301 #9 May 23 2022 17:22:35
%S A354301 0,7,12,262,12887667
%N A354301 Numbers k such that k!, (k+1)! and (k+2)! have the same binary weight (A000120).
%C A354301 Numbers k such that A079584(k) = A079584(k+1) = A079584(k+2).
%C A354301 The corresponding values of A079584(k) are 1, 6, 12, 747, 136453086, ...
%e A354301 7 is a term since A079584(7) = A079584(8) = A079584(9) = 6.
%e A354301 12 is a term since A079584(12) = A079584(13) = A079584(14) = 12.
%t A354301 s[n_] := s[n] = DigitCount[n!, 2, 1]; Select[Range[0, 300], s[#] == s[# + 1] == s[# + 2] &]
%o A354301 (Python)
%o A354301 from itertools import count, islice
%o A354301 def wt(n): return bin(n).count("1")
%o A354301 def agen(): # generator of terms
%o A354301     n, fn, fn1, fn2, wtn, wtn1, wtn2 = 0, 1, 1, 2, 1, 1, 1
%o A354301     for n in count(0):
%o A354301         if wtn == wtn1 == wtn2: yield n
%o A354301         fn, fn1, fn2 = fn1, fn2, fn2*(n+3)
%o A354301         wtn, wtn1, wtn2 = wtn1, wtn2, wt(fn2)
%o A354301 print(list(islice(agen(), 4))) # _Michael S. Branicky_, May 23 2022
%Y A354301 Subsequence of A354300.
%Y A354301 Cf. A000120, A000142, A079584, A353987.
%K A354301 nonn,base,more
%O A354301 1,2
%A A354301 _Amiram Eldar_, May 23 2022