Question: *I'm bad at Math and english isn't my native language. Bear with me. Thanks.*

I'm running a prime number search script and writing the result to a SQLite3 database.

Now I'm looking for a way to shorten these prime numbers because I don't want to be forced to store them as strings if they get very big/long. I don't want to loose precision, so the shortened version should allow it to recompute the original value.

I don't care if the database has human-readable data. I can make it human-readable when I fetch data from the database again.

Browsed <https://oeis.org> and <https://primes.utm.edu> to see how they organize their database, but I was only more confused after that. Is there a best practice for this? I'm really stuck.

Answer: 
As in many questions,
the answer is Bernoulli,
but in this case the numbers,
not the inequality.
See <https://en.wikipedia.org/wiki/Bernoulli_number>.

You have
$f(x) = {{1}\over{\exp{\left(1\over{x}\right)-1}}}
$.

The Bernoulli numbers satisfy
$b(t)
=\dfrac{t}{e^t-1}
=\sum\_{m=0}^{\infty} \dfrac{B\_m t^m}{m!}
$
where the
$B\_m=
1, -\dfrac12, \dfrac16, 0, -\dfrac1{30}, ...
$.

Therefore
$b(1/x)
=\dfrac{1/x}{e^{1/x}-1}
$
so that
$f(x)
=xb(1/x)
=x(1 -\dfrac1{2x}+ \dfrac1{6x^2} -\dfrac1{30x^4}+ ...)
=x -\dfrac1{2}+ \dfrac1{6x} -\dfrac1{30x^3}+ ...
$.
$e^{1/x}-1
=1/x+1/(2x^2)+...
=(1/x)(1+1/(2x)+...)
$

so

$1/(e^{1/x}-1)
=x/(1+1/(2x)+...)
=x(1-1/(2x)+...)
=x-1/2+...
$

Take more terms
to get more accuracy.