[go: nahoru, domu]

login
A113484
a(n) = smallest composite integer > n and coprime to n.
2
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,1
LINKS
FORMULA
a(p) = p+1 for prime p > 2. - Michel Marcus, Mar 13 2017
MATHEMATICA
f[n_] := Block[{k = n + 1}, While[PrimeQ@k || GCD[k, n] > 1, k++ ]; k]; Array[f, 72] (* Robert G. Wilson v *)
PROG
(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
CROSSREFS
Cf. A113496.
Sequence in context: A284018 A089090 A204919 * A061767 A131016 A204996
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 11 2006
EXTENSIONS
More terms from Robert G. Wilson v, Jan 13 2006
STATUS
approved