OFFSET
1,2
COMMENTS
Theorem: If q!=3 and both numbers q and (2q-1) are primes then k=q*(2q-1) is in the sequence. 6, 91, 703, 1891, 2701, 12403, 18721, 38503, 49141, ... is the related subsequence.
The terms > 1 and coprime to 3 of this sequence are the base-3 pseudoprimes, A005935. - M. F. Hasler, Jul 19 2012 [Corrected by Jianing Song, Feb 06 2019]
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
66 is composite and 3^66 = 66*468229611858069884271524875811 + 3 so 66 is in the sequence.
MAPLE
isA122780 := proc(n)
if isprime(n) then
false;
else
modp( 3 &^ n, n) = modp(3, n) ;
end if;
end proc:
for n from 1 do
if isA122780(n) then
print(n) ;
end if;
end do: # R. J. Mathar, Jul 15 2012
MATHEMATICA
Select[Range[30000], ! PrimeQ[ # ] && Mod[3^#, # ] == Mod[3, # ] &]
Join[{1}, Select[Range[20000], !PrimeQ[#]&&PowerMod[3, #, #]==3&]] (* Harvey P. Dale, Apr 30 2023 *)
PROG
(PARI) is_A122780(n)={n>0 & Mod(3, n)^n==3 & !ispseudoprime(n)} \\ M. F. Hasler, Jul 19 2012
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Farideh Firoozbakht, Sep 11 2006
STATUS
approved