login
For n with a unique factorial base representation n = du*u! + ... + d2*2! + d1*1! (each di in range 0..i, cf. A007623), a(n) = Product_{i=1..u} (gcd(d_i,i+1) mod i+1), where u is given by A084558(n).
2

%I #18 Jan 20 2020 21:42:29

%S 1,0,1,0,1,0,0,0,1,0,1,0,0,0,2,0,2,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,

%T 1,0,0,0,2,0,2,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,2,0,2,0,0,0,

%U 1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,2

%N For n with a unique factorial base representation n = du*u! + ... + d2*2! + d1*1! (each di in range 0..i, cf. A007623), a(n) = Product_{i=1..u} (gcd(d_i,i+1) mod i+1), where u is given by A084558(n).

%H Antti Karttunen, <a href="/A231715/b231715.txt">Table of n, a(n) for n = 1..10080</a>

%e For n=13, with factorial base representation '201' (= A007623(13), 2*3! + 0*2! + 1*1! = 13) we have, starting from the least significant digit, (gcd(1,2) mod 2)*(gcd(0,3) mod 3)*(gcd(2,4) mod 4) = (1 mod 2)*(3 mod 3)*(2 mod 4) = 1*0*2 = 0, thus a(13)=0.

%e For n=17, with factorial base representation '221' (= A007623(17), 2*3! + 2*2! + 1*1! = 17) we have, starting from the least significant digit, (gcd(1,2) mod 2)*(gcd(2,3) mod 3)*(gcd(2,4) mod 4) = (1 mod 2)*(1 mod 3)*(2 mod 4) = 1*1*2 = 2, thus a(17)=2.

%o (Scheme)

%o (define (A231715 n) (let loop ((n n) (i 2) (p 1)) (cond ((zero? n) p) (else (loop (floor->exact (/ n i)) (+ i 1) (* p (modulo (gcd (modulo n i) i) i)))))))

%Y Cf. A231716 (positions of ones), A227157 (the positions of nonzero terms), A007623.

%Y Each a(n) <= A208575(n).

%K nonn

%O 1,15

%A _Antti Karttunen_, Nov 12 2013