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!)
A113484 a(n) = smallest composite integer > n and coprime to n. 2

%I #19 Mar 28 2021 15:53:56

%S 4,9,4,9,6,25,8,9,10,21,12,25,14,15,16,21,18,25,20,21,22,25,24,25,26,

%T 27,28,33,30,49,32,33,34,35,36,49,38,39,40,49,42,55,44,45,46,49,48,49,

%U 50,51,52,55,54,55,56,57,58,63,60,77,62,63,64,65,66,85,68,69,70,81,72,77

%N a(n) = smallest composite integer > n and coprime to n.

%H G. C. Greubel, <a href="/A113484/b113484.txt">Table of n, a(n) for n = 1..1000</a>

%F a(p) = p+1 for prime p > 2. - _Michel Marcus_, Mar 13 2017

%t f[n_] := Block[{k = n + 1}, While[PrimeQ@k || GCD[k, n] > 1, k++ ]; k]; Array[f, 72] (* _Robert G. Wilson v_ *)

%o (PARI) a(n) = my(k = n+1); while(isprime(k) || (gcd(n,k) != 1), k++); k; \\ _Michel Marcus_, Mar 13 2017

%o (Python)

%o from sympy import isprime, gcd

%o def A113484(n):

%o k = n+1

%o while gcd(k,n) != 1 or isprime(k):

%o k += 1

%o return k # _Chai Wah Wu_, Mar 28 2021

%Y Cf. A113496.

%K nonn

%O 1,1

%A _Leroy Quet_, Jan 11 2006

%E More terms from _Robert G. Wilson v_, Jan 13 2006

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 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)