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!)
A176786 Last nonzero digit of A000043(n)!. 0
6, 4, 8, 6, 8, 6, 6, 8, 2, 6, 4, 4, 8, 8, 6, 2, 4, 2, 2, 2, 8, 2, 6, 2, 4, 4, 8, 6, 4, 2, 8, 6, 2, 6, 2, 8, 2, 6, 2, 8, 4, 6, 2, 8, 8, 8, 2, 8 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The C program, from first link, is based on a new method, see second link. It was developed from a congruence found in the first reference "Concrete Mathematics". The function D() of this program implements the simple division algorithm found in "D. E. Knuth, The Art of Computer Programming, V.2." (second reference). Another approach can be to use Dresden's formula that can be found from the third link. One can use the function LastDigit() of the mentioned program to find the last nonzero digit of N! for very large values of N. The factorial of the 47th (known) Mersenne prime has approximately 10^12,978,195 digits.
Many other algorithms for the general problem of finding the last nonzero digit of a factorial are given in A008904. [D. S. McNeil, Dec 10 2010]
REFERENCES
Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Math.; Addison-Wesley, section 4, exercises 40, and 54.
D. E. Knuth, The Art of Computer Programming, vol.2, section 4.3.1, exercise 16.
LINKS
W. Bomfim, C program
Gregory P. Dresden, Three transcendental numbers from the last non-zero digits of n^n, F_n and n!, Math. Mag., pp. 96-105, vol. 81, 2008. See Lemma 7.
FORMULA
a(n) = A008904(2^A000043(n)-1) = A008904(A000668(n)).
EXAMPLE
a(1) = 6 since the first Mersenne prime is 3, and 3! = 6.
CROSSREFS
Sequence in context: A197833 A334960 A340322 * A077669 A019774 A354630
KEYWORD
nonn,more,base
AUTHOR
Washington Bomfim, Dec 07 2010
EXTENSIONS
Terms for n <= 40 confirmed by D. S. McNeil, Dec 08 2010
a(41)-a(47) from Max Alekseyev, Jan 31 2012, Mar 16 2015, Dec 01 2019
a(48) from Chai Wah Wu, Dec 07 2023
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 25 07:53 EDT 2024. Contains 371964 sequences. (Running on oeis4.)