login
A380122
a(n) is the number of integers m (possibly negative) such that the nonzero digits in the nonadjacent form for m appear in the nonadjacent form for n.
2
1, 2, 2, 4, 2, 4, 4, 4, 2, 4, 4, 8, 4, 8, 4, 4, 2, 4, 4, 8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 4, 4, 2, 4, 4, 8, 4, 8, 8, 8, 4, 8, 8, 16, 8, 16, 8, 8, 4, 8, 8, 16, 8, 16, 8, 8, 4, 8, 8, 8, 4, 8, 4, 4, 2, 4, 4, 8, 4, 8, 8, 8, 4, 8, 8, 16, 8, 16, 8, 8, 4, 8, 8, 16, 8
OFFSET
0,2
LINKS
Joerg Arndt, Matters Computational (The Fxtbook), pages 61-62.
FORMULA
a(n) = 2^A000120(A184617(n)) = A001316(A184617(n)).
EXAMPLE
The nonadjacent form for 25 is "10T001" and has 3 nonzero digits, so a(25) = 2^3 = 8.
PROG
(PARI) a(n) = { my (v = 1); while (n, if (n%2, n -= 2 - (n%4); v *= 2; ); n \= 2; ); return (v); }
CROSSREFS
Cf. A000120, A001316, A184617, A380123 (corresponding m's).
Sequence in context: A082991 A214212 A100008 * A102763 A054844 A057936
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 12 2025
STATUS
approved