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.

A122786 Nonprimes n such that 9^n == 9 (mod n).

Original entry on oeis.org

1, 4, 6, 8, 9, 12, 15, 18, 24, 28, 36, 45, 52, 66, 72, 91, 121, 153, 205, 276, 286, 364, 366, 369, 396, 435, 511, 532, 561, 616, 671, 697, 703, 726, 804, 946, 949, 1035, 1036, 1105, 1128, 1288, 1387, 1541, 1729, 1737, 1845, 1854, 1891, 2196, 2465, 2501, 2556, 2665
Offset: 1

Views

Author

Farideh Firoozbakht, Sep 12 2006

Keywords

Comments

Theorem: If both numbers q and 2q-1 are primes and n=q*(2q-1) then 9^n==9 (mod n) (n is in the sequence). So A005382*(2*A005382-1)= 6,15,91,703,1891,2701,12403,18721,... is the related subsequence. A020138 is a subsequence of this sequence.

Crossrefs

Programs

  • Maple
    q:= n-> is(not isprime(n) and (9 &^ n mod n) = (9 mod n)):
    select(q, [$1..3000])[];  # Alois P. Heinz, Mar 06 2019
  • Mathematica
    Select[Range[4000], ! PrimeQ[ # ] && Mod[9^#, # ] == Mod[9, # ] &]
    Join[{1,4,6,8,9},Select[Range[3000],CompositeQ[#]&&PowerMod[9,#,#]==9&]] (* Harvey P. Dale, Jul 17 2014 *)
  • PARI
    isok(n) = !isprime(n) && (Mod(9,n)^n == Mod(9, n)); \\ Michel Marcus, Mar 06 2019