A113484 a(n) = smallest composite integer > n and coprime to n.
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, 27, 28, 33, 30, 49, 32, 33, 34, 35, 36, 49, 38, 39, 40, 49, 42, 55, 44, 45, 46, 49, 48, 49, 50, 51, 52, 55, 54, 55, 56, 57, 58, 63, 60, 77, 62, 63, 64, 65, 66, 85, 68, 69, 70, 81, 72, 77
Offset: 1
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
Crossrefs
Cf. A113496.
Programs
-
Mathematica
f[n_] := Block[{k = n + 1}, While[PrimeQ@k || GCD[k, n] > 1, k++ ]; k]; Array[f, 72] (* Robert G. Wilson v *)
-
PARI
a(n) = my(k = n+1); while(isprime(k) || (gcd(n,k) != 1), k++); k; \\ Michel Marcus, Mar 13 2017
-
Python
from sympy import isprime, gcd def A113484(n): k = n+1 while gcd(k,n) != 1 or isprime(k): k += 1 return k # Chai Wah Wu, Mar 28 2021
Formula
a(p) = p+1 for prime p > 2. - Michel Marcus, Mar 13 2017
Extensions
More terms from Robert G. Wilson v, Jan 13 2006
Comments