login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A154384
Odd nonprimes with odd sum of digits.
1
1, 9, 21, 25, 27, 45, 49, 63, 65, 69, 81, 85, 87, 111, 115, 117, 119, 133, 135, 153, 155, 159, 171, 175, 177, 195, 201, 203, 205, 207, 209, 221, 225, 243, 245, 247, 249, 261, 265, 267, 285, 287, 289, 315, 319, 333, 335, 339, 351, 355, 357, 371, 375, 377, 391
OFFSET
1,2
LINKS
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
Odd nonprimes in A014076.
Sequence in context: A322336 A327685 A355535 * A327756 A210251 A143791
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Corrected and extended by Emeric Deutsch, Jan 21 2009
STATUS
approved