login
Product of nonzero coefficients of the n-th Stern polynomial.
7

%I #12 Oct 26 2016 15:17:42

%S 1,1,1,1,1,2,1,1,1,2,2,3,1,4,1,1,1,2,2,9,2,12,3,6,1,6,4,9,1,8,1,1,1,2,

%T 2,18,2,20,9,24,2,32,12,30,3,40,6,12,1,12,6,45,4,60,9,24,1,18,8,27,1,

%U 16,1,1,1,2,2,36,2,60,18,48,2,72,20,160,9,140,24,72,2,96,32,200,12,240,30,140,3,120,40,160,6,160,12,24,1

%N Product of nonzero coefficients of the n-th Stern polynomial.

%C a(n) = product of nonzero terms on the n-th row of A125184.

%H Antti Karttunen, <a href="/A277325/b277325.txt">Table of n, a(n) for n = 0..8192</a>

%F a(n) = A005361(A260443(n)).

%F a(n) = A227349(A277020(n)).

%F a(2n) = a(n).

%F a(n) >= A277326(n).

%o (Scheme)

%o (define (A277325 n) (A005361 (A260443 n)))

%o ;; A standalone implementation:

%o (define (A277325 n) (reduce * 1 (filter positive? (A260443as_coeff_list n))))

%o (definec (A260443as_coeff_list n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) ((even? n) (cons 0 (A260443as_coeff_list (/ n 2)))) (else (add_two_lists (A260443as_coeff_list (/ (- n 1) 2)) (A260443as_coeff_list (/ (+ n 1) 2))))))

%o (define (add_two_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (add_two_lists nums2 nums1)) (else (map + nums1 (append nums2 (make-list (- len1 len2) 0)))))))

%Y Cf. A005361, A125184, A227349, A260443, A277020.

%Y Cf. also A277326 (lcm of nonzero coefficients) and A002487 (their sum).

%K nonn

%O 0,6

%A _Antti Karttunen_, Oct 13 2016