login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = A328749(A362089(n)).
2

%I #16 Apr 15 2023 08:24:23

%S 0,-1,1,-2,-5,-3,2,3,5,-4,-9,-7,-10,-21,-19,-6,-13,-11,4,7,9,6,11,13,

%T 10,19,21,-8,-17,-15,-18,-37,-35,-14,-29,-27,-20,-41,-39,-42,-85,-83,

%U -38,-77,-75,-12,-25,-23,-26,-53,-51,-22,-45,-43,8,15,17,14,27,29

%N a(n) = A328749(A362089(n)).

%C Every integer appears once in the sequence.

%H Rémy Sigrist, <a href="/A362090/b362090.txt">Table of n, a(n) for n = 0..6561</a>

%e For n = 5, the base-3 expansion of 5 is "12", so the base-3 expansion of A362089(5) is "102", and a(5) = -2^2 + 2^0 = -3.

%o (PARI) a(n) = { if (n==0, 0, n%3, 4*a(n\3) + (-1)^(n%3), 2*a(n/3)); }

%o (Python)

%o from gmpy2 import digits

%o def A362090(n): return sum((-(1<<i) if int(j)&1 else 1<<i) for i, j in enumerate(digits(n,3).replace('1','01').replace('2','02')[::-1]) if j!='0') # _Chai Wah Wu_, Apr 12 2023

%Y Cf. A328728, A328749, A362089.

%K sign,base

%O 0,4

%A _Rémy Sigrist_, Apr 08 2023