A114442 Least prime whose absolute difference between the sum of its even decimal digits and the sum of its odd decimal digits is n.
211, 23, 2, 3, 13, 5, 127, 7, 17, 281, 19, 137, 277, 139, 59, 881, 79, 179, 11299, 199, 1559, 2797, 1399, 599, 12799, 997, 1979, 86861, 1999, 13799, 25999, 13999, 49999, 172999, 70999, 19979, 1199929, 39799, 137999, 277999, 139999, 59999, 1299979
Offset: 0
Examples
a(0)=211 since 211 is the least prime which meets the criterion; i.e., |2 - (1+1)| = 0.
Programs
-
Mathematica
f[n_] := Block[{id = IntegerDigits@Prime@n}, Abs[(Plus @@ id) - 2Plus @@ Select[id, OddQ]]]; t = Table[0, {50}]; Do[ a = f[n]; If[ t[[a + 1]] == 0, t[[a + 1]] = n], {n, 100020}]; t
Comments