cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A246159 Inverse function to the injection A048724.

This page as a plain text file.
%I A246159 #23 Apr 28 2021 09:59:34
%S A246159 0,0,0,1,0,3,2,0,0,7,6,0,4,0,0,5,0,15,14,0,12,0,0,13,8,0,0,9,0,11,10,
%T A246159 0,0,31,30,0,28,0,0,29,24,0,0,25,0,27,26,0,16,0,0,17,0,19,18,0,0,23,
%U A246159 22,0,20,0,0,21,0,63,62,0,60,0,0,61,56,0,0,57,0,59,58,0,48,0,0,49,0,51,50,0,0,55,54,0,52,0,0,53,32
%N A246159 Inverse function to the injection A048724.
%C A246159 After a(0)=0, sequence has nonzero values a(n) = k at those positions n for which A048724(k) = n and zeros at those positions n which are not present in A048724.
%C A246159 Equally, sequence is obtained when the positive terms of A065620 are replaced with zeros and the sign of the negative terms is reversed.
%H A246159 Antti Karttunen, <a href="/A246159/b246159.txt">Table of n, a(n) for n = 0..8191</a>
%F A246159 a(n) = (1/2) * A010059(n) * A006068(n).
%F A246159 a(n) = -1 * A010059(n) * A065620(n).
%F A246159 a(n) = A246160(n) - A065620(n).
%F A246159 a(n) = A010059(n) * A006068(A245710(n)).
%F A246159 For all n, a(A048724(n)) = n.
%o A246159 (Scheme, three different implementations)
%o A246159 (define (A246159 n) (* -1 (A010059 n) (A065620 n)))
%o A246159 (define (A246159 n) (* (/ 1 2) (A010059 n) (A006068 n)))
%o A246159 (define (A246159 n) (* (A010059 n) (A006068 (A245710 n))))
%o A246159 (PARI) a065620(n) = if(n<3, n, if(n%2, -2*a065620((n - 1)/2) + 1, 2*a065620(n/2)));
%o A246159 a(n) = -!(hammingweight(n)%2)*a065620(n);
%o A246159 for(n=0, 100, print1(a(n),", ")) \\ _Indranil Ghosh_, Jun 07 2017
%o A246159 (Python)
%o A246159 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 A246159 def a(n): return -(bin(n)[2:].count("1")%2==0)*a065620(n)
%o A246159 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 07 2017
%Y A246159 Cf. A246160, A006068, A010059, A048724, A065620, A245710.
%K A246159 nonn
%O A246159 0,6
%A A246159 _Antti Karttunen_, Aug 18 2014