

A316707


For any n >= 0 with base5 expansion Sum_{k=0..w} d_k * 5^k, let f(n) = Sum_{k=0..w} [d_k > 0] * (2 + i)^k * i^(d_k  1) (where [] is an Iverson bracket and i denotes the imaginary unit); a(n) equals the square of the modulus of f(n).


2



0, 1, 1, 1, 1, 5, 10, 8, 2, 4, 5, 4, 10, 8, 2, 5, 2, 4, 10, 8, 5, 8, 2, 4, 10, 25, 32, 34, 20, 18, 50, 61, 61, 41, 41, 40, 45, 53, 37, 29, 10, 13, 17, 9, 5, 20, 29, 25, 13, 17, 25, 18, 32, 34, 20, 20, 17, 29, 25, 13, 50, 41, 61, 61, 41, 40, 29, 45, 53, 37, 10
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,6


COMMENTS

See A316657 for the real part of f and additional comments.


LINKS

Rémy Sigrist, Table of n, a(n) for n = 0..10000


FORMULA

a(n) = A316657(n)^2 + A316658(n)^2.
a(5 * n) = 5 * a(n) for any n >= 0.
a(5^k) = 5^k for any k >= 0.


PROG

(PARI) a(n) = my (d=Vecrev(digits(n, 5)), z=sum(i=1, #d, if (d[i], (2+I)^(i1) * I^(d[i]1), 0))); real(z)^2 + imag(z)^2


CROSSREFS

Cf. A316657, A316658.
Sequence in context: A067843 A245942 A280943 * A109360 A141622 A144136
Adjacent sequences: A316704 A316705 A316706 * A316708 A316709 A316710


KEYWORD

nonn,base


AUTHOR

Rémy Sigrist, Jul 11 2018


STATUS

approved



