login
Odd odious numbers (A000069), all divisors of which are odious.
1

%I #20 Aug 19 2019 02:59:04

%S 1,7,11,13,19,31,37,41,47,49,59,61,67,73,79,91,97,103,107,109,121,127,

%T 131,133,137,143,151,157,167,173,179,181,191,193,199,211,217,223,227,

%U 229,233,239,241,247,251,259,271,283,307,313,331,341,361,367,379,397,403

%N Odd odious numbers (A000069), all divisors of which are odious.

%C All primes are in A027697.

%H Robert Israel, <a href="/A227921/b227921.txt">Table of n, a(n) for n = 1..10000</a>

%p odious:= proc(n) option remember;

%p n::odd xor procname(floor(n/2))

%p end proc:

%p odious(0):= false:

%p odious(1):= true:

%p filter:= proc(n) andmap(odious, numtheory:-divisors(n)) end proc:

%p select(filter, [seq(i,i=1..500,2)]); # _Robert Israel_, Aug 18 2019

%t odiusQ[n_]:=OddQ[Total[IntegerDigits[n,2]]]; Select[Range[1,411,2], odiusQ[ #]&&AllTrue[Divisors[#],odiusQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Jun 08 2019 *)

%o (PARI) isodious(n) = {b = binary(n); sum(i=1, #b, b[i]==1) % 2;}

%o isok(n) = {if (!(n % 2), return (0)); fordiv(n, div, if (! isodious(div), return (0))); return (1);} \\ _Michel Marcus_, Oct 12 2013

%Y Cf. A000069, A027697.

%K nonn,base

%O 1,2

%A _Vladimir Shevelev_, Oct 09 2013