A157715 Primes sorted on digit sums, then on the primes.
2, 11, 101, 3, 13, 31, 103, 211, 1021, 1201, 2011, 3001, 10111, 20011, 20101, 21001, 100003, 102001, 1000003, 1011001, 1020001, 1100101, 2100001, 10010101, 10100011, 20001001, 30000001, 101001001, 200001001, 1000000021, 1000001011
Offset: 1
Examples
There are only three primes with a digit sum of 2, and those are 2, 11, 101. Therefore these three primes are the first three terms of this sequence. There is only one prime with a digit sum of 3, and that's 3 itself. Any higher number with a digit sum of 3 is a nontrivial multiple of 3 and therefore composite. Then follows the first prime with a digit sum of 4, which is 13.
Crossrefs
Cf. A062341.
Programs
-
Mathematica
Prime@ Flatten@ Values@ Take[KeySort@ PositionIndex[Total@ IntegerDigits@ # & /@ Prime@ Range[10^7]], 3] (* Michael De Vlieger, Apr 07 2018 *)
Extensions
Comment edited by Robert Israel, Dec 28 2015
Comments