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 A071222 #31 Jul 26 2022 12:45:28 %S A071222 1,2,1,2,1,4,1,2,1,2,1,4,1,2,1,2,1,4,1,2,1,2,1,4,1,2,1,2,1,6,1,2,1,2, %T A071222 1,4,1,2,1,2,1,4,1,2,1,2,1,4,1,2,1,2,1,4,1,2,1,2,1,6,1,2,1,2,1,4,1,2, %U A071222 1,2,1,4,1,2,1,2,1,4,1,2,1,2,1,4,1,2,1,2,1,6,1,2,1,2,1,4,1,2,1,2,1,4,1,2,1,2 %N A071222 Smallest k such that gcd(n,k) = gcd(n+1,k+1). %C A071222 a(n) = least m>0 such that gcd(n!+1+m,n-m) = 1. [_Clark Kimberling_, Jul 21 2012] %C A071222 From _Antti Karttunen_, Jan 26 2014: (Start) %C A071222 a(n-1)+1 = A053669(n) = Smallest k >= 2 coprime to n = Smallest prime not dividing n. %C A071222 Note that a(n) is equal to A235918(n+1) for the first 209 values of n. The first difference occurs at n=210 and A235921 lists the integers n for which a(n) differs from A235918(n+1). %C A071222 (End) %H A071222 Clark Kimberling & Antti Karttunen, <a href="/A071222/b071222.txt">Table of n, a(n) for n = 0..10001</a> (Terms up to n=1000 from Kimberling) %F A071222 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A249270 - 1. - _Amiram Eldar_, Jul 26 2022 %t A071222 sgcd[n_]:=Module[{k=1},While[GCD[n,k]!=GCD[n+1,k+1],k++];k]; Array[sgcd,110] (* _Harvey P. Dale_, Jul 13 2012 *) %o A071222 (PARI) for(n=1,140,s=1; while(gcd(s,n)<gcd(n+1,s+1),s++); print1(s,",")) %o A071222 (Scheme) (define (A071222 n) (let loop ((k 1)) (cond ((= (gcd n k) (gcd (+ n 1) (+ k 1))) k) (else (loop (+ 1 k)))))) ;; _Antti Karttunen_, Jan 26 2014 %o A071222 (Haskell) %o A071222 a071222 n = head [k | k <- [1..], gcd (n + 1) (k + 1) == gcd n k] %o A071222 -- _Reinhard Zumkeller_, Oct 01 2014 %Y A071222 One less than A053669(n+1). %Y A071222 Cf. also A007978, A055874, A235918, A235921, A249270. %K A071222 easy,nonn %O A071222 0,2 %A A071222 _Benoit Cloitre_, Jun 10 2002 %E A071222 Added a(0)=1. - _N. J. A. Sloane_, Jan 19 2014