[seqfan] Comment about A002822

nando nando8888 at gmail.com
Fri May 24 11:29:49 CEST 2019


Hi SeqFans,

I know about an algorithm for testing whether an integer n belongs to
the A002822 sequence (Numbers n such that 6n-1, 6n+1 are twin primes).
The interesting part (at least for me) is that this algorithm involves
no primality tests whatsoever.

For n >= 4
* compute k = floor((1+sqrt(1+6n))/6)
* n is a member of A002822 iff neither (6j-1) nor (6j+1) divide
(n^2-j^2) for all j from 1 to k

For n < 4, the above k turns out to be 0, so there are no filters and
the test is passed by default.

I've never seen this algorithm mentioned anywhere, so I'm looking for
feedback from the list subscribers as to whether or not this could
possibly be a worthy addition to the comments of that sequence.

Thanks.
-- Nando



More information about the SeqFan mailing list