OFFSET
0,3
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8191
PROG
(Scheme)
;; A more practical standalone program, that uses memoization-macro definec:
(define (A276081 n) (sum_factorials_times_elements_in (A260443as_index_lists n)))
(definec (A260443as_index_lists n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) ((even? n) (cons 0 (A260443as_index_lists (/ n 2)))) (else (add_two_lists (A260443as_index_lists (/ (- n 1) 2)) (A260443as_index_lists (/ (+ 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 (sum_factorials_times_elements_in nums) (let loop ((s 0) (nums nums) (i 2) (f 1)) (cond ((null? nums) s) (else (loop (+ s (* (car nums) f)) (cdr nums) (+ 1 i) (* i f))))))
(Python)
from sympy import factorint, factorial as f, prime, primepi
from operator import mul
from functools import reduce
def a003961(n):
F=factorint(n)
return 1 if n==1 else reduce(mul, [prime(primepi(i) + 1)**F[i] for i in F])
def a260443(n): return n + 1 if n<2 else a003961(a260443(n//2)) if n%2==0 else a260443((n - 1)//2)*a260443((n + 1)//2)
def a276075(n):
F=factorint(n)
return 0 if n==1 else sum([F[i]*f(primepi(i)) for i in F])
def a(n): return a276075(a260443(n))
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 21 2017
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, Aug 18 2016
STATUS
approved