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!)
A246160 Inverse function to the injection A065621. 5

%I #21 May 06 2021 11:04:44

%S 0,1,2,0,4,0,0,3,8,0,0,7,0,5,6,0,16,0,0,15,0,13,14,0,0,9,10,0,12,0,0,

%T 11,32,0,0,31,0,29,30,0,0,25,26,0,28,0,0,27,0,17,18,0,20,0,0,19,24,0,

%U 0,23,0,21,22,0,64,0,0,63,0,61,62,0,0,57,58,0,60,0,0,59,0,49,50,0,52

%N Inverse function to the injection A065621.

%C Sequence has nonzero values a(n) = k at those points n for which A065621(k) = n and zeros at those positions n which are not present in A065621.

%C Equally, sequence is obtained when the negative terms of A065620 are replaced with zeros

%H Antti Karttunen, <a href="/A246160/b246160.txt">Table of n, a(n) for n = 0..8192</a>

%F a(n) = A010060(n) * A065620(n).

%F a(n) = A246159(n) + A065620(n).

%F a(0) = 0, and for n >= 1, a(n) = A010060(n) * (1 + A006068(A115384(n)-1)).

%F For all n, a(A065621(n)) = n.

%o (Scheme, two different implementations)

%o (define (A246160 n) (* (A010060 n) (A065620 n)))

%o (define (A246160 n) (if (zero? n) n (* (A010060 n) (1+ (A006068 (-1+ (A115384 n)))))))

%o (PARI)

%o a065620(n) = if(n<3, n, if(n%2, -2*a065620((n - 1)/2) + 1, 2*a065620(n/2)));

%o a(n) = (hammingweight(n)%2)*a065620(n);

%o for(n=0, 100, print1(a(n),", ")) \\ _Indranil Ghosh_, Jun 07 2017

%o (Python)

%o def a065620(n): return n if n<3 else 2*a065620(n//2) if n%2==0 else -2*a065620((n - 1)//2) + 1

%o def a(n): return (bin(n)[2:].count("1")%2)*a065620(n)

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

%Y Cf. A246159, A006068, A010060, A115384, A065620, A065621.

%K nonn

%O 0,3

%A _Antti Karttunen_, Aug 18 2014

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 25 13:12 EDT 2024. Contains 371969 sequences. (Running on oeis4.)