login
a(n) = A099563(A001813(n)); the most significant digit in factorial base representation of (2n)! / n!.
7

%I #15 Dec 25 2015 21:04:03

%S 1,1,2,1,2,6,1,4,1,2,7,1,3,10,1,3,11,1,3,10,1,3,8,25,2,6,19,1,4,13,38,

%T 2,7,23,1,4,13,39,2,6,20,1,3,9,29,1,4,13,40,1,5,16,51,2,6,20,62,2,7,

%U 23,70,2,8,25,77,2,8,25,79,2,8,25,78,2,7,23,73,2,6,21,66,1,6,18,57,1,4,15,47,1,3,12,38,118,3,9

%N a(n) = A099563(A001813(n)); the most significant digit in factorial base representation of (2n)! / n!.

%H Antti Karttunen, <a href="/A265894/b265894.txt">Table of n, a(n) for n = 0..10080</a>

%H <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>

%F a(n) = A099563(A001813(n)).

%F a(n) = A265890(n+1, n).

%e The terms A001813(0) .. A001813(8) in factorial base representation (A007623) look as:

%e 1, 10, 200, 10000, 220000, 6000000, 174000000, 4760000000, 110000000000, ...

%e Taking the first digit (actually: a place holder value) of each gives the terms a(0) .. a(8) of this sequence: 1, 1, 2, 1, 2, 6, 1, 4, 1, ...

%t 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]; (* taken from A007623, Alonso del Arte, May 03 2006 *) f[n_] := factBaseIntDs[(2 n)!/n!][[1]]; Array[f, 96, 0] (* _Robert G. Wilson v_, Dec 25 2015 *)

%o (PARI)

%o allocatemem((2^31)); \\ Enough?

%o A099563(n) = { my(i=2,dig=0); until(0==n, dig = n % i; n = (n - dig)/i; i++); return(dig); };

%o A265894 = n -> A099563((2*n)! / n!);

%o for(n=0, 10080, write("b265894.txt", n, " ", A265894(n)));

%o (Scheme, two variants)

%o (define (A265894 n) (A099563 (A001813 n)))

%o (define (A265894 n) (A265890bi (+ 1 n) n)) ;; Code for A265890bi given in A265890.

%Y Submain diagonal of A265890.

%Y Cf. A001813, A099563.

%Y Cf. A265898 (positions of ones), A265899 (of descents), A266120 (local maxima just before those descents).

%Y Cf. also A265891.

%K nonn,base,look

%O 0,3

%A _Antti Karttunen_, Dec 24 2015