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.

A330166 Length of the longest run of 0's in the ternary expression of n.

This page as a plain text file.
%I A330166 #20 Jan 24 2020 14:09:55
%S A330166 1,0,0,1,0,0,1,0,0,2,1,1,1,0,0,1,0,0,2,1,1,1,0,0,1,0,0,3,2,2,1,1,1,1,
%T A330166 1,1,2,1,1,1,0,0,1,0,0,2,1,1,1,0,0,1,0,0,3,2,2,1,1,1,1,1,1,2,1,1,1,0,
%U A330166 0,1,0,0,2,1,1,1,0,0,1,0,0,4,3,3,2,2,2,2,2,2,2
%N A330166 Length of the longest run of 0's in the ternary expression of n.
%C A330166 All numbers appear in this sequence. The n-th power of 3 (A000244(n)) has n 0's in its ternary expression.
%C A330166 The longest run of zeros possible in this sequence is 2, as the last digit of the ternary expression of the integers cycles between 0, 1, and 2, meaning that at least one of three consecutive numbers has a 0 in its ternary expression.
%H A330166 Wikipedia, <a href="https://en.wikipedia.org/wiki/Ternary_numeral_system">Ternary numeral system</a>.
%F A330166 a(A000244(n)) = a(3^n) = n.
%F A330166 a(n) = 0 iff n is in A032924.
%e A330166 For n = 87, the ternary expression of 87 is 10020. The length of the runs of 0's in the ternary expression of 87 are 2 and 1, respectively. The larger of these two values is 2, so a(87) = 2.
%e A330166    n [ternary n] a(n)
%e A330166    0 [        0] 1
%e A330166    1 [        1] 0
%e A330166    2 [        2] 0
%e A330166    3 [      1 0] 1
%e A330166    4 [      1 1] 0
%e A330166    5 [      1 2] 0
%e A330166    6 [      2 0] 1
%e A330166    7 [      2 1] 0
%e A330166    8 [      2 2] 0
%e A330166    9 [    1 0 0] 2
%e A330166   10 [    1 0 1] 1
%e A330166   11 [    1 0 2] 1
%e A330166   12 [    1 1 0] 1
%e A330166   13 [    1 1 1] 0
%e A330166   14 [    1 1 2] 0
%e A330166   15 [    1 2 0] 1
%e A330166   16 [    1 2 1] 0
%e A330166   17 [    1 2 2] 0
%e A330166   18 [    2 0 0] 2
%e A330166   19 [    2 0 1] 1
%e A330166   20 [    2 0 2] 1
%t A330166 Table[Max@FoldList[If[#2==0,#1+1,0]&,0,IntegerDigits[n,3]],{n,0,90}]
%Y A330166 Cf. A000244, A007089, A077267, A087117, A330036, A330167, A330168.
%Y A330166 Equals zero iff n is in A032924.
%K A330166 nonn,base
%O A330166 0,10
%A A330166 _Joshua Oliver_, Dec 04 2019