A275806 a(n) = number of distinct nonzero digits in factorial base representation of n.
0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 3, 3, 3, 2, 3, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 2, 3, 1, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 3, 4, 1
Offset: 0
Examples
For n=0, with factorial base representation (A007623) also 0, there are no nonzero digits, thus a(0) = 0. For n=2, with factorial base representation "10", there is one distinct nonzero digit, thus a(2) = 1. For n=3, with factorial base representation "11", there is just one distinct nonzero digit, thus a(3) = 1. For n=44, with factorial base representation "1310", there are two distinct nonzero digits ("1" and "3"), thus a(44) = 2.
Links
Crossrefs
Programs
-
Mathematica
a[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; Length[Union[Select[s, # > 0 &]]]]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)
-
Python
from sympy import prime, primefactors from operator import mul import collections def a007623(n, p=2): return n if n
-
Scheme
(define (A275806 n) (A001221 (A275735 n)))