A043530 Number of distinct base-3 digits of n.
1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 3, 2, 1, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 2, 2, 3, 3, 3, 3, 2, 2, 3, 2, 1, 2, 3, 2, 2, 3, 3, 3, 3, 2, 2, 3, 2, 2, 2, 3, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 3, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 2, 2, 3, 3, 3, 3, 2
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..19683
Programs
-
Mathematica
Table[Length[Union[IntegerDigits[n,3]]],{n,90}] (* Harvey P. Dale, May 13 2020 *)
-
PARI
a(n) = #vecsort(digits(n,3),,8); \\ Michel Marcus, May 16 2016
Comments