%I #9 Sep 02 2018 13:36:31
%S 0,1,2,1,2,1,2,1,2,9,16,17,10,5,4,5,10,17,18,25,32,25,20,13,8,13,20,9,
%T 10,17,16,17,10,5,4,5,18,13,20,25,32,25,20,13,8,9,4,5,10,17,16,17,10,
%U 5,18,13,8,13,20,25,32,25,20,9,10,5,4,5,10,17,16,17
%N 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 square of the modulus of g(n).
%C See A318705 for the real part of g and additional comments.
%H Rémy Sigrist, <a href="/A318707/b318707.txt">Table of n, a(n) for n = 0..6560</a>
%F a(n) = A318705(n)^2 + A318706(n)^2.
%F a(9 * k) = 9 * a(k) for any k >= 0.
%o (PARI) a(n) = my (d=Vecrev(digits(n, 9))); norm(sum(k=1, #d, if (d[k], 3^(k-1)*I^floor((d[k]-1)/2)*(1+I)^((d[k]-1)%2), 0)))
%Y Cf. A318705, A318706.
%K nonn,base,look
%O 0,3
%A _Rémy Sigrist_, Sep 01 2018
|