cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A275806 a(n) = number of distinct nonzero digits in factorial base representation of n.

This page as a plain text file.
%I A275806 #27 Feb 07 2024 01:17:46
%S A275806 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,
%T A275806 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,
%U A275806 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
%N A275806 a(n) = number of distinct nonzero digits in factorial base representation of n.
%H A275806 Antti Karttunen, <a href="/A275806/b275806.txt">Table of n, a(n) for n = 0..40320</a>
%H A275806 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>.
%F A275806 a(n) = A001221(A275735(n)).
%F A275806 a(n) = A060502(A225901(n)).
%F A275806 Other identities. For all n >= 0:
%F A275806 a(n) = a(A153880(n)) = a(A255411(n)). [The shift-operations do not change the number of distinct nonzero digits.]
%F A275806 a(A265349(n)) = A060130(A265349(n)).
%F A275806 a(A000142(n)) = 1.
%F A275806 a(A033312(n)) = n-1, for all n >= 1.
%e A275806 For n=0, with factorial base representation (A007623) also 0, there are no nonzero digits, thus a(0) = 0.
%e A275806 For n=2, with factorial base representation "10", there is one distinct nonzero digit, thus a(2) = 1.
%e A275806 For n=3, with factorial base representation "11", there is just one distinct nonzero digit, thus a(3) = 1.
%e A275806 For n=44, with factorial base representation "1310", there are two distinct nonzero digits ("1" and "3"), thus a(44) = 2.
%t A275806 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 *)
%o A275806 (Scheme) (define (A275806 n) (A001221 (A275735 n)))
%o A275806 (Python)
%o A275806 from sympy import prime, primefactors
%o A275806 from operator import mul
%o A275806 import collections
%o A275806 def a007623(n, p=2): return n if n<p else a007623(n//p, p+1)*10 + n%p
%o A275806 def a275735(n):
%o A275806     y=collections.Counter(map(int, list(str(a007623(n)).replace("0", "")))).most_common()
%o A275806     return 1 if n==0 else reduce(mul, [prime(y[i][0])**y[i][1] for i in range(len(y))])
%o A275806 def a(n): return len(primefactors(a275735(n)))
%o A275806 print([a(n) for n in range(201)]) # _Indranil Ghosh_, Jun 20 2017
%Y A275806 Cf. A000142, A001221, A007623, A033312, A060130, A060502, A225901, A265349, A275735.
%Y A275806 Cf. also A153880, A255411.
%K A275806 nonn,base
%O A275806 0,6
%A A275806 _Antti Karttunen_, Aug 11 2016