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.

A382631 Integers whose binary representation contains exactly four 1's, no two 1's being adjacent.

This page as a plain text file.
%I A382631 #42 Apr 07 2025 16:05:13
%S A382631 85,149,165,169,170,277,293,297,298,325,329,330,337,338,340,533,549,
%T A382631 553,554,581,585,586,593,594,596,645,649,650,657,658,660,673,674,676,
%U A382631 680,1045,1061,1065,1066,1093,1097,1098,1105,1106,1108,1157,1161,1162,1169,1170
%N A382631 Integers whose binary representation contains exactly four 1's, no two 1's being adjacent.
%C A382631 Subsequence of A003714 and of A014312.
%e A382631 85 = 1010101_2, 1066 = 10000101010_2.
%o A382631 (Python)
%o A382631 def A382631_gen(): # generator of terms
%o A382631     n = 15
%o A382631     yield 85
%o A382631     while True: yield int(bin(n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)[2:].replace('1','01'),2)
%o A382631 A382631_list = list(islice(A382631_gen(),30))
%Y A382631 Cf. A003714, A014312, A136318, A173589.
%K A382631 nonn,easy,base
%O A382631 1,1
%A A382631 _Chai Wah Wu_, Apr 07 2025