Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #13 Sep 16 2016 02:44:13
%S 1,9,21,25,27,45,49,63,65,69,81,85,87,111,115,117,119,133,135,153,155,
%T 159,171,175,177,195,201,203,205,207,209,221,225,243,245,247,249,261,
%U 265,267,285,287,289,315,319,333,335,339,351,355,357,371,375,377,391
%N Odd nonprimes with odd sum of digits.
%H G. C. Greubel, <a href="/A154384/b154384.txt">Table of n, a(n) for n = 1..1000</a>
%e 1 is an odd nonprime and has an odd sum of digits, so a(1)=1.
%e 9 is an odd nonprime and has an odd sum of digits (and this is not true for any integers between 1 and 9), so a(2)=9.
%e 21 is an odd nonprime, and the sum of its digits (2+1=3) is odd (and this is not true for any integers between 9 and 21), so a(3)=21, etc.
%e 45 is in the sequence because it is odd, it is a nonprime and the sum of its digits (9) is odd. - _Emeric Deutsch_, Jan 21 2009
%p sd := proc (n) options operator, arrow: add(convert(n, base, 10)[j], j = 1 .. nops(convert(n, base, 10))) end proc: a := proc (n) if `mod`(n, 2) = 1 and isprime(n) = false and `mod`(sd(n), 2) = 1 then n else end if end proc: seq(a(n), n = 1 .. 400); # _Emeric Deutsch_, Jan 21 2009
%t Select[Complement[Range[1,501,2],Prime[Range[PrimePi[501]]]],OddQ[Total[IntegerDigits[#]]]&] (* _Harvey P. Dale_, Dec 11 2010 *)
%o (PARI) isok(n) = ! isprime(n) && (n % 2) && (sumdigits(n) % 2); \\ _Michel Marcus_, Sep 16 2016
%Y Odd nonprimes in A014076.
%K nonn,base
%O 1,2
%A _Juri-Stepan Gerasimov_, Jan 08 2009
%E Corrected and extended by _Emeric Deutsch_, Jan 21 2009