login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A247122 Primes p such that the digit sum of p is an odd composite number. 1

%I #17 Feb 21 2016 10:55:24

%S 997,1699,1789,1879,1987,2689,2797,2887,3499,3697,3769,3877,3967,4597,

%T 4759,4957,4993,5479,5569,5659,5749,5839,5857,6199,6379,6397,6469,

%U 6577,6793,6829,6883,6991,7297,7369,7459,7477,7549,7639,7873,7927,7963,8089,8179,8269,8287,8377,8467,8539,8629,8647,8719,8737,8863,8971,8999

%N Primes p such that the digit sum of p is an odd composite number.

%C Motivation from James Grime: "What is the smallest prime with digital sum odd, but not prime?"

%C This sequences differs from A106763 at a(55) = 8999.

%C The digit sums are multiples of primes > 3. If the digit sum is a multiple of 3, the number itself cannot be prime.

%C 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) ...

%H Michael De Vlieger, <a href="/A247122/b247122.txt">Table of n, a(n) for n = 1..10000</a>

%e 997 is prime but its digit sum is 25, which is odd and composite. So 997 is a member of this sequence.

%t a247122[n_Integer] := Flatten@Last@Reap[Module[{i, digitSum}, digitSum[x_] := Plus @@ IntegerDigits[x]; For[i = 1, i < n,

%t If[OddQ[digitSum[Prime[i]]] && CompositeQ[digitSum[Prime[i]]],

%t Sow[Prime[i]], Null], i++]]]; a247122[1200] (* _Michael De Vlieger_, Nov 29 2014 *)

%t dsocQ[n_]:=Module[{s=Total[IntegerDigits[n]]},OddQ[s]&&CompositeQ[s]]; Select[Prime[Range[1200]],dsocQ] (* _Harvey P. Dale_, Feb 21 2016 *)

%o (PARI) forprime(p=1,10^4,if(!isprime(sumdigits(p))&&sumdigits(p)%2,print1(p,", ")))

%Y Cf. A106763, A007953.

%K nonn,base,easy

%O 1,1

%A _Derek Orr_, Nov 19 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)