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.

A257510 Number of nonleading zeros in factorial base representation of n (A007623).

This page as a plain text file.
%I A257510 #18 Apr 30 2015 21:46:26
%S A257510 0,1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,3,2,2,1,2,1,2,1,1,0,1,
%T A257510 0,2,1,1,0,1,0,2,1,1,0,1,0,3,2,2,1,2,1,2,1,1,0,1,0,2,1,1,0,1,0,2,1,1,
%U A257510 0,1,0,3,2,2,1,2,1,2,1,1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,3,2,2,1,2,1,2,1,1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,4
%N A257510 Number of nonleading zeros in factorial base representation of n (A007623).
%C A257510 Sequence starts from n=1, because 0 is an ambiguous case.
%H A257510 Antti Karttunen, <a href="/A257510/b257510.txt">Table of n, a(n) for n = 1..10080</a>
%F A257510 a(n) = A084558(n) - A060130(n).
%F A257510 Other identities and observations:
%F A257510 For all n >= 0, a(A000142(n+1)) = n. [(n+1)! gives the position where n first appears.]
%F A257510 For all n, a(n) >= A230403(n).
%t A257510 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, 120}]; Last@ DigitCount[#] & /@ s (* _Michael De Vlieger_, Apr 27 2015, after _Alonso del Arte_ at A007623 *)
%o A257510 (Scheme) (define (A257510 n) (let loop ((n n) (i 2) (s 0)) (cond ((zero? n) s) (else (loop (floor->exact (/ n i)) (+ 1 i) (+ s (if (zero? (modulo n i)) 1 0)))))))
%Y A257510 Cf. A227157 (numbers n such that a(n) = 0), A227187 (n for which a(n) > 0).
%Y A257510 Cf. A007623, A060130, A084558, A230403.
%Y A257510 Cf. also A257511.
%Y A257510 Cf. also A023416, A080791 (analogous sequences for base-2), A055641 (for base-10).
%K A257510 nonn,base
%O A257510 1,6
%A A257510 _Antti Karttunen_, Apr 27 2015