%I #54 Sep 08 2022 08:44:46
%S 0,2,5,8,10,13,16,19,21,24,27,29,32,35,38,40,43,46,48,51,54,57,59,62,
%T 65,67,70,73,76,78,81,84,86,89,92,95,97,100,103,106,108,111,114,116,
%U 119,122,125,127,130,133,135,138,141,144,146,149,152,154,157,160
%N Beatty sequence for e: a(n) = floor(n*e).
%C a(n) <= A022852(n) <= A121384(n). - _Reinhard Zumkeller_, Mar 17 2015
%H Reinhard Zumkeller, <a href="/A022843/b022843.txt">Table of n, a(n) for n = 0..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/BeattySequence.html">Beatty Sequence.</a>
%H <a href="/index/Be#Beatty">Index entries for sequences related to Beatty sequences</a>
%F a(n)/n converges to e because |a(n)/n-e|=|a(n)-n*e|/n < 1/n. - _Hieronymus Fischer_, Jan 22 2006
%p A022843 := proc(n)
%p floor(n*exp(1)) ;
%p end proc: # _R. J. Mathar_, Jan 25 2015
%t Table[ Floor[n*E], {n, 1, 61}]
%o (Haskell)
%o a022843 n = a022843_list !! n
%o a022843_list = map (floor . (* e) . fromIntegral) [0..] where e = exp 1
%o -- _Reinhard Zumkeller_, Jul 06 2013
%o (PARI) for (n=0, 100, print1(floor(n*exp(1)),", ")) \\ _Indranil Ghosh_, Mar 21 2017
%o (Python)
%o import math
%o from mpmath import mp, e
%o mp.dps = 100
%o print([int(math.floor(n*e)) for n in range(51)]) # _Indranil Ghosh_, Mar 21 2017
%o (Magma) [Floor(n*Exp(1)): n in [0..60]]; // _G. C. Greubel_, Sep 28 2018
%Y Cf. A054385, A108599.
%Y Cf. A001113 (e), A022852, A121384.
%K nonn
%O 0,2
%A _Clark Kimberling_