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 A316940 #28 Aug 27 2019 09:54:17 %S A316940 35,7957,16531,1247,17767,35,817,2501,697,4141,2257,143,9577,2257, %T A316940 4187,1247,3991,221,7957,2059,55,161,1027,115,403,475,247,4553,35,247, %U A316940 6289,697,1853,35,1247,35,589,221,95,533,35,559,77,215,253,235,221,329,247,119 %N A316940 Smallest "anti-Carmichael pseudoprime" to base n. %C A316940 a(n) is the smallest k such that n^(k-1) == 1 (mod k) and p-1 does not divide k-1 for every prime p dividing k. %C A316940 All listed terms are semiprime and squarefree, except a(26) = 475 = 5^2*19. %H A316940 Amiram Eldar, <a href="/A316940/b316940.txt">Table of n, a(n) for n = 1..10000</a> %t A316940 Table[Block[{k = 2}, While[Nand[PowerMod[n, k - 1, k] == 1, AllTrue[FactorInteger[k][[All, 1]] - 1, Mod[k - 1, #] != 0 &]], k++]; k], {n, 50}] (* _Michael De Vlieger_, Jul 20 2018 *) %o A316940 (PARI) isok(k, n) = {if (!isprime(k) && Mod(n, k)^(k-1) == 1, f = factor(k)[,1]; for (j=1, #f~, if (!((k-1) % (f[j]-1)), return (0));); return (1);); return (0);} %o A316940 a(n) = {my(k=2); while(!isok(k, n), k++); k;} \\ _Michel Marcus_, Jul 17 2018 %Y A316940 Cf. A121707 (probably "anti-Carmichael numbers": n such that p-1 does not divide n-1 for every prime p dividing n). %Y A316940 Cf. A316907 ("anti-Carmichael pseudoprimes" to base 2). %K A316940 nonn %O A316940 1,1 %A A316940 _Thomas Ordowski_, Jul 17 2018 %E A316940 More terms from _Michel Marcus_, Jul 17 2018