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.

A368618 a(n) is the n-digit numerator of the fraction h/k with h and k coprime palindrome positive integers at which abs(h/k-e) is minimal.

This page as a plain text file.
%I A368618 #36 Jan 12 2024 22:21:28
%S A368618 3,11,878,2552,38983,167761,4407044,24988942,882646288,1385885831,
%T A368618 83034443038,161356653161,9051164611509,24911822811942
%N A368618 a(n) is the n-digit numerator of the fraction h/k with h and k coprime palindrome positive integers at which abs(h/k-e) is minimal.
%C A368618 a(3) = 878 corresponds to the numerator of A368617.
%H A368618 David A. Corneth, <a href="/A368618/a368618.gp.txt">PARI program</a>
%H A368618 <a href="/index/Ea">Index entries for sequences related to the number e</a>
%e A368618   n              fraction    approximated value
%e A368618   -   -------------------    ------------------
%e A368618   1                   3/1    3
%e A368618   2                  11/4    2.75
%e A368618   3               878/323    2.7182662538699...
%e A368618   4              2552/939    2.7177848775292...
%e A368618   5           38983/14341    2.7182902168607...
%e A368618   6          167761/61716    2.7182740294251...
%e A368618   7       4407044/1621261    2.7182816338640...
%e A368618   8      24988942/9192919    2.7182815382143...
%e A368618   9   882646288/324707423    2.7182818299783...
%e A368618   ...
%t A368618 a[1]=3; a[n_]:=Module[{minim = Infinity}, h = Select[Range[10^(n - 1), 10^n - 1], PalindromeQ]; lh = Length[h]; For[i = 1, i <= lh, i++, k = Select[Range[Floor[Part[h, i]/E], Ceiling[Part[h, i]/E]], PalindromeQ]; lk = Length[k]; For[j = 1, j <= lk, j++, If[(dist = Abs[Part[h, i]/Part[k, j] - E]) < minim && GCD[Part[h, i], Part[k, j]] == 1, minim = dist; hmin = Part[h, i]]]]; hmin]; Array[a,9]
%o A368618 (PARI) \\ See PARI program in Links
%Y A368618 Cf. A001113, A002113, A070252, A368617, A368619 (denominator), A368658.
%Y A368618 Cf. A007676, A007677.
%Y A368618 Cf. A364844 (similar for Pi), A368620, A368621.
%K A368618 nonn,base,frac,more
%O A368618 1,1
%A A368618 _Stefano Spezia_, Jan 01 2024
%E A368618 a(10)-a(14) from _David A. Corneth_, Jan 03 2024