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.
%I A322120 #13 Jan 27 2019 09:25:48 %S A322120 341,91,91,217,481,25,65,91,91,133,133,85,781,341,91,91,25,49,671,221, %T A322120 169,91,553,217,133,121,361,341,49,49,25,545,703,341,403,217,85,341, %U A322120 121,671,529,25,703,133,133,65,481,247,793,451,671,703,361,697,403,25 %N A322120 a(n) is the smallest composite k such that n^(k-1) == 1 (mod (n^2-1)*k). %C A322120 a(n) >= A271801(n). All terms are odd and indivisible by 3. %C A322120 Conjecture: if m is a composite number such that b^(m-1) == 1 (mod (b^2-1)m) for some b, then m is a strong pseudoprime to some base a in the range 2 <= a <= m-2. Thus, probably every term a(n) is in A181782. %t A322120 a[n_] := Module[{k=4}, While[PrimeQ[k] || !Divisible[n^(k-1)-1, (n^2-1)k], k++]; k]; Array[a, 100, 2] (* _Amiram Eldar_, Nov 27 2018 *) %o A322120 (PARI) a(n) = {forcomposite(k=1, ,if (Mod(n, (n^2-1)*k)^(k-1) == 1, return (k)););} \\ _Michel Marcus_, Nov 28 2018 %Y A322120 Cf. A181782, A271801, A298756, A322121. %K A322120 nonn %O A322120 2,1 %A A322120 _Thomas Ordowski_, Nov 27 2018 %E A322120 More terms from _Amiram Eldar_, Nov 27 2018