OFFSET
0,6
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..15624
Rémy Sigrist, Colored scatterplot of (a(n), A316658(n)) for n=0..5^8-1 (where the hue is function of n)
Wikipedia, Gaussian integer
MATHEMATICA
a[n_] := Module[{d, z}, d = IntegerDigits[n, 5] // Reverse; z = Sum[ If[d[[i]]>0, (2+I)^(i-1)*I^(d[[i]]-1), 0], {i, 1, Length[d]}]; Re[z]];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 06 2021, after PARI code *)
PROG
(PARI) a(n) = my (d=Vecrev(digits(n, 5)), z=sum(i=1, #d, if (d[i], (2+I)^(i-1) * I^(d[i]-1), 0))); real(z)
CROSSREFS
KEYWORD
sign,base
AUTHOR
Rémy Sigrist, Jul 09 2018
STATUS
approved