login
First row of spectral array W(gamma+1).
2

%I #10 Nov 16 2014 12:43:23

%S 1,2,3,5,7,13,20,35,55,95,149,259,408,707,1115,1931,3045,5276,8321,

%T 14416,22737,39391,62128,107634,169762,294105,463867,803628,1267494,

%U 2195877,3463371,6000134,9463505,16395094

%N First row of spectral array W(gamma+1).

%C Gamma is Euler's (or Euler-Mascheroni) constant.

%H A. Fraenkel and C. Kimberling, <a href="http://dx.doi.org/10.1016/0012-365X(94)90259-3">Generalized Wythoff arrays, shuffles and interspersions</a>, Discrete Mathematics 126 (1994) 137-149.

%o (PARI)

%o \\ Row i of the generalized Wythoff array W(h),

%o \\ where h is an irrational number between 1 and 2,

%o \\ and m is the number of terms in the vectors a and b.

%o row(h, i, m) = {

%o if(h<=1 || h>=2, print("Invalid value for h"); return);

%o my(

%o a=vector(m, n, floor(n*h)),

%o b=vector(m, n, floor(n*h/(h-1))),

%o w=[a[a[i]], b[a[i]]],

%o j=3

%o );

%o while(1,

%o if(j%2==1,

%o if(w[j-1]<=#a, w=concat(w, a[w[j-1]]), return(w))

%o ,

%o if(w[j-2]<=#b, w=concat(w, b[w[j-2]]), return(w))

%o );

%o j++

%o )

%o }

%o allocatemem(10^9)

%o row(Euler+1, 1, 10^7)

%Y Cf. A001620 (Gamma), A059555 (Corresponding Beatty sequence), A250254, A250255.

%K nonn,more

%O 1,2

%A _Colin Barker_, Nov 15 2014