OFFSET
1,7
COMMENTS
Base-2 expansion of a(n) encodes the steps where numbers that are either of the form 12k+5 or of the form 12k+7 are encountered when map x -> A252463(x) is iterated down to 1, starting from x=n.
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, and for n > 1, a(n) = 2*a(A252463(n)) + [n == 1 (mod 2)]*[J(3|n) == -1], where J is the Jacobi-symbol, and [ ]'s are Iverson brackets, whose product gives 1 only if n is an odd number for which J(3|n) = -1, and 0 otherwise.
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 28 2017
STATUS
approved