%I #79 Sep 08 2022 08:44:40
%S 1,2,10,50,250,1250,5050,6250,11810,25250,31250,59050,126250,156250,
%T 295250,510050,631250,750250,781250,1476250,2125250,2550250,3156250,
%U 3751250,3906250,5964050,7381250,10626250,12751250,13947610,15781250
%N Numbers k such that k | 3^k + 1.
%C a(n) mod 20 = 10 for n >= 3. - _G. C. Greubel_, Nov 05 2018
%C This sequence is infinite, because for n > 1, 3^a(n) + 1 is in this sequence. - _Jinyuan Wang_, Nov 06 2018
%C For the provided data, if k is a term then p*k is a term where p is an odd divisor of k. - _David A. Corneth_, Nov 06 2018
%H Giovanni Resta, <a href="/A015949/b015949.txt">Table of n, a(n) for n = 1..180</a> (first 100 terms from G. C. Greubel)
%t Do[If[PowerMod[3, n, n] + 1 == n, Print[n]], {n, 1, 10^7}] (* _Jinyuan Wang_, Nov 01 2018 *)
%o (PARI) for(n=1, 10^7, if(Mod(3, n)^n==-1, print1(n, ", "))) \\ _Jinyuan Wang_, Nov 01 2018
%o (Magma) [n: n in [1..2*10^7]| Modexp(3, n, n)+1 eq n]; // _Vincenzo Librandi_, Nov 01 2018
%Y Cf. A034472 (3^n+1).
%Y Cf. A006521 (k | 2^k + 1), A015950 (k | 4^k + 1), A015951 (k | 5^k + 1).
%Y Column k=3 of A333429.
%K nonn
%O 1,2
%A _Robert G. Wilson v_
%E Corrected by _David W. Wilson_