OFFSET
0,3
EXAMPLE
The pairs [no. of 1's, no. of 2's] are [1, 0], [5, 0], [4, 9], [5, 0], [25, 0], [12, 37], [4, 9], [20, 45], [69, 44], [5, 0], [25, 0], [20, 45], [25, 0], [125, 0], [52, 177], [12, 37], [60, 185], [281, 156], [4, 9], [20, 45], [97, 72], [20, 45], [100, 225], [353, 228], [69, 44], [345, 220], [448, 573], [5, 0], [25, 0], [20, 45], ...
MAPLE
# C3 Counts 1's and 2's
C3 := proc(f) local c, ix, iy, f2, i, t1, t2, n1, n2;
f2:=expand(f) mod 3; n1:=0; n2:=0;
if whattype(f2) = `+` then
t1:=nops(f2);
for i from 1 to t1 do t2:=op(i, f2); ix:=degree(t2, x); iy:=degree(t2, y);
c:=coeff(coeff(t2, x, ix), y, iy);
if (c mod 3) = 1 then n1:=n1+1; else n2:=n2+1; fi; od: RETURN([n1, n2]);
else ix:=degree(f2, x); iy:=degree(f2, y);
c:=coeff(coeff(f2, x, ix), y, iy);
if (c mod 3) = 1 then n1:=n1+1; else n2:=n2+1; fi; RETURN([n1, n2]);
fi;
end;
F3:=1/x+1+x+1/y+y mod 3;
g:=(F, n)->expand(F^n) mod 3;
[seq(C3(g(F3, n))[2], n=0..60)];
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 21 2015
STATUS
approved