0
$\begingroup$

I'm working on a personal project and I did a search for an integer sequence on the site listed below. I found the sequence I was looking for with a short description of the function defining the sequence. However, no matter how much I struggle to get the function to work, I cannot. If you could clarify the description at the link for me (maybe even provide an example or two) that would great. Thanks for any help!

Here is the link to the description: http://oeis.org/A039739

And here is the link to the sequence: http://oeis.org/A039739/list

  • 0
    I don't get it either, since I can't see how $p(n)$ is defined, and $p(n)$ is used in the description of the sequence.2012-11-04
  • 0
    Maybe $p(n)$ is the $n$th prime?2012-11-04
  • 0
    @ronno nope, it appears not2012-11-04
  • 0
    $n$th odd prime, it appears.2012-11-04

1 Answers 1

0

"$a(n)=2q-p(n)$, where $q$ is the prime $\lt p(n)$ for which $p(n) \bmod q$ is maximal."

I think $p(n)$ is the $n$th (odd) prime. So to find, say, $a(5)$, you look at $p(5)$, the 5th odd prime, which is $13$, then you calculate $13\bmod q$ for $q=3,5,7,11$, getting $1,3,6,2$, of which the largest is the $6$ you get from $q=7$. So, $a(5)=2\times7-13=1$.

  • 0
    I have not tried that, but in the sequence provided at the website, the answer to a(5) is not 1 but 3.2012-11-04
  • 0
    One thing that might be useful to keep in mind--I know that one is not considered a Prime number any more, but it appears that at the time of the post that is was. So instead of 11 being the 5th prime, 7 would be. I checked the equation on other numbers and it still doesn't work, but it did in your example.2012-11-04
  • 0
    The sequence at oeis starts 1, 1, 3, 3, 1, 5, 3, 3, 5, 3, 1, so $a(5)$ is the 5th term in that sequence, which is 1, not 3. The link does not count 1 as a prime, nor 2 --- just odd primes, as I wrote.2012-11-04
  • 0
    Alright, but in the second link I provided, there is a list with the value of n used and the following value, a(n). In this list, if n = 5, then a(n) = 3 instead of 1.2012-11-04
  • 0
    Ok. I see what you mean. 1 is the 5th number in the sequence, so a(5) should be 1. Why does the list say otherwise?2012-11-04
  • 0
    I don't know. At this point, my advice is try all the different interpretations that have been put forward, and go with the one that works, if any. And if it appears to contradict the numbering at oeis, drop them a note with your findings, so maybe they'll correct it.2012-11-04