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-3 of 3 results.

A129647 Largest order of a permutation of n elements with exactly 2 cycles. Also the largest LCM of a 2-partition of n.

Original entry on oeis.org

0, 1, 2, 3, 6, 5, 12, 15, 20, 21, 30, 35, 42, 45, 56, 63, 72, 77, 90, 99, 110, 117, 132, 143, 156, 165, 182, 195, 210, 221, 240, 255, 272, 285, 306, 323, 342, 357, 380, 399, 420, 437, 462, 483, 506, 525, 552, 575, 600, 621, 650, 675, 702, 725, 756, 783, 812, 837
Offset: 1

Views

Author

Nickolas Reynolds (nickels(AT)gmail.com), Apr 25 2007

Keywords

Comments

a(n) is asymptotic to (n^2)/4.
a(n) = A116921(n)*A116922(n). - Mamuka Jibladze, Aug 22 2019

Examples

			a(26) = 165 because 26 = 11+15 and lcm(11,15) = 165 is maximal.
		

Crossrefs

Maximal LCM of k positive integers with sum n for k = 2..7: this sequence (k=2), A129648 (k=3), A129649 (k=4), A129650 (k=5), A355367 (k=6), A355403 (k=7).

Programs

  • Maple
    a:= n-> `if`(n<2, 0, max(seq(ilcm(i, n-i), i=1..n/2))):
    seq(a(n), n=1..60);  # Alois P. Heinz, Feb 16 2013
  • Mathematica
    Join[{0}, Rest[With[{n = 60}, Max[LCM @@@ IntegerPartitions[#, {2}]] & /@ Range[1, n]]]] (* Modified by Philip Turecek, Mar 25 2023 *)
    a[n_] := If[n<2, 0, Max[Table[LCM[i, n-i], {i, 1, n/2}]]]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Jul 15 2015, after Alois P. Heinz *)

Formula

G.f.: t^2*(1 + 2*t^3 - 5*t^4 + 8*t^5 - 4*t^6)/((1-t)^2*(1-t^4)). - Mamuka Jibladze, Aug 22 2019

A116922 a(n) = smallest integer >= n/2 which is coprime to n.

Original entry on oeis.org

1, 1, 2, 3, 3, 5, 4, 5, 5, 7, 6, 7, 7, 9, 8, 9, 9, 11, 10, 11, 11, 13, 12, 13, 13, 15, 14, 15, 15, 17, 16, 17, 17, 19, 18, 19, 19, 21, 20, 21, 21, 23, 22, 23, 23, 25, 24, 25, 25, 27, 26, 27, 27, 29, 28, 29, 29, 31, 30, 31, 31, 33, 32, 33, 33, 35, 34, 35, 35, 37, 36, 37, 37, 39, 38
Offset: 1

Views

Author

Leroy Quet, Feb 26 2006

Keywords

Comments

A116921(n) + a(n) = n.
For n>= 3, a(n) - A116921(n) is 1 if n is odd, is 2 if n is a multiple of 4 and is 4 if n is congruent to 2 (mod 4).

Crossrefs

Cf. A116921.

Programs

  • Mathematica
    cp[n_]:=Module[{k=Ceiling[n/2]},While[!CoprimeQ[n,k],k++];k]; Array[cp,80] (* Harvey P. Dale, Nov 06 2013 *)
  • PARI
    a(n) = {if(n%2, (n+1)/2, if(n==2, 1, n/2 + if(n%4, 2, 1)))} \\ Andrew Howroyd, Aug 22 2019
    
  • Python
    def A116922(n): return n+1>>1 if n&1 or n==2 else (n>>1)+(2 if n&2 else 1) # Chai Wah Wu, Jul 31 2024

Formula

For n >= 3, a(n) = (n+1)/2 if n is odd, a(n) = n/2 + 1 if n is a multiple of 4 and a(n) = n/2 + 2 if n is congruent to 2 (mod 4).
G.f.: t*(1 + t^2 + t^3 - t^4 + 2*t^5 - 2*t^6)/((1-t)*(1-t^4)). - Mamuka Jibladze, Aug 22 2019

Extensions

More terms from Wyatt Lloyd (wal118(AT)psu.edu), Mar 25 2006

A173989 a(n) is the 2-adic valuation of A173300(n).

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 3, 3, 4, 3, 5, 5, 6, 5, 7, 7, 8, 7, 9, 9, 10, 9, 11, 11, 12, 11, 13, 13, 14, 13, 15, 15, 16, 15, 17, 17, 18, 17, 19, 19, 20, 19, 21, 21, 22, 21, 23, 23, 24, 23, 25, 25, 26, 25, 27, 27, 28, 27, 29, 29, 30, 29, 31, 31, 32, 31, 33, 33, 34, 33, 35, 35, 36, 35, 37, 37, 38, 37
Offset: 1

Views

Author

J. Lowell, Mar 04 2010

Keywords

Comments

Conjecture: always follows the pattern A, A, A+1, A, where A is an odd number.

Crossrefs

Programs

  • Maple
    From R. J. Mathar, Mar 20 2010: (Start)
    A173300 := proc(n) local x,y ; x := (1+sqrt(3))/2 ; y := (1-sqrt(3))/2 ; denom(expand(x^n+y^n)) ; end proc:
    A173989 := proc(n) log[2](A173300(n)) ; end proc: seq(A173989(n),n=3..100) ; (End)
  • Mathematica
    Log2[Denominator[Map[First, NestList[{Last[#], Last[#] + First[#]/2} &, {1, 2}, 100]]]] (* Paolo Xausa, Feb 01 2024, after Nick Hobson in A173300 *)
  • PARI
    \\ using Max Alekseyev's function in A173300
    A173300(n) = denominator(2*polcoeff( lift( Mod((1+x)/2, x^2-3)^n ), 0))
    for(k=1,74,print1(logint(A173300(k),2),", ")) \\ Hugo Pfoertner, Oct 10 2018

Formula

a(n) = log(A173300(n))/log(2).
Apparently a(n) = A102302(n) for n >= 7. - Hugo Pfoertner, Oct 10 2018
Conjectures from Colin Barker, Oct 10 2018: (Start)
G.f.: x^3*(1 + x^2 - x^3 + x^4) / ((1 - x)^2*(1 + x)*(1 + x^2)).
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 7.
(End)
Apparently a(n) = A116921(n) for n>=3. - R. J. Mathar, Aug 29 2025

Extensions

More terms from R. J. Mathar and Max Alekseyev, Mar 20 2010
Showing 1-3 of 3 results.