OFFSET
0,3
LINKS
PROG
(Scheme)
(define (A277021 n) (let loop ((s 0) (n n) (r 0) (i 1) (pr 1)) (cond ((zero? n) (+ s (* r pr))) ((even? n) (loop (+ s (* r pr)) (/ n 2) 0 (+ 1 i) (* (A000040 i) pr))) (else (loop s (/ (- n 1) 2) (+ 1 r) i pr)))))
(Python)
from sympy import primorial, primepi, prime, factorint, floor, log
def a002110(n): return 1 if n<1 else primorial(n)
def a276085(n):
f=factorint(n)
return sum([f[i]*a002110(primepi(i) - 1) for i in f])
def A(n): return n - 2**int(floor(log(n, 2)))
def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
def a(n): return a276085(b(n - 1))
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 22 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 26 2016
STATUS
approved