cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A122780 Nonprimes k such that 3^k == 3 (mod k).

Original entry on oeis.org

1, 6, 66, 91, 121, 286, 561, 671, 703, 726, 949, 1105, 1541, 1729, 1891, 2465, 2665, 2701, 2821, 3281, 3367, 3751, 4961, 5551, 6601, 7107, 7381, 8205, 8401, 8646, 8911, 10585, 11011, 12403, 14383, 15203, 15457, 15841, 16471, 16531, 18721, 19345
Offset: 1

Views

Author

Farideh Firoozbakht, Sep 11 2006

Keywords

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]

Examples

			66 is composite and 3^66 = 66*468229611858069884271524875811 + 3 so 66 is in the sequence.
		

Crossrefs

Programs

  • 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 *)
  • PARI
    is_A122780(n)={n>0 & Mod(3, n)^n==3 & !ispseudoprime(n)} \\ M. F. Hasler, Jul 19 2012