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!)
A136695 Final nonzero digit of n! in base 8. 16
1, 1, 2, 6, 3, 7, 2, 6, 6, 6, 4, 4, 6, 6, 4, 4, 3, 3, 6, 2, 5, 1, 6, 2, 6, 6, 4, 4, 6, 6, 4, 4, 6, 6, 4, 4, 2, 2, 4, 4, 4, 4, 1, 3, 4, 4, 3, 5, 6, 6, 4, 4, 2, 2, 4, 4, 4, 4, 3, 1, 4, 4, 5, 3, 3, 3, 6, 2, 1, 5, 6, 2, 2, 2, 4, 4, 2, 2, 4, 4, 5, 5, 2, 6, 3, 7, 2, 6, 2, 2, 4, 4, 2, 2, 4, 4, 6, 6, 4, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
From Robert Israel, Sep 26 2018: (Start)
If A011371(n) == 0 (mod 3) then a(n) = A049606(n) mod 8.
If A011371(n) == 1 (mod 3) then a(n) = 2*(A049606(n) mod 4).
If A011371(n) == 2 (mod 3) then a(n) = 4. (End)
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
Sequence in context: A280342 A275476 A185380 * A337115 A354372 A354111
KEYWORD
base,easy,nonn
AUTHOR
Carl R. White, Jan 16 2008
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 April 16 07:08 EDT 2024. Contains 371698 sequences. (Running on oeis4.)