OFFSET
2,1
FORMULA
If p is a prime, a(p) = p*(p+2).
a(n) >= A299143(n). - Michel Marcus, Mar 26 2018
EXAMPLE
From Michael De Vlieger, Apr 21 2018: (Start)
a(1) is not defined since 1 is coprime to all numbers.
a(2) = 8 since gcd(2,8) = 2 and gcd(3,9) = 3. Of numbers 3 <= m < 8, gcd(2,m) > 1 for m even, but gcd(3,m+1) = 1.
a(3) = 15 since gcd(3,15) = 3 and gcd(4,16) = 4. Of numbers 4 <= m < 15, gcd(3,m) > 1 for 3 | m, but gcd(4,m+1) = 1. (End)
MATHEMATICA
Array[Block[{k = # + 1}, While[Not[GCD[k + 1, # + 1] > GCD[k, #] > 1], k++]; k] &, 60, 2] (* Michael De Vlieger, Apr 21 2018 *)
PROG
(PARI) a(n) = {my(k = n+1); while((gcd(k, n) == 1) || (gcd(k+1, n+1) <= gcd(k, n)), k++); k; } \\ Michel Marcus, Mar 26 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Mar 24 2018
STATUS
approved