login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A277021 Left inverse of A277022. 3

%I #13 May 08 2021 23:05:32

%S 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,

%T 18,7,8,5,2310,211,212,32,216,33,34,9,240,37,38,10,42,11,12,6,420,61,

%U 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

%N Left inverse of A277022.

%H Antti Karttunen, <a href="/A277021/b277021.txt">Table of n, a(n) for n = 0..8191</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%H <a href="/index/Pri#primorialbase">Index entries for sequences related to primorial base</a>

%F a(n) = A276085(A005940(1+n)).

%F Other identities. For all n >= 0:

%F a(A277022(n)) = n.

%o (Scheme)

%o (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)))))

%o (Python)

%o from sympy import primorial, primepi, prime, factorint, floor, log

%o def a002110(n): return 1 if n<1 else primorial(n)

%o def a276085(n):

%o f=factorint(n)

%o return sum([f[i]*a002110(primepi(i) - 1) for i in f])

%o def A(n): return n - 2**int(floor(log(n, 2)))

%o def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))

%o def a(n): return a276085(b(n - 1))

%o print([a(n) for n in range(1, 101)]) # _Indranil Ghosh_, Jun 22 2017

%Y Left inverse of A277022.

%Y Cf. A005940, A276085.

%Y Cf. also A277017.

%K nonn,base

%O 0,3

%A _Antti Karttunen_, Sep 26 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 03:08 EDT 2024. Contains 371918 sequences. (Running on oeis4.)