A373460 Numbers k such that k and k+1 both have an equal number of even and odd digits.
29, 49, 69, 89, 1009, 1029, 1049, 1069, 1089, 1209, 1229, 1249, 1269, 1289, 1409, 1429, 1449, 1469, 1489, 1609, 1629, 1649, 1669, 1689, 1809, 1829, 1849, 1869, 1889, 2109, 2129, 2149, 2169, 2189, 2309, 2329, 2349, 2369, 2389, 2509, 2529, 2549, 2569, 2589, 2709
Offset: 1
Examples
29 is a term since it has one even digit (2) and one odd digit (9), and 29+1 = 30 also has one even digit (0) and one odd digit (3).
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
q[n_] := Module[{d = Differences[Tally[Mod[IntegerDigits[n], 2]]]}, d != {} && d[[1, 2]] == 0]; Select[Range[3000], q[#] && q[# + 1] &]
-
PARI
iseq(n) = {my(o = 0, e = 0); while(n > 0, if((n%10) % 2 == 0, e++, o++); n \= 10); e == o;} lista(kmax) = {my(q1 = 0, q2); for(k = 1, kmax, q2 = iseq(k); if(q1 && q2, print1(k-1, ", ")); q1 = q2);}
Formula
a(n) = 100 * A227870(floor(n/5)) + 20 * (n mod 5) + 9, for n > 4.
Comments