A055770 Largest factorial number which divides n.
1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 24, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 24, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 24, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 24, 1, 2, 1, 2, 1, 6
Offset: 1
Examples
3! = 6 divides 12, so a(12) = 6.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10080
- Tyler Ball, Joanne Beckford, Paul Dalenberg, Tom Edgar, Tina Rajabi, Some Combinatorics of Factorial Base Representations, J. Int. Seq., Vol. 23 (2020), Article 20.3.3.
Programs
-
Mathematica
With[{rf=Reverse[Range[7]!]},Table[SelectFirst[rf,Divisible[n,#]&],{n,120}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 05 2017 *)
-
PARI
A055770(n) = { my(m=1, i=2); while(!(n%m), m *= i; i++); return(m/(i-1)); } \\ Antti Karttunen, Dec 19 2018
Formula
Extensions
Name changed, old name moved to comments by Antti Karttunen, Dec 19 2018
Comments