OFFSET
1,1
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..6769
EXAMPLE
The factorial base representation (A007623) of 9 is "111", which contains exactly three 1's, thus 3 is included in the sequence.
The f.b.r. of 27 is "1011", with exactly three 1's, thus 27 is included in the sequence.
The f.b.r. of 81 is "3111", with exactly three 1's, thus 81 is included in the sequence.
MATHEMATICA
factBaseIntDs[n_] := Module[{m, i, len, dList, currDigit}, i = 1; While[n > i!, i++]; m = n; len = i; dList = Table[0, {len}]; Do[currDigit = 0; While[m >= j!, m = m - j!; currDigit++]; dList[[len - j + 1]] = currDigit, {j, i, 1, -1}]; If[dList[[1]] == 0, dList = Drop[dList, 1]]; dList]; s = Table[FromDigits[factBaseIntDs[n]], {n, 480}]; Flatten@ Position[s, x_ /; DigitCount[x][[1]] == 3](* Michael De Vlieger, Apr 27 2015, after Alonso del Arte at A007623 *)
PROG
(Scheme, with Antti Karttunen's IntSeq-library)
(Python)
def fbr(n, p=2): # per Indranil Ghosh in A007623
return n if n<p else fbr(n//p, p+1)*10 + n%p
def ok(n): return str(fbr(n)).count('1') == 3
print(list(filter(ok, range(442)))) # Michael S. Branicky, Sep 27 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Apr 27 2015
STATUS
approved