OFFSET
1,2
COMMENTS
No other terms below 10^9.
Prime p divides 3^p - 2^p - 1. Quotients (3^p - 2^p - 1)/p are listed in A127071.
Numbers k such that k divides 3^k - 2^k - 1 are listed in A127072.
The pseudoprimes in A127072 include all powers of primes and some composite numbers that are listed in A127073.
Numbers k such that k^3 divides 3^k - 2^k - 1 begin 1, 4, 7 (with no other terms < 10^8).
Primes in {a(n)} are {2,3,7,179,619,...}.
MATHEMATICA
Do[f=(3^n-2^n-1); If[IntegerQ[f/n^2], Print[n]], {n, 1, 1000}]
Select[Range[20000], Mod[3^# -2^# -1, #^2]==0 &] (* G. C. Greubel, Jan 30 2020 *)
PROG
(PARI) for(n=1, 20000, if((3^n-2^n-1)%n^2 == 0, print1(n", "))) \\ G. C. Greubel, Jan 30 2020
(Magma) [n: n in [1..20000] | (3^n-2^n-1) mod n^2 eq 0]; // G. C. Greubel, Jan 30 2020
(Sage) [n for n in (1..20000) if mod(3^n-2^n-1, n^2)==0 ] # G. C. Greubel, Jan 30 2020
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Alexander Adamchuk, Jan 04 2007
EXTENSIONS
6 incorrect terms deleted by D. S. McNeil, Mar 16 2009 (the old version was 1,2,3,4,7,49,179,619,17807,95041,135433,393217,589825,1376257,1545601)
Edited by Max Alekseyev, Oct 21 2011
STATUS
approved