login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A241773 A sequence constructed so that the probability of occurrence of integer i > 0 is given by p(i) = log_2[(i+1)^2/(i^2+2*i)], which is the Gauss-Kuzmin distribution. 1

%I #27 May 22 2014 11:39:06

%S 1,2,3,1,4,1,5,2,1,6,1,7,1,2,3,1,8,1,9,2,1,4,1,10,1,3,2,1,11,1,2,5,1,

%T 12,1,3,1,2,4,1,13,1,2,6,1,14,1,3,1,2,15,1,16,1,2,4,1,3,1,5,7,1,2,1,

%U 17,1,2,3,1,18,1,8,2,1,4,1,6,1,2,3,1,5,1,19

%N A sequence constructed so that the probability of occurrence of integer i > 0 is given by p(i) = log_2[(i+1)^2/(i^2+2*i)], which is the Gauss-Kuzmin distribution.

%C Let the sequence be A = {a(i)}, i = 1, 2, 3,... and define p(i) =

%C log_2[(i+1)^2/(i^2+2*i)]. Additionally, define u(j, k) = k*p(j) - N(j, k), where N(j, k) is the number of occurrences of j in {a(i)}, i = 1,..., k-1. Refer to the first argument of u as the "index" of u. Then A is defined by a(1) = 1 and, for i > 1, a(i) = m, where m is the index of the maximal element of the set {u(j, i)}, j = 1, 2, 3,... That there is a single maximal element for all i is guaranteed by the fact that p(i) - p(j) is irrational for all i not equal to j.

%C Interpreting sequence A as the partial coefficients of the continued fraction expansion of a real number C, say, then C = 1.44224780173510148... which is, by construction, normal (in the continued fraction sense).

%H Jonathan Deane, <a href="/A241773/b241773.txt">Table of n, a(n) for n = 1..10000</a>

%H Jonathan Deane, <a href="/A241773/a241773.pdf">An integer sequence whose members obey a given p.d.f.</a>

%p pdf := i -> -log[2](1 - 1/(i+1)^2);

%p gen_seq := proc(n)

%p local i, j, N, A, u, mm, ndig;

%p ndig := 40; N := 'N';

%p for i from 1 to n do N[i] := 0; end do;

%p A := 'A'; A[1] := 1; N[1] := 1;

%p for i from 2 to n do

%p u := 'u';

%p for j from 1 to n do

%p u[j] := i*pdf(j) - N[j];

%p end do;

%p mm := max_maxind(evalf(convert(u, list), ndig));

%p if mm[3] then

%p A[i] := mm[1];

%p N[mm[1]] := N[mm[1]] + 1;

%p else

%p return();

%p end if;

%p end do;

%p return(convert(A, list));

%p end:

%p max_maxind := proc(inl)

%p local uniq, mxind, mx, i;

%p uniq := `true`;

%p if nops(inl) = 1 then return([1, inl[1], uniq]); end if;

%p mxind := 1; mx := inl[1];

%p for i from 2 to nops(inl) do

%p if inl[i] > mx then

%p mxind := i;

%p mx := inl[i];

%p uniq := `true`;

%p elif inl[i] = mx then

%p uniq := `false`;

%p end if;

%p end do;

%p return([mxind, mx, uniq]);

%p end:

%p gen_seq(100);

%K cofr,easy,nonn

%O 1,2

%A _Jonathan Deane_, Apr 28 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 19:05 EDT 2024. Contains 371751 sequences. (Running on oeis4.)