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 A318706 #8 Sep 02 2018 13:35:49 %S A318706 0,0,1,1,1,0,-1,-1,-1,0,0,1,1,1,0,-1,-1,-1,3,3,4,4,4,3,2,2,2,3,3,4,4, %T A318706 4,3,2,2,2,3,3,4,4,4,3,2,2,2,0,0,1,1,1,0,-1,-1,-1,-3,-3,-2,-2,-2,-3, %U A318706 -4,-4,-4,-3,-3,-2,-2,-2,-3,-4,-4,-4,-3,-3,-2,-2 %N A318706 For any n >= 0 with base-9 representation Sum_{k=0..w} d_k * 9^k, let g(n) = Sum_{k=0..w} s(d_k) * 3^k (where s(0) = 0, s(1+2*j) = i^j and s(2+2*j) = i^j * (1+i) for any j > 0, and i denotes the imaginary unit); a(n) is the imaginary part of g(n). %C A318706 See A318705 for the real part of g and additional comments. %H A318706 Rémy Sigrist, <a href="/A318706/b318706.txt">Table of n, a(n) for n = 0..6560</a> %F A318706 a(9 * k) = 3 * a(k) for any k >= 0. %o A318706 (PARI) a(n) = my (d=Vecrev(digits(n, 9))); imag(sum(k=1, #d, if (d[k], 3^(k-1)*I^floor((d[k]-1)/2)*(1+I)^((d[k]-1)%2), 0))) %Y A318706 Cf. A318705. %K A318706 sign,base %O A318706 0,19 %A A318706 _Rémy Sigrist_, Sep 01 2018