OFFSET
0,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8192
FORMULA
PROG
(Scheme)
;; A more practical version, needing only an implementation of A003986bi (bitwise-or, A003986) and memoization-macro definec:
(define (A285106 n) (apply + (bitwise_or_of_exp_lists (A260443as_coeff_list n) (A260443as_coeff_list (+ 1 n)))))
(define (bitwise_or_of_exp_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (bitwise_or_of_exp_lists nums2 nums1)) (else (map A003986bi nums1 (append nums2 (make-list (- len1 len2) 0)))))))
(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))))))
(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)))))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 11 2017
STATUS
approved