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 A216506 #25 May 17 2024 03:22:13 %S A216506 1,2,1,2,1,4,2,2,1,2,1,4,2,2,1,644,1,5700,2,2,1,2,3,4,2,4,1,2,1,12,8, %T A216506 2,3,2,1,4,5,2,1,2,1,4,2,4,1,14,2,4,2,2,1,2,2,16,2,4,1,12,1,16,273,2, %U A216506 3,2,1,4,2,2,1,246,1,4,2,2,16,8,1,4,15,2,1,2,4,12 %N A216506 Least number k such that k*n+1 is a prime dividing n^(2n) - 1. %C A216506 The corresponding prime factors of n^(2n)-1 of the form k*n+1 is in A216487. %H A216506 Amiram Eldar, <a href="/A216506/b216506.txt">Table of n, a(n) for n = 2..670</a> %e A216506 a(7) = 4 because 7^14 - 1 = 2 ^ 4 * 3 * 29 * 113 * 911 * 4733 and the smallest prime divisor of the form k*n+1 is 29 = 4*7+1 => k = 4. %t A216506 Table[p=First/@FactorInteger[n^(2*n)-1]; (Select[p, Mod[#1, n] == 1 &, 1][[1]]-1)/n, {n, 2, 50}] %t A216506 a[n_] := Module[{m = n + 1}, While[!PrimeQ[m] || PowerMod[n, 2*n, m] != 1, m += n]; (m - 1)/n]; Array[a, 100, 2] (* _Amiram Eldar_, May 17 2024 *) %o A216506 (PARI) a(n) = {my(m = n + 1); while(!isprime(m) || Mod(n, m)^(2*n) != 1, m += n); (m - 1)/n;} \\ _Amiram Eldar_, May 17 2024 %Y A216506 Cf. A006486, A007571, A187022, A187023, A216487. %K A216506 nonn %O A216506 2,2 %A A216506 _Michel Lagneau_, Sep 11 2012 %E A216506 Data corrected and extended by _Amiram Eldar_, May 17 2024