A061871 |First digit - second digit + third digit - fourth digit ...| = 2.
2, 13, 20, 24, 31, 35, 42, 46, 53, 57, 64, 68, 75, 79, 86, 97, 101, 112, 123, 130, 134, 141, 145, 152, 156, 163, 167, 174, 178, 185, 189, 196, 200, 211, 222, 233, 240, 244, 251, 255, 262, 266, 273, 277, 284, 288, 295, 299, 310, 321, 332, 343, 350, 354, 361
Offset: 1
Programs
-
Mathematica
Do[ a = IntegerDigits[ n ]; l = Length[ a ]; e = o = {}; Do[ o = Append[ o, a[ [ 2k - 1 ] ] ], {k, 1, l/2 + .5} ]; Do[ e = Append[ e, a[ [ 2k ] ] ], {k, 1, l/2} ]; If[ Abs[ Apply[ Plus, o ] - Apply[ Plus, e ] ] == 2, Print[ n ] ], {n, 1, 1000} ]