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.
%I A356964 #16 Sep 11 2022 06:13:26 %S A356964 0,1,2,3,4,5,6,7,7,8,9,10,11,12,13,14,13,14,15,16,17,18,19,20,20,21, %T A356964 22,23,24,25,26,27,24,25,26,27,28,29,30,31,31,32,33,34,35,36,37,38,37, %U A356964 38,39,40,41,42,43,44,44,45,46,47,48,49,50,51,44,45,46,47 %N A356964 Replace 2^k in binary expansion of n with tribonacci(k+3) (where tribonacci corresponds to A000073). %C A356964 This sequence is to tribonacci numbers (A000073) what A022290 is to Fibonacci numbers (A000045). %C A356964 For any k >= 0, k appears A117546(k) times in this sequence. %H A356964 Rémy Sigrist, <a href="/A356964/b356964.txt">Table of n, a(n) for n = 0..8192</a> %H A356964 <a href="/index/Z#Zeckendorf">Index entries for sequences related to Zeckendorf expansion of n</a> %F A356964 a(A003726(n+1)) = n. %F A356964 a(A003796(n+1)) = n. %e A356964 For n = 9: %e A356964 - 9 = 2^3 + 2^0, %e A356964 - so a(9) = A000073(3+3) + A000073(0+3) = 7 + 1 = 8. %o A356964 (PARI) a(n) = { my (v=0, k); while (n, n-=2^k=valuation(n,2); v+=([0,1,0; 0,0,1; 1,1,1]^(3+k))[2,1]); return (v); } %o A356964 (Python) %o A356964 def A356964(n): %o A356964 a, b, c, s = 1,2,4,0 %o A356964 for i in bin(n)[-1:1:-1]: %o A356964 s += int(i)*a %o A356964 a, b, c = b, c, a+b+c %o A356964 return s # _Chai Wah Wu_, Sep 10 2022 %Y A356964 Cf. A000073, A003726, A003796, A022290, A117546. %K A356964 nonn,base %O A356964 0,3 %A A356964 _Rémy Sigrist_, Sep 06 2022