OFFSET
0,4
COMMENTS
a(n) is the major index (1st definition) of n!.
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..10000
PROG
(Python)
import math
def M(n):
x=bin(int(n))[2:]
s=0
for i in range(1, len(x)):
if x[i-1]=="1" and x[i]=="0":
s+=i
return s
a=lambda n: M(math.factorial(n))
CROSSREFS
KEYWORD
nonn
AUTHOR
Indranil Ghosh, Jan 04 2017
STATUS
approved