OFFSET
1,2
COMMENTS
Terms 1,65,2059,6305,19171,... are also in A001047
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
Contains all Carmichael numbers (A002997) that are not divisible by 3. - Robert Israel, May 19 2015
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Robert Israel)
MAPLE
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
MATHEMATICA
Select[Range[3 10^4], ! PrimeQ[#] && Mod[3^(# - 1) - 2^(# - 1), #] == 0 &] (* Vincenzo Librandi, May 20 2015 *)
Select[Range[3*10^4], PowerMod[3, # - 1, #] == PowerMod[2, # - 1, #] && !PrimeQ[#] &] (* Amiram Eldar, Mar 27 2021 *)
PROG
(PARI) isok(n) = ! isprime(n) && !((3^(n-1)-2^(n-1)) % n); \\ Michel Marcus, Nov 28 2013
(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
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Aug 29 2002
EXTENSIONS
Term 14701 added and more terms from Michel Marcus, Nov 28 2013
STATUS
approved