OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
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
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Robert G. Wilson v, May 10 2001
STATUS
approved