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.

A381624 For any nonnegative integer n with ternary expansion Sum_{k >= 0} t_k * 3^k, a(n) = Sum_{k >= 0} t_k * (2^(k+1) - 1).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 15, 16, 17, 18, 19, 20, 21, 22, 15, 16, 17, 18, 19, 20, 21, 22, 23, 22, 23, 24, 25, 26, 27, 28, 29, 30, 29, 30, 31, 32, 33, 34, 35, 36, 37, 30, 31, 32, 33, 34, 35, 36, 37, 38, 37, 38, 39, 40, 41
Offset: 0

Views

Author

Rémy Sigrist, Mar 02 2025

Keywords

Comments

Every nonnegative integer appears in the sequence, a finite number of times.

Examples

			a(42) = a(3^3 + 3^2 + 2*3) = (2^(3+1) - 1) + (2^(2+1) - 1) + 2*(2^(1+1) - 1) = 28.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v = 0, k); while (n, n -= 3^k = valuation(n, 3); v += 2^(k+1) - 1;); return (v); }

Formula

a(A354047(n)) = n.