login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A118001
a(n) = smallest integer >= n which is coprime to A118000(n-1). a(n) = A118000(n) - A118000(n-1).
2
1, 2, 4, 4, 5, 7, 7, 11, 9, 11, 11, 13, 13, 15, 15, 17, 17, 19, 19, 21, 21, 23, 23, 25, 25, 27, 27, 29, 29, 31, 31, 33, 33, 35, 35, 37, 37, 39, 39, 41, 41, 43, 43, 45, 45, 47, 47, 49, 49, 51, 51, 53, 53, 55, 55, 57, 57, 59, 59, 61, 61, 63, 63, 65, 65, 67, 67, 69, 69, 71, 71, 73
OFFSET
1,2
MAPLE
A118000 := proc(nmax) local a, n ; a := [0] ; while nops(a) < nmax do n := nops(a) ; while gcd(n, op(-1, a)) <> 1 do n := n+1 ; od ; a := [op(a), op(-1, a)+n] ; od ; RETURN(a) ; end: a118000 := A118000(100) : for n from 1 to nops(a118000)-1 do printf("%d, ", op(n+1, a118000)- op(n, a118000)) ; od ; # R. J. Mathar, Jun 06 2007
MATHEMATICA
A118000[n_] := A118000[n] = If[n == 0, 0, Module[{a1 = A118000[n-1], k}, For[k = n, True, k++, If[CoprimeQ[a1, k], Return[a1+k]]]]];
a[n_] := A118000[n] - A118000[n-1];
Table[a[n], {n, 1, 72}] (* Jean-François Alcover, Apr 08 2024 *)
CROSSREFS
Sequence in context: A058568 A339769 A147534 * A182414 A256984 A111138
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 09 2006
EXTENSIONS
Corrected and extended by R. J. Mathar, Jun 06 2007
STATUS
approved