A154384 Odd nonprimes with odd sum of digits.
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
Examples
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
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
Crossrefs
Odd nonprimes in A014076.
Programs
-
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 *)
-
PARI
isok(n) = ! isprime(n) && (n % 2) && (sumdigits(n) % 2); \\ Michel Marcus, Sep 16 2016
Extensions
Corrected and extended by Emeric Deutsch, Jan 21 2009