login
A061875
|First digit - second digit + third digit - fourth digit ...| = 6.
1
6, 17, 28, 39, 60, 71, 82, 93, 105, 116, 127, 138, 149, 170, 181, 192, 204, 215, 226, 237, 248, 259, 280, 291, 303, 314, 325, 336, 347, 358, 369, 390, 402, 413, 424, 435, 446, 457, 468, 479, 501, 512, 523, 534, 545, 556, 567, 578, 589, 600, 611, 622, 633, 644
OFFSET
1,1
LINKS
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 ] ] == 6, Print[ n ] ], {n, 1, 1000} ]
Select[Range[700], Abs[Total[Times@@@Partition[Riffle[IntegerDigits[#], {1, -1}, {2, -1, 2}], 2]]]==6&] (* Harvey P. Dale, May 21 2020 *)
PROG
(Python)
def ok(n): return abs(sum(int(d)*(-1)**i for i, d in enumerate(str(n))))==6
print(list(filter(ok, range(645)))) # Michael S. Branicky, Jun 17 2021
KEYWORD
nonn,base,easy
AUTHOR
Robert G. Wilson v, May 10 2001
STATUS
approved