%I #22 Feb 07 2024 01:17:58
%S 0,1,1,0,1,2,1,0,0,0,2,1,1,2,2,1,0,1,1,2,2,1,2,3,1,0,0,0,2,1,0,0,0,0,
%T 1,1,2,1,1,1,1,0,2,1,1,1,3,2,1,2,2,1,0,1,2,1,1,1,1,0,0,1,1,0,0,1,2,3,
%U 3,2,1,2,1,2,2,1,2,3,2,1,1,1,3,2,2,3,3,2,1,2,0,1,1,0,1,2,1,2,2,1,2,3,2,1,1,1,3,2,2,3,3,2,1,2,2,3,3,2,3,4,1
%N Number of nonzero digits that occur only once in factorial base representation of n: a(n) = A056169(A275735(n)).
%H Antti Karttunen, <a href="/A275948/b275948.txt">Table of n, a(n) for n = 0..40320</a>
%H <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>.
%F a(n) = A056169(A275735(n)).
%F Other identities. For all n >= 0.
%F a(n) = A275946(A225901(n)).
%F A275806(n) = a(n) + A275949(n).
%F A060130(n) = a(n) + A275964(n).
%e For n=0, with factorial base representation (A007623) also 0, there are no nonzero digits, thus a(0) = 0.
%e For n=2, with factorial base representation "10", there is one nonzero digit, thus a(2) = 1.
%e For n=3 (= "11") there is no nonzero digit which would occur just once, thus a(3) = 0.
%e For n=23 (= "321") there are three nonzero digits and each of those digits occurs just once, thus a(23) = 3.
%e For n=44 (= "1310") there are two distinct nonzero digits ("1" and "3"), but only the other (3) occurs just once, thus a(44) = 1.
%t a[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; Count[Tally[Select[s, # > 0 &]][[;;,2]], 1]]; Array[a, 100, 0] (* _Amiram Eldar_, Feb 07 2024 *)
%o (Scheme) (define (A275948 n) (A056169 (A275735 n)))
%o (Python)
%o from sympy import prime, factorint
%o from operator import mul
%o from functools import reduce
%o import collections
%o def a056169(n):
%o f=factorint(n)
%o return 0 if n==1 else sum([1 for i in f if f[i]==1])
%o def a007623(n, p=2): return n if n<p else a007623(n//p, p+1)*10 + n%p
%o def a275735(n):
%o y=collections.Counter(map(int, list(str(a007623(n)).replace("0", "")))).most_common()
%o return 1 if n==0 else reduce(mul, [prime(y[i][0])**y[i][1] for i in range(len(y))])
%o def a(n): return a056169(a275735(n))
%o print([a(n) for n in range(201)]) # _Indranil Ghosh_, Jun 20 2017
%Y Cf. A056169, A275735.
%Y Cf. also A060130, A225901, A275806, A275946, A275949, A275964.
%K nonn,base
%O 0,6
%A _Antti Karttunen_, Aug 15 2016
|