login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A071222 Smallest k such that gcd(n,k) = gcd(n+1,k+1). 8
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
a(n) = least m>0 such that gcd(n!+1+m,n-m) = 1. [Clark Kimberling, Jul 21 2012]
From Antti Karttunen, Jan 26 2014: (Start)
a(n-1)+1 = A053669(n) = Smallest k >= 2 coprime to n = Smallest prime not dividing n.
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).
(End)
LINKS
Clark Kimberling & Antti Karttunen, Table of n, a(n) for n = 0..10001 (Terms up to n=1000 from Kimberling)
FORMULA
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A249270 - 1. - Amiram Eldar, Jul 26 2022
MATHEMATICA
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 *)
PROG
(PARI) for(n=1, 140, s=1; while(gcd(s, n)<gcd(n+1, s+1), s++); print1(s, ", "))
(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
(Haskell)
a071222 n = head [k | k <- [1..], gcd (n + 1) (k + 1) == gcd n k]
-- Reinhard Zumkeller, Oct 01 2014
CROSSREFS
One less than A053669(n+1).
Sequence in context: A324575 A035400 A235918 * A067005 A230849 A135517
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Jun 10 2002
EXTENSIONS
Added a(0)=1. - N. J. A. Sloane, Jan 19 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 03:01 EDT 2024. Contains 371767 sequences. (Running on oeis4.)