if the recurrence sequence is defined by the following foormula, $d_{n + 3} = 3d_{n + 2} - d_{n + 1} - 2d_n$ where $d_1 = 1, d_2 = 3$ and $ d_3 = 7$, this produce the following complex sequence $$1, 3, 7, 16, 35, 75, 158, 329, 679, 1392, ...$$.
if this sequence is evaluated over finite field, i mean modulo some interger, $p$ $$(d_{n + 3} = 3d_{n + 2} - d_{n + 1} - 2d_n) \text{mod}\,p$$ It follows that, if $p$ is prime number, the last three term if evaluated up to $n = p + 2$, last three terms i mean $d_{p}, d_{p + 1}$ and $d_{p + 2}$ fall in one of the following ending sequence $\{...,1, 3, 7\}$ or $\{...,4, 7, 14\}$, if $p$ is smaller than these ending patterns, then modulo by $p$. the only exception for prime numbers less than $7$
i have tested all numbers up to $100,000$, no pseudo prime exist
Prior Studied Sequences
i studied Lucas numbers for existence of pattern like this, but there existed many pseudo prime below $10,000$ e.g $377$. then i studied recussive sequence defined by the following formula $d_{n+3} = d_{n + 2} + 2d_{n + 1} - d_n$. in this sequence pseudo prime exist above $10^6$, may be this sequence can pull up this boundary
Questions
- is there any pseudo prime above tested range of this sequence
- can anyone explain to me further why this patterns appear to prime only, if mo pseudoprime pass this test
UPDATES ONE DAY AFTER POST
This update i made after reviewing users comments and answers, thanks to @ Alekseyev for discovering pseudo primes and all other contributions
Facts About Pseudo Primes Of This Recurence
- all pseudo primes are divisible by primes. $p_1, p_2,..., p_n$, all of these primes are in the form of $10k + 1$. My limitation is computational power, i can not test big numbers
- all prime factors of these pseudo primes have period of $p - 1$. prime numbers of the form $10k - 1$ also have periods of the form $p -1$. no counter example for other primes having this form of period. if any found?
- if a composite number $n$ have all of its prime factors of this form, $p = 10k + 1$. the resulting period of $n$ get reduced by factor of $10$ and sometimes more than that. the gcd of resultant period $r$ and $n - 1$ is equal to $r$. this explain why $nth$ period occurs at $p - 1$ and the number get evaluated as prime number while not
New Update
as we go to the right of number line toward big numbers, things start to deviate from my expectation and all the statement above seem to be invalid, i have found one pseudo prime whose last digit is not $1$, $6368689$ and some prime factors of pseudo primes are not of form $10k + 1$, $16778881$
here is a list of all pseudo prime up to $20 \times 10^6$.
$219781,252601,399001,512461,722261,741751,852841,1024651,1193221,1533601,1690501,1735841,1857241,1909001, 2100901, 2165801, 2603381, 2704801, 2757241, 3568661, 4504501, 6368689, 6840001, 8341201, 8646121, 8719921, 9863461, 10386241, 10403641, 10837321, 12261061, 14609401, 14671801, 16778881$