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 A321575 #22 Nov 27 2018 17:31:12 %S A321575 9,4,341,4,6,4,9,4,14,4,6,4,9,4,21,4,6,4,9,4,15,4,6,4,9,4,10,4,6,4,9, %T A321575 4,62,4,6,4,9,4,49,4,6,4,9,4,33,4,6,4,9,4,14,4,6,4,9,4,10,4,6,4,9,4, %U A321575 65,4,6,4,9,4,49,4,6,4,9,4,111,4,6,4,9,4,15 %N A321575 Nexus primary pretenders: a(n) is the smallest composite k such that n^k - (n-1)^k == 1 (mod k). %C A321575 The sequence is bounded, namely a(n) <= 561 (the smallest Carmichael number), since if n^k == n (mod k) and (n-1)^k == n-1 (mod k), then n^k - (n-1)^k == 1 (mod k). %C A321575 Problem: find all distinct terms of the sequence. Is this sequence periodic like the primary pretenders? %C A321575 Note that a(n) > 9 if and only if n == 2 (mod 6). We have a(6m+2) = 341, 14, 21, 15, 10, 62, 49, 33, 14, 10, 65, 49, 111, 15, 10, ... for m >= 0. Found a(n) = 561 for the smallest n = 6*70+2 = 422. %C A321575 From _Robert Israel_, Nov 27 2018: (Start) %C A321575 Since a(n) depends only on the residues of n mod k for composites k <= 561, it must be periodic with period at most the lcm of those composites. %C A321575 Up to n=2*10^6, the last term to appear for the first time is 478 = a(184748). %C A321575 Conjecture: the only terms of the sequence that are not squarefree are 4, 9 and 49. (End) %H A321575 Robert Israel, <a href="/A321575/b321575.txt">Table of n, a(n) for n = 0..10000</a> %F A321575 a(n) = 4 iff n == 1,3,5 (mod 6), thus n is odd. %F A321575 a(n) = 6 iff n == 4 (mod 6). %F A321575 a(n) = 9 iff n == 0 (mod 6). %p A321575 Comps:= remove(isprime, [$4..561]): %p A321575 f:= proc(n) local k; %p A321575 for k in Comps do if n&^k - (n-1)&^k - 1 mod k = 0 then return k fi od %p A321575 end proc: %p A321575 map(f, [$0..100]); # _Robert Israel_, Nov 27 2018 %t A321575 a[n_]:=Module[{k=4}, While[PrimeQ[k] || Mod[n^k-(n-1)^k,k]!=1, k++]; k]; Array[a, 100, 0] (* _Amiram Eldar_, Nov 13 2018 *) %o A321575 (PARI) a(n)=forcomposite(k=4,,Mod(n,k)^k-Mod(n-1,k)^k==1&&return(k)) \\ _M. F. Hasler_, Nov 13 2018 %Y A321575 Cf. A000790, A108574. %K A321575 nonn %O A321575 0,1 %A A321575 _Thomas Ordowski_, Nov 13 2018 %E A321575 More terms from _Amiram Eldar_, Nov 13 2018