OFFSET
0,6
COMMENTS
A000695 is a 'pseudo-square function' that takes the binary expansion of n and moves bit k to bit 2k (that is, towards the most significant bits).
a(n) = 0 if and only if n is 0 or a power of 2.
LINKS
R. J. Mathar, Table of n, a(n) for n = 0..1023
EXAMPLE
For example 7 = 111, and PSF(7) = 10101 = 21, so a(7) = (49 - 21)/4 = 7.
13 = 1101 -> 1010001 = 81, so a(13) = (169 - 81)/4 = 22.
PROG
(PARI) a(n)=my(v=binary(n)); (n^2-sum(i=1, #v, v[i]*4^(#v-i)))/4 \\ Charles R Greathouse IV, Mar 04 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Mar 03 2013
STATUS
approved