OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
EXAMPLE
1 is an odd nonprime and has an odd sum of digits, so a(1)=1.
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.
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.
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
MAPLE
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
MATHEMATICA
Select[Complement[Range[1, 501, 2], Prime[Range[PrimePi[501]]]], OddQ[Total[IntegerDigits[#]]]&] (* Harvey P. Dale, Dec 11 2010 *)
PROG
(PARI) isok(n) = ! isprime(n) && (n % 2) && (sumdigits(n) % 2); \\ Michel Marcus, Sep 16 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Juri-Stepan Gerasimov, Jan 08 2009
EXTENSIONS
Corrected and extended by Emeric Deutsch, Jan 21 2009
STATUS
approved