A316707 For any n >= 0 with base-5 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).
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
Offset: 0
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10000
Programs
-
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)^2 + imag(z)^2
Comments