login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A118002 a(0) = 0. a(n) = a(n-1) + (largest integer <= n which is coprime to a(n-1)). 3
0, 1, 3, 5, 9, 14, 19, 26, 33, 41, 51, 62, 73, 86, 99, 113, 129, 146, 163, 182, 201, 221, 243, 266, 289, 314, 339, 365, 393, 422, 451, 482, 513, 545, 579, 614, 649, 686, 723, 761, 801, 842, 883, 926, 969, 1013, 1059, 1106, 1153, 1202, 1251, 1301, 1353, 1406 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
EXAMPLE
a(7) = 26. 8 is not coprime to 26. The smallest integer <= 8 which is coprime to 26 is 7 and so a(8) = a(7) + 7 = 33.
MAPLE
A118002 := 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: A118002(100) ; # R. J. Mathar, Jun 06 2007
MATHEMATICA
FoldList[Block[{k = 0}, While[! CoprimeQ[#1, #2 - k], k++]; #1 + #2 - k] &, 0, Range@ 53] (* Michael De Vlieger, Sep 30 2017 *)
nxt[{n_, a_}]:={n+1, a+SelectFirst[Range[n, 1, -1], CoprimeQ[#, a]&]}; Join[ {0, 1}, NestList[nxt, {3, 3}, 60][[All, 2]]] (* Harvey P. Dale, Jan 21 2019 *)
CROSSREFS
Sequence in context: A082874 A266250 A127720 * A069533 A054066 A081946
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 09 2006
EXTENSIONS
More terms from R. J. Mathar, Jun 06 2007
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 16:08 EDT 2024. Contains 371794 sequences. (Running on oeis4.)