OFFSET
0,3
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
FORMULA
EXAMPLE
6! = 720 decimal = 1320 octal, so a(6) = 2.
MAPLE
P:= 1: E:= 0: a[0]:= 1:
for n from 1 to 100 do
v:= padic:-ordp(n, 2);
P:= P*(n/2^v) mod 8;
E:= E + v;
if E mod 3 = 0 then a[n]:= P
elif E mod 3 = 1 then a[n]:= 2*(P mod 4)
else a[n]:= 4
fi
od:
seq(a[n], n=0..100); # Robert Israel, Sep 26 2018
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Carl R. White, Jan 16 2008
STATUS
approved