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).

This page as a plain text file.
%I A381624 #7 Mar 03 2025 09:33:27
%S A381624 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,
%T A381624 15,16,17,18,19,20,21,22,23,22,23,24,25,26,27,28,29,30,29,30,31,32,33,
%U A381624 34,35,36,37,30,31,32,33,34,35,36,37,38,37,38,39,40,41
%N 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).
%C A381624 Every nonnegative integer appears in the sequence, a finite number of times.
%H A381624 Rémy Sigrist, <a href="/A381624/b381624.txt">Table of n, a(n) for n = 0..6560</a>
%F A381624 a(A354047(n)) = n.
%e A381624 a(42) = a(3^3 + 3^2 + 2*3) = (2^(3+1) - 1) + (2^(2+1) - 1) + 2*(2^(1+1) - 1) = 28.
%o A381624 (PARI) a(n) = { my (v = 0, k); while (n, n -= 3^k = valuation(n, 3); v += 2^(k+1) - 1;); return (v); }
%Y A381624 Cf. A354047, A381625.
%K A381624 nonn,base,easy
%O A381624 0,3
%A A381624 _Rémy Sigrist_, Mar 02 2025