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!)
A135268 a(0) = 1; a(n) = a(n-1) + n - gcd(n,a(n-1)). 1

%I #13 Jun 19 2018 12:10:38

%S 1,1,2,4,4,8,12,18,24,30,30,40,48,60,72,84,96,112,128,146,164,184,204,

%T 226,248,272,296,322,336,364,392,422,452,484,516,550,584,620,656,694,

%U 732,772,812,854,896,940,984,1030,1076,1124,1172

%N a(0) = 1; a(n) = a(n-1) + n - gcd(n,a(n-1)).

%H G. C. Greubel, <a href="/A135268/b135268.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) = c*n*(n-1), where c ~ 0.48....

%e a(8) = 18 + 8 - gcd(8,18) = 18 +8 -2 = 24.

%p a[0]:=1: for n to 50 do a[n]:=a[n-1]+n-gcd(n,a[n-1]) end do: seq(a[n],n=0.. 50); # _Emeric Deutsch_, Feb 28 2008

%t RecurrenceTable[{a[n] == a[n - 1] + n - GCD[n, a[n - 1]], a[0] == 1}, a, {n, 0, 25}] (* _G. C. Greubel_, Oct 08 2016 *)

%t nxt[{n_,a_}]:={n+1,a+n+1-GCD[n+1,a]}; NestList[nxt,{0,1},50][[All,2]] (* _Harvey P. Dale_, Jun 19 2018 *)

%o (PARI) first(n)=my(v=vector(n)); v[1]=1; for(k=2,n,v[k]=v[k-1]+k-gcd(k,v[k-1])); concat(1,v) \\ _Charles R Greathouse IV_, Oct 08 2016

%K easy,nonn

%O 0,3

%A _Ctibor O. Zizka_, Feb 15 2008, Feb 21 2008

%E Corrected and extended by _Emeric Deutsch_, Feb 28 2008

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 18 11:17 EDT 2024. Contains 371779 sequences. (Running on oeis4.)