OFFSET

1,1

COMMENTS

The first odd prime not to appear in the sequence is 3 because 3^k + 2 == 2 mod 3 for k >= 1.

Primes p such that the order of -2 (mod p) divides the order of 3 (mod p). - Joerg Arndt, Mar 31 2018, corrected by Robert Israel, May 04 2018

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

EXAMPLE

5 divides 245 which is 3^5+2 so 5 is in the sequence.

7 divides 245 which is 3^5+2 so 7 is in the sequence.

The values of x = (3^k+2) mod 13 for k = 0, 1, 2, 3, ... are 3, 5, 11, 3, 5, 11, ...; 13 never divides any 3^k + 2, so 13 is not in the sequence.

MAPLE

select(t -> numtheory:-mlog(-2, 3, t)<>FAIL, [seq(ithprime(i), i=3..100)]);

MATHEMATICA

fQ[p_] := IntegerQ@ MultiplicativeOrder[3, p, -2]; Select[ Prime@ Range@ 100, fQ] (* Robert G. Wilson v, Apr 07 2018 *)

PROG

(PARI) is(n)=n>4 && isprime(n) && znorder(Mod(-2, n))%znorder(Mod(3, n))==0 \\ Charles R Greathouse IV, May 04 2018

CROSSREFS

KEYWORD

nonn

AUTHOR

Luke W. Richards, Mar 28 2018

STATUS

approved