login
A060979
|First digit - second digit + third digit - fourth digit ...| = 11.
3
209, 308, 319, 407, 418, 429, 506, 517, 528, 539, 605, 616, 627, 638, 649, 704, 715, 726, 737, 748, 759, 803, 814, 825, 836, 847, 858, 869, 902, 913, 924, 935, 946, 957, 968, 979, 1309, 1408, 1419, 1507, 1518, 1529, 1606, 1617, 1628, 1639, 1705, 1716
OFFSET
1,1
COMMENTS
Note that all terms are divisible by eleven.
LINKS
MAPLE
filter:= proc(n) local L, i;
L:= convert(n, base, 10);
abs(add(L[i]*(-1)^i, i=1..nops(L))) = 11
end proc:
select(filter, [$1..1000] *~ 11); # Robert Israel, Jun 02 2023
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 ] ] == 11, Print[ n ] ], {n, 1, 2000} ]
d11Q[n_]:=Module[{idn=IntegerDigits[n]}, Abs[Total[Table[(-1)^(i+1) idn[[i]], {i, Length[idn]}]]]==11]; Select[Range[1800], d11Q] (* Harvey P. Dale, Aug 26 2012 *)
PROG
(Haskell)
a060979 n = a060979_list !! (n-1)
a060979_list = filter (\x -> let digs = map (read . return) $ show x in
evens digs /= odds digs) [11, 22 ..]
where evens [] = 0; evens [x] = x; evens (x:_:xs) = x + evens xs
odds [] = 0; odds [x] = 0; odds (_:x:xs) = x + odds xs
-- Reinhard Zumkeller, Jul 05 2014
KEYWORD
base,nonn,easy
AUTHOR
Robert G. Wilson v, May 10 2001
EXTENSIONS
Erroneous comment deleted by Robert Israel, Jun 02 2023
STATUS
approved