Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possibly this is a very lame question for this site.

There is a function $f(n)=-\ln(a*n); \space \Bbb Z \to \Bbb R$, and I want to define $a$ for pairs of values. For example:

$f_1(n_1)=15; f_1(n_5)=1.157$

$f_2(n_1)=454; f_2(n_8)=1.0042$

and so on. How can I write a function that could calculate $a$ values from the starting values?

share|improve this question
What are $n_1$, $n_5$, and $n_8$? Or what do you know about them, other than that they are the first, fifth, and eighth elements of a sequence? (I'm assuming) – David Z Sep 17 '12 at 20:09
up vote 4 down vote accepted

I guess you want something like this, but not sure:

Solve[{-Log[a n] == x1, -Log[a (n + k)] == x2}, {a, n}]
  a -> (-E^-x1 + E^-x2)/k


More generally, for any invertible function f:

Solve[{f[a n] == x1, f[a (n + k)] == x2}, {a, n}]

$\left\{\left\{a\to \frac{f^{(-1)}(\text{x2})-f^{(-1)}(\text{x1})}{k},n\to -\frac{k f^{(-1)}(\text{x1})}{f^{(-1)}(\text{x1})-f^{(-1)}(\text{x2})}\right\}\right\}$

share|improve this answer
+1 for a good guess (I was completely mystified, but this looks plausible). – Oleksandr R. Sep 17 '12 at 20:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.