login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of numbers <= n having no 0 in their ternary representation.
6

%I #13 Oct 21 2024 15:34:33

%S 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,

%T 14,14,14,14,14,14,14,14,14,14,14,14,15,16,16,17,18,18,18,18,18,19,20,

%U 20,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,24,24,25,26,26,26,26

%N Number of numbers <= n having no 0 in their ternary representation.

%C a(n) + A081607(n) = n+1.

%H Winston de Greef, <a href="/A081608/b081608.txt">Table of n, a(n) for n = 0..16383</a>

%t Accumulate[Table[If[DigitCount[n,3,0]==0,1,0],{n,0,80}]] (* _Harvey P. Dale_, Oct 21 2024 *)

%o (PARI) first(n)=my(s,t); vector(n,k, t=Set(digits(k,3)); s+=!!t[1]) \\ _Charles R Greathouse IV_, Sep 02 2015

%Y Cf. A007089, A077267, A061392, A081611.

%K nonn

%O 0,3

%A _Reinhard Zumkeller_, Mar 23 2003