%I #30 Sep 08 2022 08:45:06
%S 1,65,133,529,793,1105,1649,1729,2059,2321,2465,2701,2821,4187,5185,
%T 6305,6541,6601,6697,6817,7471,7613,8113,8911,10585,10963,11521,13213,
%U 13333,13427,14701,14981,15841,18721,19171,19201,19909,21349,21667,22177,26065
%N Nonprimes k such that k divides 3^(k-1) - 2^(k-1).
%C Terms 1,65,2059,6305,19171,... are also in A001047
%C All primes p>3 divide 3^(p-1) - 2^(p-1). It appears that a(1) = 1 and a(4) = 529 = 23^2 are the only perfect squares in a(n). Most terms of a(n) are squarefree. First 50 nonsquarefree terms of a(n) are the multiples of 23^2. Conjecture: All nonsquarefree terms of a(n) are the multiples of 23^2. Numbers n such that k=n*23^2 divides 3^(k-1) - 2^(k-1) are listed in A130058 = {1, 67, 89, 133, 199, 331, 617, 793, 881, 5281, 8911, 1419, 13333,...}. - _Alexander Adamchuk_, May 04 2007
%C Contains all Carmichael numbers (A002997) that are not divisible by 3. - _Robert Israel_, May 19 2015
%H Amiram Eldar, <a href="/A073631/b073631.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Robert Israel)
%p 1,op(select(n -> (3 &^ (n-1) - 2 &^ (n-1) mod n = 0 and not isprime(n)), [seq(2*i+1,i=1..10000)])); # _Robert Israel_, May 19 2015
%t Select[Range[3 10^4], ! PrimeQ[#] && Mod[3^(# - 1) - 2^(# - 1), #] == 0 &] (* _Vincenzo Librandi_, May 20 2015 *)
%t Select[Range[3*10^4], PowerMod[3, # - 1, #] == PowerMod[2, # - 1, #] && !PrimeQ[#] &] (* _Amiram Eldar_, Mar 27 2021 *)
%o (PARI) isok(n) = ! isprime(n) && !((3^(n-1)-2^(n-1)) % n); \\ _Michel Marcus_, Nov 28 2013
%o (Magma) [n: n in [1..3*10^4] | not IsPrime(n) and IsDivisibleBy(3^(n-1)-2^(n-1), n)]; // _Vincenzo Librandi_, May 20 2015
%Y Cf. A001047 (3^n - 2^n), A002997.
%Y Cf. A038876, A097934 (primes p such that p divides 3^((p-1)/2) - 2^((p-1)/2)).
%Y Cf. A130059, A130058 (numbers n such that k=n*23^2 divides 3^(k-1) - 2^(k-1)).
%K easy,nonn
%O 1,2
%A _Benoit Cloitre_, Aug 29 2002
%E Term 14701 added and more terms from _Michel Marcus_, Nov 28 2013