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.

A298908 Smallest composite k such that (n^k - 1)/(n - 1) == 1 (mod k) for n > 1.

Original entry on oeis.org

341, 91, 4, 15, 6, 25, 4, 9, 10, 33, 4, 65, 14, 15, 4, 9, 6, 49, 4, 21, 22, 69, 4, 25, 9, 9, 4, 15, 6, 49, 4, 33, 34, 9, 4, 133, 38, 15, 4, 21, 6, 25, 4, 9, 46, 65, 4, 25, 10, 39, 4, 9, 6, 35, 4, 25, 58, 15, 4, 91, 9, 9, 4, 15, 6, 49, 4, 15, 10, 9, 4, 65, 15, 15, 4, 21, 6, 49, 4, 9
Offset: 2

Views

Author

Keywords

Comments

The smallest repunit pseudoprime to base n.
a(n) is the smallest composite k such that n^k == n (mod (n-1)k).
a(n) is the smallest composite k such that (n^k - 1)/(n - 1) is a Fermat pseudoprime to base n.
a(n) >= A000790(n).
a(n) <= A271801(n).
a(m!+1) > m.
a(4m) = 4.
Records: 341, 361, 403, 561, 685, 1247, 1387, 1891, 2353, 2701, 3277, 4681, 5173, 5461, 6001, 6541, 7445, ..., .
If n is composite, then a(n) <= n. There are only finitely many primes p such that a(p) > p. It seems that a(n) < n for all sufficiently large n. - Thomas Ordowski, Sep 10 2018

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 4}, While[PrimeQ@k || Mod[(n^k -1)/(n -1), k] != 1, k++]; k]; Array[f, 80, 2]
    With[{r = Select[Range[4, 400], CompositeQ]}, Table[SelectFirst[r, Mod[(n^# - 1)/(n - 1), #] == 1 &], {n, 2, 81}]] (* Michael De Vlieger, Jan 28 2018 *)