OFFSET
1,2
COMMENTS
Prime p divides 3^p - 2^p - 1.
Quotients (3^p - 2^p - 1)/p, where p is prime, are listed in A127071.
Pseudoprimes in a(n) include all powers of primes {2,3,7} and some composite numbers that are listed in A127073.
Numbers k such that k^2 divides 3^k - 2^k - 1 are listed in A127074.
Numbers k such that k^3 divides 3^k - 2^k - 1 are {1, 4, 7, ...}.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
MATHEMATICA
Select[Range[1000], IntegerQ[(3^#-2^#-1)/# ]&]
PROG
(PARI) is(n)=Mod(3, n)^n-Mod(2, n)^n==1 \\ Charles R Greathouse IV, Nov 04 2016
(Magma) [n: n in [1..250] | ((3^n - 2^n - 1) mod n) eq 0]; // G. C. Greubel, Aug 12 2019
(Sage) [n for n in (1..250) if mod(3^n-2^n-1, n)==0 ] # G. C. Greubel, Jan 30 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Alexander Adamchuk, Jan 04 2007
STATUS
approved