login
A277021
Left inverse of A277022.
3
0, 1, 2, 2, 6, 3, 4, 3, 30, 7, 8, 4, 12, 5, 6, 4, 210, 31, 32, 8, 36, 9, 10, 5, 60, 13, 14, 6, 18, 7, 8, 5, 2310, 211, 212, 32, 216, 33, 34, 9, 240, 37, 38, 10, 42, 11, 12, 6, 420, 61, 62, 14, 66, 15, 16, 7, 90, 19, 20, 8, 24, 9, 10, 6, 30030, 2311, 2312, 212, 2316, 213, 214, 33, 2340, 217, 218, 34, 222, 35, 36, 10, 2520, 241, 242
OFFSET
0,3
FORMULA
a(n) = A276085(A005940(1+n)).
Other identities. For all n >= 0:
a(A277022(n)) = n.
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
Left inverse of A277022.
Cf. also A277017.
Sequence in context: A128623 A182701 A277011 * A275037 A174833 A085738
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 26 2016
STATUS
approved