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.

A317294 Numbers with a noncomposite number of 1's in their binary expansion.

This page as a plain text file.
%I A317294 #34 Jul 23 2023 06:08:45
%S A317294 1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,24,25,26,28,31,
%T A317294 32,33,34,35,36,37,38,40,41,42,44,47,48,49,50,52,55,56,59,61,62,64,65,
%U A317294 66,67,68,69,70,72,73,74,76,79,80,81,82,84,87,88,91,93,94,96,97,98,100
%N A317294 Numbers with a noncomposite number of 1's in their binary expansion.
%C A317294 Union of powers of 2 and pernicious numbers.
%C A317294 All powers of 2 are in the sequence because the binary expansion of a power of 2 contains only one digit "1" and 1 is a noncomposite number (A008578).
%C A317294 If k is in the sequence then so is 2*k. - _David A. Corneth_, Aug 10 2018
%H A317294 Robert Israel, <a href="/A317294/b317294.txt">Table of n, a(n) for n = 1..10000</a>
%e A317294 8 is in the sequence because the binary expansion of 8 is 1000 and 1000 has one 1, and 1 is a noncomposite number (A008578).
%e A317294 26 is in the sequence because the binary expansion of 26 is 11010 and 11010 has three 1's, and 3 is a noncomposite number.
%p A317294 filter:= proc(n) local w;
%p A317294   w:= convert(convert(n,base,2),`+`);
%p A317294   w=1 or isprime(w)
%p A317294 end proc:
%p A317294 select(filter, [$1..1000]); # _Robert Israel_, Aug 15 2018
%t A317294 Select[Range[100], !CompositeQ[DigitCount[#, 2, 1]] &] (* _Amiram Eldar_, Jul 23 2023 *)
%o A317294 (PARI) is(n) = my(h=hammingweight(n)); ispseudoprime(h) || h==1 \\ _Felix Fröhlich_, Aug 10 2018
%Y A317294 Union of A000079 and A052294.
%Y A317294 The complement is A317295.
%Y A317294 All terms of A000051 are in this sequence.
%Y A317294 Cf. A000069, A000120, A001969, A008578, A084345.
%K A317294 nonn,base,easy
%O A317294 1,2
%A A317294 _Omar E. Pol_, Aug 10 2018