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!)
A053671 Least number coprime to n, n+1 and n+2. 7

%I #17 Mar 01 2015 14:01:29

%S 5,5,7,7,11,5,5,7,7,7,5,5,11,11,7,5,5,7,11,13,5,5,7,7,7,5,5,11,7,7,5,

%T 5,13,11,11,5,5,7,7,11,5,5,7,7,7,5,5,11,11,7,5,5,7,13,13,5,5,7,7,7,5,

%U 5,11,7,7,5,5,11,11,11,5,5,7,7,13,5,5,7,7,7,5,5,11,11,7,5,5,7,11,11,5,5

%N Least number coprime to n, n+1 and n+2.

%H Reinhard Zumkeller, <a href="/A053671/b053671.txt">Table of n, a(n) for n = 1..10000</a>

%t a[n_] := (k = 5; While[! (CoprimeQ[k, n] && CoprimeQ[k, n+1] && CoprimeQ[k, n+2]), k++]; k); Table[a[n], {n, 1, 92}] (* _Jean-François Alcover_, Nov 30 2011 *)

%t lnc[n_]:=Module[{k=5,c=n+{0,1,2}},While[!And@@CoprimeQ[k,c],k=k+2];k]; Array[lnc,100] (* _Harvey P. Dale_, Mar 01 2015 *)

%o (Haskell)

%o a053671 n = f $ drop 2 a000040_list where

%o f (p:ps) | (n `mod` p) * ((n+1) `mod` p) * ((n+2) `mod` p) > 0 = p

%o | otherwise = f ps

%o -- _Reinhard Zumkeller_, Mar 19 2011

%Y Cf. A053669-A053674.

%K nonn,easy,nice

%O 1,1

%A _Henry Bottomley_, Feb 15 2000

%E More terms from _James A. Sellers_, Feb 22 2000

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 March 28 16:58 EDT 2024. Contains 371254 sequences. (Running on oeis4.)