OFFSET
1,1
COMMENTS
a(n) == 9*(-1)^d (mod 11) if a(n) has d digits. - Robert Israel, Aug 05 2020
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
filter:= proc(n) local d, L, j;
L:= convert(n, base, 10);
d:= nops(L);
add(L[j]*(-1)^(d-j), j=1..d)=2
end proc:
select(filter, [$1..1000]); # Robert Israel, Aug 05 2020
MATHEMATICA
okQ[n_] := With[{id = IntegerDigits[n]}, id.Array[2 Mod[#, 2] - 1&, Length[id]] == 2]; Select[Range[1000], okQ] (* Jean-François Alcover, Nov 17 2016 *)
Select[Range[700], Total[Times@@@Partition[Riffle[IntegerDigits[#], {1, -1}, {2, -1, 2}], 2]] == 2&] (* Harvey P. Dale, Mar 01 2023 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, May 05 2001
EXTENSIONS
More terms from Robert G. Wilson v, May 10 2001 and from Larry Reeves (larryr(AT)acm.org), May 14 2001
STATUS
approved