OFFSET
0,3
LINKS
PROG
;; A more practical version, needing only an implementation of A000040:
(define (A277198 n) (product_primes_to_kth_powers (gcd_of_exp_lists (A260443as_coeff_list n) (A260443as_coeff_list (+ 1 n)))))
(define (product_primes_to_kth_powers nums) (let loop ((p 1) (nums nums) (i 1)) (cond ((null? nums) p) (else (loop (* p (expt (A000040 i) (car nums))) (cdr nums) (+ 1 i))))))
(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)))))))
(define (gcd_of_exp_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (gcd_of_exp_lists nums2 nums1)) (else (map min nums1 (append nums2 (make-list (- len1 len2) 0)))))))
(PARI) A=[];
A003961(n)=my(f=factor(n)); f[, 1] = apply(p->nextprime(p+1), f[, 1]); factorback(f)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 10 2016
STATUS
approved