OFFSET
1,2
COMMENTS
Theorem: If both numbers q and 2q-1 are primes then n=q*(2q-1) is in the sequence iff q<5 or q is of the form 12k+1. 6,15,2701,18721,49141,104653,226801,665281,... are such terms.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
1 is a term since 6^1 = 6 is congruent to 6 mod 1.
2 is not a term since although 6^2 === 6 (mod 2), 2 IS a prime.
4 is not a term since 6^4 = 1296 == 0 mod 4, while 6 == 2 (mod 4).
6 is a term since 6^6 = 46656 == 0 (mod 6), and 6 == 0 (mod 6).
10 is a term because 6^10 = 60466176 == 6 (mod 10)
MATHEMATICA
Select[Range[7000], ! PrimeQ[ # ] && Mod[6^#, # ] == Mod[6, # ] &]
Join[{1, 6}, Select[Range[7000], !PrimeQ[#]&&PowerMod[6, #, #]==6&]] (* Harvey P. Dale, Jan 06 2022 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Farideh Firoozbakht, Sep 12 2006
EXTENSIONS
Examples added by N. J. A. Sloane, Jan 06 2022
STATUS
approved