cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A079940 Greedy fractional multiples of 1/e: a(1)=1, Sum_{n>0} frac(a(n)/e) = 1.

This page as a plain text file.
%I A079940 #22 Aug 31 2025 18:23:48
%S A079940 1,3,4,11,87,193,386,579,1457,23225,49171,98342,147513,196684,566827,
%T A079940 13580623,28245729,56491458,84737187,112982916,438351041,466596770,
%U A079940 494842499
%N A079940 Greedy fractional multiples of 1/e: a(1)=1, Sum_{n>0} frac(a(n)/e) = 1.
%C A079940 The n-th greedy fractional multiple of x is the smallest integer m that does not cause Sum_{k=1..n} frac(m*x) to exceed unity; an infinite number of terms appear as the denominators of the convergents to the continued fraction of 1/e.
%C A079940 After a(20), there is only 109305220 - 297122396/e = ~1.06317354345346734...*10^-8 to work with.
%H A079940 K. Girstmair, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL17/Girstmair/girstmair12.html">On the Asymptotic Behavior of Dedekind Sums</a>, J. Int. Seq. 17 (2014) # 14.7.7, example 2.
%e A079940 a(4) = 11 since frac(1x) + frac(3x) + frac(4x) + frac(11x) < 1, while frac(1x) + frac(3x) + frac(4x) + frac(k*x) > 1 for all k>4 and k<11.
%p A079940 Digits := 100: a := []: s := 0: x := 1.0/exp(1.0): for n from 1 to 1000000 do: temp := evalf(s+frac(n*x)): if (temp<1.0) then a := [op(a),n]: print(n): s := s+evalf(frac(n*x)): fi: od: a;
%t A079940 a[1] = 1; a[n_] := a[n] = Block[{k = a[n - 1] + 1, ps = Plus @@ Table[ FractionalPart[ a[i]*E^-1], {i, n - 1}]}, While[ ps + FractionalPart[k*E^-1] > 1, k++ ]; a[n] = k]; Do[ Print[ a[n]], {n, 20}] (* _Robert G. Wilson v_, Nov 03 2004 *)
%Y A079940 Cf. A007676 (numerators of convergents to e), A079934, A079939, A079941.
%K A079940 more,nonn,changed
%O A079940 1,2
%A A079940 _Benoit Cloitre_ and _Paul D. Hanna_, Jan 21 2003
%E A079940 More terms from Mark Hudson (mrmarkhudson(AT)hotmail.com), Jan 30 2003
%E A079940 a(16)-a(20) from _Robert G. Wilson v_, Nov 03 2004
%E A079940 a(21)-a(23) from _Sean A. Irvine_, Aug 30 2025