login
A381608
Nonnegative integers whose ternary expansion does not contain pairs of 2's only separated by (zero or more) 1's, with offset 0.
2
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,3
COMMENTS
The ternary expansion of a(n) equals the decimal expansion of A381579(n).
LINKS
FORMULA
a(n) = A028898(A381579(n)).
A381607(a(n)) = n.
EXAMPLE
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.
PROG
(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); ); ); }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 01 2025
STATUS
approved