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 A098971 #10 Oct 10 2024 17:53:24 %S A098971 1,3,5,5,11,11,11,11,21,21,21,21,21,21,21,21,43,43,43,43,43,43,43,43, %T A098971 43,43,43,43,43,43,43,43,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85, %U A098971 85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,171,171,171,171,171 %N A098971 a(0)=1; for n > 0, a(n)=a(floor(n/2))+2*a(floor(n/4)). %F A098971 n>0, a(n) = (1/3)*(8*2^(floor(log(n)/log(2)))+(-1)^(floor(log(n)/log(2)))). %o A098971 (PARI) a(n)=if(n<1,1,(1/3)*(8*2^(floor(log(n)/log(2)))+(-1)^(floor(log(n)/log(2))))) %o A098971 (Python) %o A098971 def A098971(n): return ((1<<(m:=n.bit_length()+2))+(1 if m&1 else -1))//3 # _Chai Wah Wu_, Oct 10 2024 %Y A098971 a(2^n) gives the Jacobsthal sequence A001045(n+3). %Y A098971 Cf. A001045, A007731. %K A098971 nonn %O A098971 0,2 %A A098971 _Benoit Cloitre_, Oct 23 2004