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!)
A062096 a(1) = 2; for n > 1, a(n) is smallest number, greater than a(n-1), which is relatively prime to the sum of all previous terms. 0

%I #11 Aug 11 2017 03:43:16

%S 2,3,4,5,9,10,13,15,16,17,19,20,22,23,25,26,27,29,31,33,34,35,37,38,

%T 39,41,43,45,46,47,49,50,51,53,56,57,59,60,61,63,64,65,67,68,69,71,72,

%U 73,75,76,79,81,83,85,86,88,89,95,96,97,101,102,103,107,108,109,113,114

%N a(1) = 2; for n > 1, a(n) is smallest number, greater than a(n-1), which is relatively prime to the sum of all previous terms.

%e After 5 the next term is 9 as 2 + 3 + 4 + 5 = 14 and 6, 7 and 8 have common divisors with 14.

%p a[1]:=2: for m from 2 to 80 do b:=proc(n) if gcd(sum(a[j],j=1..m-1),n)=1 then n else fi end: M:=[seq(b(n),n=a[m-1]+1..200)]: a[m]:=M[1] od:seq(a[n],n=1..80); # _Emeric Deutsch_, Jul 18 2005

%o (PARI) first(n) = my(v = vector(n), s, t); s = v[1] = 2; for(i = 2, n, t=v[i-1]+1; while(gcd(t, s)!=1, t++); v[i]=t; s+=v[i])); v \\ _David A. Corneth_, Aug 11 2017

%K nonn,easy

%O 1,1

%A _Amarnath Murthy_, Jun 19 2001

%E Corrected and extended by _Emeric Deutsch_, Jul 18 2005

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 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)