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 A052294 #59 Oct 30 2024 08:38:14 %S A052294 3,5,6,7,9,10,11,12,13,14,17,18,19,20,21,22,24,25,26,28,31,33,34,35, %T A052294 36,37,38,40,41,42,44,47,48,49,50,52,55,56,59,61,62,65,66,67,68,69,70, %U A052294 72,73,74,76,79,80,81,82,84,87,88,91,93,94,96,97,98,100 %N A052294 Pernicious numbers: numbers with a prime number of 1's in their binary expansion. %C A052294 No power of 2 is pernicious, but 2^n+1 always is. %C A052294 If a prime p is of the form 2^k -1, then p is included in this sequence. - _Leroy Quet_, Sep 20 2008 %C A052294 There are A121497(n) n-bit members of this sequence. - _Charles R Greathouse IV_, Mar 22 2013 %C A052294 A list of programming codes for pernicious numbers can be found in the Rosetta Code link. - _Martin Ettl_, May 27 2014 %H A052294 Iain Fox, <a href="/A052294/b052294.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from T. D. Noe, terms 1001..4000 from Daniel Arribas) %H A052294 Rosetta Code, <a href="http://rosettacode.org/wiki/Pernicious_numbers">Pernicious numbers</a> %e A052294 26 is in the sequence because the binary expansion of 26 is 11010 and 11010 has three 1's and 3 is prime, so the number of 1's in the binary expansion of 26 is prime. - _Omar E. Pol_, Apr 04 2016 %p A052294 filter:= n -> isprime(convert(convert(n,base,2),`+`)): %p A052294 select(filter, [$1..1000]); # _Robert Israel_, Oct 19 2014 %t A052294 Select[Range[6! ],PrimeQ[DigitCount[ #,2][[1]]]&] (* _Vladimir Joseph Stephan Orlovsky_, Feb 16 2010 *) %o A052294 (Haskell) %o A052294 a052294 n = a052294_list !! (n-1) %o A052294 a052294_list = filter ((== 1) . a010051 . a000120) [1..] %o A052294 -- _Reinhard Zumkeller_, Nov 16 2012 %o A052294 (PARI) is(n)=isprime(hammingweight(n)) \\ _Charles R Greathouse IV_, Mar 22 2013 %o A052294 (Python) %o A052294 from sympy import isprime %o A052294 def ok(n): return isprime(bin(n).count("1")) %o A052294 print([k for k in range(101) if ok(k)]) # _Michael S. Branicky_, Jun 16 2022 %o A052294 (Python) %o A052294 from sympy import isprime %o A052294 def ok(n): return isprime(n.bit_count()) %o A052294 print([k for k in range(101) if ok(k)]) # _Michael S. Branicky_, Dec 27 2023 %Y A052294 Cf. A000069, A001969, A010051, A000120, A081092 (primes). %Y A052294 Cf. A262481 (subsequence). %K A052294 easy,base,nice,nonn %O A052294 1,1 %A A052294 Jeremy Gow (jeremygo(AT)dai.ed.ac.uk), Feb 08 2000