cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 12 2025

Keywords

Examples

			The nonadjacent form for 25 is "10T001" and has 3 nonzero digits, so a(25) = 2^3 = 8.
		

Crossrefs

Cf. A000120, A001316, A184617, A380123 (corresponding m's).

Programs

  • PARI
    a(n) = { my (v = 1); while (n, if (n%2, n -= 2 - (n%4); v *= 2; ); n \= 2; ); return (v); }

Formula

a(n) = 2^A000120(A184617(n)) = A001316(A184617(n)).