A275948 Number of nonzero digits that occur only once in factorial base representation of n: a(n) = A056169(A275735(n)).
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, 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, 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
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 nonzero digit, thus a(2) = 1. For n=3 (= "11") there is no nonzero digit which would occur just once, thus a(3) = 0. For n=23 (= "321") there are three nonzero digits and each of those digits occurs just once, thus a(23) = 3. 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.
Links
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++]; Count[Tally[Select[s, # > 0 &]][[;;,2]], 1]]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)
-
Python
from sympy import prime, factorint from operator import mul from functools import reduce import collections def a056169(n): f=factorint(n) return 0 if n==1 else sum([1 for i in f if f[i]==1]) def a007623(n, p=2): return n if n
-
Scheme
(define (A275948 n) (A056169 (A275735 n)))
Comments