login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A061873 Numbers n such that |first digit - second digit + third digit - fourth digit ...| = 4. 1
4, 15, 26, 37, 40, 48, 51, 59, 62, 73, 84, 95, 103, 114, 125, 136, 147, 150, 158, 161, 169, 172, 183, 194, 202, 213, 224, 235, 246, 257, 260, 268, 271, 279, 282, 293, 301, 312, 323, 334, 345, 356, 367, 370, 378, 381, 389, 392, 400, 411, 422, 433, 444, 455 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
All terms == 4 or 7 (mod 11). - Robert Israel, Jun 03 2016
LINKS
MAPLE
F:= proc(n) option remember;
-procname(floor(n/10)) + (n mod 10)
end proc:
for j from 0 to 9 do F(j):= j od:
select(abs @ F = 4, [$1..1000]); # Robert Israel, Jun 03 2016
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 ] ] == 4, Print[ n ] ], {n, 1, 1000} ]
PROG
(Python)
def ok(n): return abs(sum((-1)**i*int(d) for i, d in enumerate(str(n))))==4
print(list(filter(ok, range(456)))) # Michael S. Branicky, Apr 15 2021
CROSSREFS
Sequence in context: A203231 A171788 A063129 * A017437 A281264 A372237
KEYWORD
nonn,base,easy
AUTHOR
Robert G. Wilson v, May 10 2001
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 19 14:52 EDT 2024. Contains 375302 sequences. (Running on oeis4.)