A098666 Triangle read by rows, 1<=k<=n: the n-th row contains the first n numbers after pairwise reducing all common divisors from left to right.
1, 1, 2, 1, 2, 3, 1, 1, 3, 2, 1, 1, 3, 2, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 5, 1, 7, 1, 1, 1, 1, 5, 1, 7, 8, 1, 1, 1, 1, 5, 1, 7, 8, 9, 1, 1, 1, 1, 1, 1, 7, 4, 9, 1, 1, 1, 1, 1, 1, 1, 7, 4, 9, 1, 11, 1, 1, 1, 1, 1, 1, 7, 1, 3, 1, 11, 1, 1, 1, 1, 1, 1, 1, 7, 1, 3, 1, 11, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 11, 1, 13, 2
Offset: 1
Programs
-
Mathematica
T[n_, n_] := X[n, n-1]; T[n_, k_] := T[n, k] = T[n-1, k]/GCD[T[n-1, k], X[n, k-1]]; X[n_, 0] := n; X[n_, k_] := X[n, k] = X[n, k-1]/GCD[T[n-1, k], X[n, k-1]]; Table[T[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 20 2021 *)
Formula
T(n, n)=X(n, n-1) and T(n, k)=T(n-1, k)/GCD(T(n-1, k), X(n, k-1)), where X(n, 0)=n and X(n, k)=X(n, k-1)/GCD(T(n-1, k), X(n, k-1)) for 1<=k
A249831
A(n,n) = 1, A(n,k) = A(n,k+1)*k / gcd(A(n,k+1),k)^2 if n>k, A(n,k) = A(n,k-1)*k / gcd(A(n,k-1),k)^2 if n=1, k>=1, read by antidiagonals.
1, 2, 1, 6, 1, 2, 6, 3, 2, 6, 30, 12, 1, 6, 6, 5, 60, 4, 3, 6, 30, 35, 10, 20, 1, 12, 30, 5, 280, 70, 30, 5, 4, 60, 5, 35, 2520, 140, 210, 30, 1, 20, 10, 35, 70, 252, 1260, 420, 210, 6, 5, 30, 70, 70, 70, 2772, 126, 420, 420, 42, 1, 30, 210, 35, 70, 7
Offset: 1
Examples
Square array A(n,k) begins: : 1, 2, 6, 6, 30, 5, 35, 280, 2520, 252, ... : 1, 1, 3, 12, 60, 10, 70, 140, 1260, 126, ... : 2, 2, 1, 4, 20, 30, 210, 420, 420, 42, ... : 6, 6, 3, 1, 5, 30, 210, 420, 420, 42, ... : 6, 6, 12, 4, 1, 6, 42, 84, 84, 210, ... : 30, 30, 60, 20, 5, 1, 7, 56, 504, 1260, ... : 5, 5, 10, 30, 30, 6, 1, 8, 72, 180, ... : 35, 35, 70, 210, 210, 42, 7, 1, 9, 90, ... : 70, 70, 35, 105, 420, 84, 56, 8, 1, 10, ... : 70, 70, 35, 105, 420, 84, 504, 72, 9, 1, ...
Links
- Alois P. Heinz, Antidiagonals n = 1..141, flattened
Crossrefs
Programs
-
Maple
A:= proc(n, k) option remember; `if`(k=n, 1, (r-> r*k/igcd(r, k)^2)(A(n, k+`if`(n>k, 1, -1)))) end: seq(seq(A(n, 1+d-n), n=1..d), d=1..14);
-
Mathematica
A[n_, k_] := A[n, k] = If[k == n, 1, Function[{r}, r*k/GCD[r, k]^2][A[n, k+If[n>k, 1, -1]]]]; Table[Table[A[n, 1+d-n], {n, 1, d}], {d, 1, 14}] // Flatten (* Jean-François Alcover, Dec 02 2014, translated from Maple *)
A077139 a(1) = 1, a(n) = lcm(n, a(n-1)) / gcd(n, a(n-1)).
1, 2, 6, 6, 30, 5, 35, 280, 2520, 252, 2772, 231, 3003, 858, 1430, 5720, 97240, 437580, 8314020, 415701, 969969, 176358, 4056234, 2704156, 67603900, 2600150, 70204050, 10029150, 290845350, 9694845, 300540195, 9617286240, 35263382880, 1037158320
Offset: 1
Keywords
Examples
a(5) = 30 because given a(4) = 6: lcm(5, 6) / gcd(5, 6) = 30 / 1 = 30.
Crossrefs
Essentially a duplicate of A008339, which is the main entry for this sequence.
Programs
-
Mathematica
k = 1; Print[k]; Do[k = LCM[n, k] / GCD[n, k]; Print[k], {n, 2, 30}] (* Ryan Propper, Jun 19 2005 *) nxt[{n_,a_}]:={n+1,LCM[n+1,a]/GCD[n+1,a]}; Transpose[NestList[nxt,{1,1},40]] [[2]] (* Harvey P. Dale, Mar 07 2013 *)
Extensions
Corrected and extended by Ryan Propper, Jun 19 2005
A309705 a(n) = lcm(a(n-1), n) - gcd(a(n-1), n) where a(1) = 1.
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
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.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..500
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.
Comments