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
1, 1, 2, 4, 4, 8, 12, 18, 24, 30, 30, 40, 48, 60, 72, 84, 96, 112, 128, 146, 164, 184, 204, 226, 248, 272, 296, 322, 336, 364, 392, 422, 452, 484, 516, 550, 584, 620, 656, 694, 732, 772, 812, 854, 896, 940, 984, 1030, 1076, 1124, 1172 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(n) = c*n*(n-1), where c ~ 0.48....
EXAMPLE
a(8) = 18 + 8 - gcd(8,18) = 18 +8 -2 = 24.
MAPLE
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
MATHEMATICA
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 *)
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 *)
PROG
(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
CROSSREFS
Sequence in context: A130124 A265417 A076342 * A245619 A131771 A335974
KEYWORD
easy,nonn
AUTHOR
Ctibor O. Zizka, Feb 15 2008, Feb 21 2008
EXTENSIONS
Corrected and extended by Emeric Deutsch, Feb 28 2008
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 18:00 EDT 2024. Contains 371797 sequences. (Running on oeis4.)