This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A139557 #11 Mar 20 2015 22:45:49 %S A139557 2,4,9,12,25,26,35,38,39,40,55,56,65,68,69,70,85,86,133,134,135,136, %T A139557 161,162,165,166,171,172,203,204,217,218,219,221,235,236,259,262,267, %U A139557 268,451,452,559,562,565,566,611,612,623,625,627,628,689,692,695,698,699 %N 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). %C A139557 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_ %C A139557 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_ %p A139557 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 %t A139557 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_ *) %Y A139557 Cf. A139558. %K A139557 nonn %O A139557 1,1 %A A139557 _Leroy Quet_, Apr 27 2008 %E A139557 More terms from _R. J. Mathar_ and _Robert G. Wilson v_, May 20 2008