OFFSET
1,1
COMMENTS
Motivation from James Grime: "What is the smallest prime with digital sum odd, but not prime?"
This sequences differs from A106763 at a(55) = 8999.
The digit sums are multiples of primes > 3. If the digit sum is a multiple of 3, the number itself cannot be prime.
The first odd composite digit sums are 25 (first occurrence is for 997), 35 (first occurrence is for 8999), 49 (first occurrence is for 598999), 55 (first occurrence is for 2998999), 65 (first occurrence is for 29999999), 77 (first occurrence is for 699899999) ...
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
997 is prime but its digit sum is 25, which is odd and composite. So 997 is a member of this sequence.
MATHEMATICA
a247122[n_Integer] := Flatten@Last@Reap[Module[{i, digitSum}, digitSum[x_] := Plus @@ IntegerDigits[x]; For[i = 1, i < n,
If[OddQ[digitSum[Prime[i]]] && CompositeQ[digitSum[Prime[i]]],
Sow[Prime[i]], Null], i++]]]; a247122[1200] (* Michael De Vlieger, Nov 29 2014 *)
dsocQ[n_]:=Module[{s=Total[IntegerDigits[n]]}, OddQ[s]&&CompositeQ[s]]; Select[Prime[Range[1200]], dsocQ] (* Harvey P. Dale, Feb 21 2016 *)
PROG
(PARI) forprime(p=1, 10^4, if(!isprime(sumdigits(p))&&sumdigits(p)%2, print1(p, ", ")))
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Derek Orr, Nov 19 2014
STATUS
approved