A081608 Number of numbers <= n having no 0 in their ternary representation.
0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 6, 6, 6, 7, 8, 8, 9, 10, 10, 10, 10, 10, 11, 12, 12, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 16, 16, 17, 18, 18, 18, 18, 18, 19, 20, 20, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 24, 24, 25, 26, 26, 26, 26
Offset: 0
Keywords
Links
- Winston de Greef, Table of n, a(n) for n = 0..16383
Programs
-
Mathematica
Accumulate[Table[If[DigitCount[n,3,0]==0,1,0],{n,0,80}]] (* Harvey P. Dale, Oct 21 2024 *)
-
PARI
first(n)=my(s,t); vector(n,k, t=Set(digits(k,3)); s+=!!t[1]) \\ Charles R Greathouse IV, Sep 02 2015
Comments