login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Define b(1)=1 and for n>1, b(n)=n/b(n-1); then a(n) = nearest integer to b(n).
3

%I #15 Apr 23 2023 12:18:14

%S 1,2,2,3,2,3,2,4,2,4,3,4,3,5,3,5,3,5,4,6,4,6,4,6,4,6,4,7,4,7,4,7,5,7,

%T 5,8,5,8,5,8,5,8,5,8,5,9,5,9,6,9,6,9,6,9,6,9,6,10,6,10,6,10,6,10,6,10,

%U 7,10,7,11,7,11,7,11,7,11,7,11,7,11,7,11,7,12,7,12,7

%N Define b(1)=1 and for n>1, b(n)=n/b(n-1); then a(n) = nearest integer to b(n).

%C Since b(3) = 3/2, a(3) could also be taken to be 1.

%e The first few fractions b(n) are 1, 2, 3/2, 8/3, 15/8, 16/5, 35/16, 128/35, 315/128, 256/63, 693/256, 1024/231, 3003/1024, 2048/429, ...

%p A338720b := proc(n)

%p option remember ;

%p if n = 1 then

%p 1;

%p else

%p n/procname(n-1) ;

%p end if;

%p end proc:

%p A338720 := proc(n)

%p round(A338720b(n)) ;

%p end proc:

%p seq(A338720(n),n=1..87) ; # _R. J. Mathar_, Dec 01 2020

%t b[n_] := b[n] = If[n == 1, 1, n/b[n-1]];

%t a[n_] := Round[b[n]];

%t Table[a[n], {n, 1, 87}] (* _Jean-François Alcover_, Apr 23 2023 *)

%Y Cf. A338718, A338719.

%Y For the numerators and denominators of b(n) see A004731 and A004730.

%K nonn

%O 1,2

%A _N. J. A. Sloane_, Nov 29 2020, following a suggestion from _Anchar Koops_, Nov 24 2020