OFFSET
1,3
COMMENTS
Base-2 expansion of a(n) encodes the steps where numbers of the form 6k+1 are encountered when map x -> A252463(x) is iterated down to 1, starting from x=n. An exception is the most significant bit of a(n) which corresponds with the final 1, but is shifted one bit-position towards right (less significant end).
The AND - XOR formulas just restate the fact that J(-3|n) = J(-1|n)*J(3|n), as the Jacobi-symbol is multiplicative (also) with respect to its upper argument.
LINKS
FORMULA
a(1) = 0, a(2) = 1, and for n > 2, a(n) = 2*a(A252463(n)) + [n == 1 (mod 6)], where the last part of the formula is Iverson bracket, giving 1 only if n is of the form 6k+1, and 0 otherwise.
Also, for n > 2, a(n) = 2*a(A252463(n)) + [n == 1 (mod 2)]*[J(-3|n) = 1], where J is the Jacobi-symbol.
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 28 2017
STATUS
approved