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.

A381608 Nonnegative integers whose ternary expansion does not contain pairs of 2's only separated by (zero or more) 1's, with offset 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 54, 55, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93
Offset: 0

Views

Author

Rémy Sigrist, Mar 01 2025

Keywords

Comments

The ternary expansion of a(n) equals the decimal expansion of A381579(n).

Examples

			The ternary expansion of 20, "211", has no pairs of 2's, so 20 belongs to the sequence.The ternary expansion of 21, "212", has a pair of 2s only separated by 1's, so 21 does not belong to the sequence.
		

Crossrefs

Programs

  • PARI
    a(n) = { for (k = 1, oo, my (f = fibonacci(2*k)); if (f >= n, my (v = 0); while (n, while (n >= f, n -= f; v += 3^(k-1);); f = fibonacci(2*k--);); return (v););); }

Formula

a(n) = A028898(A381579(n)).
A381607(a(n)) = n.