login
A139557
a(1)=2. For n>=2, a(n) = smallest integer > a(n-1) that is not coprime to n but is coprime to (n+1).
2
2, 4, 9, 12, 25, 26, 35, 38, 39, 40, 55, 56, 65, 68, 69, 70, 85, 86, 133, 134, 135, 136, 161, 162, 165, 166, 171, 172, 203, 204, 217, 218, 219, 221, 235, 236, 259, 262, 267, 268, 451, 452, 559, 562, 565, 566, 611, 612, 623, 625, 627, 628, 689, 692, 695, 698, 699
OFFSET
1,1
COMMENTS
a(10^k): 2, 40, 1264, 36892, 1067320, 34896904, 1108981540, ... and a(2^k): 2, 4, 12, 38, 70, 218, 796, 2162, 4286, 11714, 37782, 120362, 298796, 843674, 2571822, 6451768, 19197744, 50986622, 143390054, 439876796, 1183838920, ..., . - Robert G. Wilson v
Least term k such that there are just n consecutive terms: 2, 25, 38, 133, 1172, 25141, 19378160, 768173, 196130, 1929805, 15078410, 7017361, ???, 66719843, ..., . - Robert G. Wilson v
MAPLE
A139557 := proc(n) option remember ; local a, i; if n = 1 then RETURN(2) ; fi ; for a from A139557(n-1)+1 do if gcd(a, n+1) = 1 and gcd(a, n) <> 1 then RETURN(a) ; fi ; od: a ; end: seq(A139557(n), n=1..100) ; # R. J. Mathar, May 20 2008
MATHEMATICA
f[1] = 2; f[n_] := f[n] = Block[{k = f[n - 1] + 1}, While[ GCD[n, k] == 1 || GCD[n + 1, k] > 1, k++ ]; k]; Array[f, 57] (* Robert G. Wilson v *)
CROSSREFS
Cf. A139558.
Sequence in context: A154891 A282456 A176472 * A103690 A098009 A129376
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 27 2008
EXTENSIONS
More terms from R. J. Mathar and Robert G. Wilson v, May 20 2008
STATUS
approved