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.
%I A280971 #12 Apr 21 2025 02:35:20 %S A280971 159,287,303,319,591,623,679,687,699,763,1135,1167,1203,1243,1247, %T A280971 1271,1351,1371,1391,1631,2167,2173,2231,2285,2319,2359,2463,2471, %U A280971 2495,2519,2743,2779,2787,2809,2863,2931,2933,2991,3029,3039,3503,4223,4279,4287,4319,4343,4411,4439,4479,4487 %N A280971 Composite numbers having the same bits as their prime factors (with multiplicity), including zero bits. %C A280971 Binary equivalent of A280928. %C A280971 Subsequence of A278909 as well as A280967. The terms in A278909 and A280967 but not this sequence are given by A280972. %H A280971 Ely Golden, <a href="/A280971/b280971.txt">Table of n, a(n) for n = 1..10000</a> %o A280971 (SageMath) %o A280971 def factorbits(x): %o A280971 if(x<2): %o A280971 return (0,0); %o A280971 s=0;t=0 %o A280971 f=list(factor(x)); %o A280971 #ensures inequality of numfactorbits(x) and bin(x).count("1") if x is prime %o A280971 if((len(f)==1)&(f[0][1]==1)): %o A280971 return (0,0); %o A280971 for c in range(len(f)): %o A280971 s+=bin(f[c][0]).count("1")*f[c][1] %o A280971 t+=(bin(f[c][0]).count("0")-1)*f[c][1] %o A280971 return (s,t); %o A280971 counter=2 %o A280971 index=1 %o A280971 while(index<=10000): %o A280971 if(factorbits(counter)==(bin(counter).count("1"),bin(counter).count("0")-1)): %o A280971 print(str(index)+" "+str(counter)) %o A280971 index+=1; %o A280971 counter+=1; %o A280971 (Python) %o A280971 from sympy import factorint %o A280971 def ok(n): %o A280971 f = factorint(n) %o A280971 return sum(f.values()) > 1 and sorted(bin(n)[2:]) == sorted("".join(bin(p)[2:]*f[p] for p in f)) %o A280971 print([k for k in range(5000) if ok(k)]) # _Michael S. Branicky_, Apr 20 2025 %Y A280971 Cf. A278909, A280967, A280928. %K A280971 nonn,base %O A280971 1,1 %A A280971 _Ely Golden_, Jan 11 2017