cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

997, 1699, 1789, 1879, 1987, 2689, 2797, 2887, 3499, 3697, 3769, 3877, 3967, 4597, 4759, 4957, 4993, 5479, 5569, 5659, 5749, 5839, 5857, 6199, 6379, 6397, 6469, 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
Offset: 1

Views

Author

Derek Orr, Nov 19 2014

Keywords

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

Examples

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

Crossrefs

Programs

  • 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 *)
  • PARI
    forprime(p=1,10^4,if(!isprime(sumdigits(p))&&sumdigits(p)%2,print1(p,", ")))