Talk:Next special primes

From Rosetta Code
Revision as of 19:42, 28 March 2021 by Tigerofdarkness (talk | contribs) (→‎OK, I'm not confused now...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

OK, I'm confused...

The task description is not very clear, what are the "successive terms" ?
My reading of the definition agrees with the Pascal output for "next increasing prime gap".

I can see why the sequence might be 3-5, 5-11, 11-19, etc. but I don't see why that is what the task requires.

Also, the Ring entry shows: 3-5, 11-19, 29-41, etc. i.e. 5-11 is not present.

Can anyone explain this?
BTW, I showed this to someone else and they suggested the answer was "2" because this is the smallest prime and the difference between it and every other prime is a strictly increasing sequence...

--Tigerofdarkness (talk) 19:44, 27 March 2021 (UTC)
("BTW comment" edited --Tigerofdarkness (talk) 19:41, 28 March 2021 (UTC))

OK, I'm not confused now...

Looking at the existing samples, it seems that we must find a sequence of primes such that the difference between the nth sequence member and the n+1th sequence number is greater than the difference between the n-1th sequence member and the nth.
2 is the only prime where the difference between it and the next prime is an odd number (the next prime is 3, of course), all oher primes have an even difference.
So the sequence starts 2,(1)3,(2)5, (differences shown in brackets). The next difference is 4, but 9 is not a prime so the next sequence element is 11 with a difference of 6 and so on.
Sorry if this was glaringly obvious to you, but it wasn't to me... : )

--Tigerofdarkness (talk) 19:41, 28 March 2021 (UTC)