OFFSET
0,7
COMMENTS
a(n) is the major index (2nd 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:][::-1]
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