login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A120939 a(1)=1. a(n) = a(n-1) + (largest integer occurring among {a(1),a(2),a(3)..a(n-1)} which is coprime to n). 2
1, 2, 4, 5, 9, 14, 23, 46, 92, 115, 230, 345, 690, 1035, 1127, 2254, 4508, 5635, 11270, 12397, 12627, 25254, 25268, 37665, 62933, 100598, 201196, 264129, 528258, 591191, 1182382, 1773573, 2955955, 5911910, 7685483, 15370966, 30741932, 38427415 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

EXAMPLE

Among the terms {a(1),a(2),a(3),a(4),a(5)}, a(4) = 5 is the largest term which is coprime to 6. So a(6) = a(5) + 5 = 14.

MAPLE

A120939 := proc(nmax) local a, cpr, n, i ; a := [1, 2] ; for n from 3 to nmax do cpr := 0 ; for i from 1 to n-1 do if gcd(n, a[i]) = 1 and a[i] > cpr then cpr := a[i] ; fi ; od ; a := [op(a), a[n-1]+cpr] ; od: RETURN(a) ; end: nmax := 100 : a := A120939(nmax) : for n from 1 to nops(a) do printf("%d, ", a[n]) ; od ; - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Aug 17 2006

PROG

(PARI) {m=38; print1(a=1, ", "); v=[a]; for(n=2, m, a=0; for(j=1, n-1, if(gcd(v[j], n)==1&&a<v[j], a=v[j])); print1(a=a+v[n-1], ", "); v=concat(v, a))} - (Klaus Brockhaus, Aug 16 2006)

CROSSREFS

Cf. A120938.

Sequence in context: A073153 A073154 A077882 * A120770 A073151 A067298

Adjacent sequences:  A120936 A120937 A120938 * A120940 A120941 A120942

KEYWORD

nonn

AUTHOR

Leroy Quet Jul 17 2006

EXTENSIONS

More terms from Klaus Brockhaus (klaus-brockhaus(AT)t-online.de), Aug 16 2006

More terms from R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Aug 17 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 16 07:39 EST 2012. Contains 205881 sequences.