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.

A354047 A169683 read as ternary numbers.

This page as a plain text file.
%I A354047 #16 May 29 2022 08:13:20
%S A354047 0,1,2,3,4,5,6,9,10,11,12,13,14,15,18,27,28,29,30,31,32,33,36,37,38,
%T A354047 39,40,41,42,45,54,81,82,83,84,85,86,87,90,91,92,93,94,95,96,99,108,
%U A354047 109,110,111,112,113,114,117,118,119,120,121,122,123,126,135,162
%N A354047 A169683 read as ternary numbers.
%C A354047 a(0) = 0; if a(n) is of the form (3*m+2) * 3^r, then a(n+1) = (3*m+3) * 3^r, otherwise a(n+1) = a(n) + 1.
%C A354047 Viewed as a list, numbers whose ternary expansion contains only 0 and 1, except that the least significant nonzero digit can be 2.
%H A354047 Jianing Song, <a href="/A354047/b354047.txt">Table of n, a(n) for n = 0..16382</a>
%F A354047 a(0) = 0; for n >= 1, a(2^n-1+i) = a(i) + 3^(n-1) for 0 <= i <= 2^n-1.
%e A354047 a(2^1-1..2^2-2) = a(0..2^1-1) + 3^0 = [1, 2];
%e A354047 a(2^2-1..2^3-2) = a(0..2^2-1) + 3^1 = [3, 4, 5, 6];
%e A354047 a(2^3-1..2^4-2) = a(0..2^3-1) + 3^2 = [9, 10, 11, 12, 13, 14, 15, 18];
%e A354047 a(2^4-1..2^5-2) = a(0..2^4-1) + 3^3 = [27, 28, 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 41, 42, 45, 54];
%e A354047 ...
%o A354047 (PARI) A354047(lim) = my(v=vector(1<<lim-1)); v[1] = 0; for(n=1, lim-1, for(i=0, 1<<n-1, v[1<<n+i] = v[i+1]+3^(n-1))); v \\ gives a(0..2^lim-2)
%o A354047 (Python)
%o A354047 a, N = [0], 6   # generates terms 0..2**N-2
%o A354047 [[a.append(a[i] + 3**(n-1)) for i in range(2**n)] for n in range(1, N)]
%o A354047 print(a) # _Michael S. Branicky_, May 29 2022
%Y A354047 Cf. A169683.
%K A354047 nonn,base
%O A354047 0,3
%A A354047 _Jianing Song_, May 16 2022