0
$\begingroup$

I am trying to find a formula for the $n$th term of a sequence of rational numbers less than 1. Regardless of how many terms I include in the table, FindSequenceFunction copies the input as the output. Perhaps my sequence is too complicated, but I would like to know if there are any other methods or functions which help find the $n$th term of a sequence.

Here's the code for the sorted table:

sopf[n_] := Plus @@ (First /@ FactorInteger[n])
Composite[n_Integer] := FixedPoint[n + PrimePi[#] + 1 &, n]
Sort[Table[
1 - ((1 + sopf[Composite[j]] - PrimeNu[Composite[j]])/
Composite[j]), {j, 1, 30}]]

With output

*{1/3, 2/5, 3/7, 5/11, 6/13, 8/17, 9/19, 1/2, 8/15, 4/7, 20/33, 8/13,
2/3, 2/3, 24/35, 7/10, 5/7, 8/11, 11/15, 3/4, 16/21, 7/9, 4/5, 5/6,
38/45, 17/20, 7/8, 8/9, 8/9, 15/16}*
$\endgroup$
  • $\begingroup$ try oeis.org perhaps $\endgroup$ – pdmclean Oct 21 '17 at 22:00
  • $\begingroup$ @pdmclean that only works for integers. $\endgroup$ – The Substitute Oct 21 '17 at 22:26
  • 1
    $\begingroup$ Yes, but you can search the sequence of numerators and the sequence of denominators separately. $\endgroup$ – J. M. will be back soon Oct 26 '17 at 13:11
  • $\begingroup$ I tried, they didn't match any sequence in their database. $\endgroup$ – The Substitute Oct 27 '17 at 1:58
1
$\begingroup$

This is how to answer any stupid question about finite sequences in pre-employment testing:

a = Sort[RandomInteger[{1, 100}, 20]];
f = Interpolation[a];
Show[
 ListPlot[a],
 Plot[f[t], {t, 1, Length[a]}]
 ]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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