A338857 With S(n,k) = Sum_{n<=j<=k} 1/(2*j+1), a(n)=k+1 such that S(n,k-1) < 1 <= S(n,k) for n>=0 and a(0)=1.
1, 8, 15, 23, 30, 38, 45, 52, 60, 67, 74, 82, 89, 97, 104, 111, 119, 126, 134, 141, 148, 156, 163, 170, 178, 185, 193, 200, 207, 215, 222, 230, 237, 244, 252, 259, 267, 274, 281, 289, 296, 303, 311, 318, 326, 333, 340, 348, 355, 363, 370, 377, 385, 392, 400, 407, 414
Offset: 0
Keywords
Examples
n=0: S(0,k-1)=1 for k=1. Thus a(0) = 1+0 = 1. n=1: S(1,6)=1/3+1/5+...+1/11+1/13=0.995<1, S(1,7)=S(1,6)+1/15=1.022>1. Thus a(1) = 7+1 = 8. n=2: S(2,13)=1/5+1/7+...+1/25+1/27=0.968<1, S(2,14)=S(2,13)+1/29=1.003>1. Thus a(2) = 14+1 = 15.
Links
- Gerhard Kirchner, Transport problem
Programs
-
Mathematica
Block[{S}, S[n_, k_] := Sum[1/(2 j + 1), {j, n, k}]; {1}~Join~Array[Block[{k = 1}, While[Nand[S[#, k - 1] < 1 <= S[#, k]], k++]; k + 1] &, 56]] (* Michael De Vlieger, Nov 12 2020 *)
-
Maxima
block(su: 0, k: 0, n: 1, nmax: 80, /*program returns the first nmax terms*/ v: makelist(0, i, 0, nmax), v[1]: 1, while n<=nmax do (k: k+1, su: su+1/(2*k+1), if su>1 then (v[n+1]: k+1, su: su-1/(2*n+1), n: n+1)), return(v));
Formula
Conjecture: a(n) = ceiling(n*exp(2)+(exp(2)+exp(-2))/(24*n)), verified for n<=3000.
Comments