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.

A093688 Numbers m such that all divisors of m, excluding the divisor 1, have an even number of 1's in their binary expansions.

This page as a plain text file.
%I A093688 #44 Jul 28 2022 15:17:05
%S A093688 1,3,5,9,15,17,23,27,29,43,45,51,53,71,83,85,89,101,113,129,135,139,
%T A093688 149,153,159,163,197,215,249,255,257,263,267,269,277,281,293,303,311,
%U A093688 317,337,347,349,353,359,373,383,387,389,401,417,447,449,459,461,467,479
%N A093688 Numbers m such that all divisors of m, excluding the divisor 1, have an even number of 1's in their binary expansions.
%C A093688 Putting the 1 aside, these could be called odiousfree numbers, and are a subsequence of A001969. A093696 would be the evilfree numbers then. - _Irina Gerasimova_, Feb 08 2014.
%C A093688 Equivalently, numbers all of whose divisors > 1 are evil (A001969). - _Bernard Schott_, Jul 24 2022
%H A093688 Charles R Greathouse IV, <a href="/A093688/b093688.txt">Table of n, a(n) for n = 1..10000</a>
%e A093688 51 is in the sequence because, excluding 1, its divisors are 3, 17 and 51.
%e A093688 In binary: 11, 10001, 110011 all have an even number of 1's.
%t A093688 okQ[n_] := AllTrue[Rest[Divisors[n]], EvenQ[Total[IntegerDigits[#, 2]]]&]; Select[Range[500], okQ] (* _Jean-François Alcover_, Dec 06 2015 *)
%o A093688 (PARI) is(n)=sumdiv(n,d,hammingweight(d)%2)==1 \\ _Charles R Greathouse IV_, Mar 28 2013
%o A093688 (Python)
%o A093688 from sympy import divisors
%o A093688 def c(n): return n == 1 or bin(n).count("1")&1 == 0
%o A093688 def ok(n): return n > 0 and all(c(d) for d in divisors(n, generator=True))
%o A093688 print([k for k in range(480) if ok(k)]) # _Michael S. Branicky_, Jul 24 2022
%Y A093688 Cf. A001969, A093696, A356018, A356019, A356020.
%K A093688 nonn,base,easy
%O A093688 1,2
%A A093688 _Jason Earls_, May 16 2004
%E A093688 a(1) added by _Charles R Greathouse IV_, Mar 28 2013