OFFSET
0,2
COMMENTS
As k increases, 1 - tanh(k) rapidly approaches 2*exp(-2*k), and the smallest integer k such that 2*exp(-2*k) < 10^(-n), i.e., such that k > (n*log(10) + log(2))/2, is simply ceiling((1/2)*(n*log(10) + log(2))). It seems very likely that this expression gives a(n) for all n >= 0. - Jon E. Schoenfield, Jul 08 2021
EXAMPLE
For n = 3, a(3) = 4 because 4 is the smallest positive integer k such that 1 - tanh(k) < 10^(-3): 1 - tanh(4) = 0.00067....
MATHEMATICA
a[0] = 1; a[n_] := Ceiling @ ArcTanh[1 - 10^(-n)]; Array[a, 100, 0] (* Amiram Eldar, Jul 12 2021 *)
PROG
(C++)
/* Only suitable for computing a(0) to a(14) due to double precision limits. */
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char** argv) {
int control = 1;
for (int n=0; n<=14; n++) {
for (int k=control; k<=100000000; k++){
double x = tanh(k);
double val = abs(1-x);
if (val < pow(10, -n)) {
cout << k <<", ";
control=k;
break;
}
}
}
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Treanungkur Mal, Jul 07 2021
STATUS
approved