cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A129091 a(0)=1; a(n) = gcd(a(n-1), n) + lcm(a(n-1), n).

Original entry on oeis.org

1, 2, 4, 13, 53, 266, 800, 5601, 44809, 403282, 2016412, 22180533, 88722135, 1153387756, 8073714294, 40368571473, 645897143569, 10980251440674, 32940754322028, 625874332118533, 12517486642370661, 12517486642370682
Offset: 0

Views

Author

Leroy Quet, Mar 29 2007

Keywords

Crossrefs

Cf. A129090.

Programs

  • Maple
    a[0]:=1: for n from 1 to 25 do a[n]:=gcd(a[n-1],n)+lcm(a[n-1],n) od: seq(a[n],n=0..25); # Emeric Deutsch, Apr 02 2007

Extensions

More terms from Emeric Deutsch, Apr 02 2007

A309705 a(n) = lcm(a(n-1), n) - gcd(a(n-1), n) where a(1) = 1.

Original entry on oeis.org

1, 1, 2, 2, 9, 15, 104, 96, 285, 565, 6214, 37282, 484665, 6785309, 101779634, 814237070, 13842030189, 83052181131, 1577991441488, 7889957207436, 55229700452049, 1215053409945077, 27946228428736770, 111784913714947074, 2794622842873676849, 72660193914715598073
Offset: 1

Views

Author

Atticus Cull, Aug 13 2019

Keywords

Comments

The sequence seems to grow between exponentially and factorially but that's just a suspicion.

Examples

			For n = 5, since a(4) = 2, a(5) = lcm(5,2) - gcd(5,2) = 10 - 1 = 9.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 1,
          ilcm(a(n-1), n)-igcd(a(n-1), n))
        end:
    seq(a(n), n=1..29);  # Alois P. Heinz, Sep 17 2019
  • Mathematica
    a[1] = 1; a[n_] := a[n] = LCM[a[n - 1], n] - GCD[a[n - 1], n]; Array[a, 26] (* Amiram Eldar, Sep 17 2019 *)
    nxt[{n_,a_}]:={n+1,LCM[a,n+1]-GCD[a,n+1]}; NestList[nxt,{1,1},30][[All,2]] (* Harvey P. Dale, Apr 05 2020 *)
  • PARI
    seq(n)={my(v=vector(n)); v[1]=1; for(n=2, #v, v[n] = lcm(v[n-1], n) - gcd(v[n-1], n)); v} \\ Andrew Howroyd, Aug 28 2019
  • Python
    def lcmMinusGcd(n):
        retlist = [1]
        for i in range(1, n):
            g = gcd(retlist[i-1], i+1)
            retlist.append( floor(retlist[i-1]*(i+1) / g) - g)
        return ', '.join(map(str,retlist))
    

Formula

a(n) = lcm(a(n-1), n) - gcd(a(n-1), n) for n > 1.
Showing 1-2 of 2 results.