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-10 of 13 results. Next

A128247 a(n) = A001783(n)/A038610(n).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 12, 1, 8, 3, 1440, 1, 17280, 3, 112, 45, 29030400, 1, 522547200, 3, 12800, 945, 4828336128000, 1, 38626689024, 4725, 512512000, 2025, 3796230997278720000, 1, 113886929918361600000, 42525, 10436608000, 1403325, 551910745571328, 175
Offset: 1

Views

Author

Leroy Quet, May 03 2007

Keywords

Examples

			The positive integers which are <= 10 and are coprime to 10 are 1,3,7,9. So a(10) = 1*3*7*9/lcm(1,3,7,9) = 189/63 = 3.
		

Crossrefs

Programs

  • Mathematica
    Table[s = Select[Range[1, n], GCD[#, n] == 1 &]; (Times @@ s)/(LCM @@ s), {n, 30}] (* T. D. Noe, Oct 04 2012 *)
  • Sage
    def Gauss_factorial(N, n): return mul(j for j in (1..N) if gcd(j, n) == 1)
    def L(N, n): return lcm([j for j in (1..N) if gcd(j, n) == 1])
    def A128247(n): return Gauss_factorial(n, n)/L(n, n)
    [A128247(n) for n in (1..34)] # Peter Luschny, Oct 02 2012

Extensions

More terms from Sean A. Irvine, Jun 21 2011

A255979 a(n) = smallest nonnegative integer solution z to the system of congruences: z == 0 (mod n), z == 1 (mod A038610(n)) if n is in A033948; or z == 0 (mod n), z == -1 (mod A038610(n)) if n is in A033949.

Original entry on oeis.org

0, 0, 1, 1, 5, 1, 43, 13, 249, 19, 2291, 32, 6397, 1379, 3737, 36599, 423953, 4727, 2579419, 436486, 1935539, 1262563, 30364247, 1549256, 1028011945, 94055426, 2754232963, 230491358, 77544004469, 7188548, 1277242663471, 4089553744057, 235736847903
Offset: 1

Views

Author

Bruno Berselli, Mar 12 2015 - proposed by Umberto Cerruti (Department of Mathematics "Giuseppe Peano", University of Turin, Italy)

Keywords

Crossrefs

Programs

  • Mathematica
    v[n_] := Module[{s}, s = Select[Range[n], CoprimeQ[n, #] == True &]; LCM @@ s]; g1[n_] := If[n == 1, 0, If[IntegerQ[PrimitiveRoot[n]], PowerMod[n, -1, v[n]], PowerMod[-n, -1, v[n]]]]; Table[g1[k], {k, 1, 40}]

A137450 A038610(n) (the LCM of the positive integers that are <= n and are coprime to n) is the a(n)-th positive integer that is coprime to n.

Original entry on oeis.org

1, 1, 2, 2, 10, 2, 52, 53, 187, 26, 2291, 129, 25588, 2758, 4271, 22523, 678325, 28362, 11607386, 1163963, 2111498, 601221, 222671145, 12394049, 856676621, 59403427, 1983047734, 307321811, 77544004469, 57508385
Offset: 1

Views

Author

Leroy Quet, Apr 18 2008

Keywords

Examples

			The positive integers that are <= 10 and are coprime to 10 are 1,3,7,9; lcm(1,3,7,9) = 63. Now the positive integers that are coprime to 10 form a sequence that begins: 1, 3, 7, 9, 11, 13, 17, 19, 21, 23, 27, 29, 31, 33, 37, 39, 41, 43, 47, 49, 51, 53, 57, 59, 61, 63, 67, 69, ...
Since 63 is the 26th of these integers, a(10) = 26.
		

Crossrefs

Cf. A038610.

Extensions

More terms from Sean A. Irvine, Nov 15 2009

A003418 Least common multiple (or LCM) of {1, 2, ..., n} for n >= 1, a(0) = 1.

Original entry on oeis.org

1, 1, 2, 6, 12, 60, 60, 420, 840, 2520, 2520, 27720, 27720, 360360, 360360, 360360, 720720, 12252240, 12252240, 232792560, 232792560, 232792560, 232792560, 5354228880, 5354228880, 26771144400, 26771144400, 80313433200, 80313433200, 2329089562800, 2329089562800
Offset: 0

Views

Author

Roland Anderson (roland.anderson(AT)swipnet.se)

Keywords

Comments

The minimal exponent of the symmetric group S_n, i.e., the least positive integer for which x^a(n)=1 for all x in S_n. - Franz Vrabec, Dec 28 2008
Product over all primes of highest power of prime less than or equal to n. a(0) = 1 by convention.
Also smallest number whose set of divisors contains an n-term arithmetic progression. - Reinhard Zumkeller, Dec 09 2002
An assertion equivalent to the Riemann hypothesis is: | log(a(n)) - n | < sqrt(n) * log(n)^2. - Lekraj Beedassy, Aug 27 2006. (This is wrong for n = 1 and n = 2. Should "for n large enough" be added? - Georgi Guninski, Oct 22 2011)
Corollary 3 of Farhi gives a proof that a(n) >= 2^(n-1). - Jonathan Vos Post, Jun 15 2009
Appears to be row products of the triangle T(n,k) = b(A010766) where b = A130087/A130086. - Mats Granvik, Jul 08 2009
Greg Martin (see link) proved that "the product of the Gamma function sampled over the set of all rational numbers in the open interval (0,1) whose denominator in lowest terms is at most n" equals (2*Pi)^(1/2)*a(n)^(-1/2). - Jonathan Vos Post, Jul 28 2009
a(n) = lcm(A188666(n), A188666(n)+1, ..., n). - Reinhard Zumkeller, Apr 25 2011
a(n+1) is the smallest integer such that all polynomials a(n+1)*(1^i + 2^i + ... + m^i) in m, for i=0,1,...,n, are polynomials with integer coefficients. - Vladimir Shevelev, Dec 23 2011
It appears that A020500(n) = a(n)/a(n-1). - Asher Auel, corrected by Bill McEachen, Apr 05 2024
n-th distinct value = A051451(n). - Matthew Vandermast, Nov 27 2009
a(n+1) = least common multiple of n-th row in A213999. - Reinhard Zumkeller, Jul 03 2012
For n > 2, (n-1) = Sum_{k=2..n} exp(a(n)*2*i*Pi/k). - Eric Desbiaux, Sep 13 2012
First column minus second column of A027446. - Eric Desbiaux, Mar 29 2013
For n > 0, a(n) is the smallest number k such that n is the n-th divisor of k. - Michel Lagneau, Apr 24 2014
Slowest growing integer > 0 in Z converging to 0 in Z^ when considered as profinite integer. - Herbert Eberle, May 01 2016
What is the largest number of consecutive terms that are all equal? I found 112 equal terms from a(370261) to a(370372). - Dmitry Kamenetsky, May 05 2019
Answer: there exist arbitrarily long sequences of consecutive terms with the same value; also, the maximal run of consecutive terms with different values is 5 from a(1) to a(5) (see link Roger B. Eggleton). - Bernard Schott, Aug 07 2019
Related to the inequality (54) in Ramanujan's paper about highly composite numbers A002182, also used in A199337: a(A329570(m))^2 is a (not minimal) bound above which all highly composite numbers are divisible by m, according to the right part of that inequality. - M. F. Hasler, Jan 04 2020
For n > 2, a(n) is of the form 2^e_1 * p_2^e_2 * ... * p_m^e_m, where e_m = 1 and e = floor(log_2(p_m)) <= e_1. Therefore, 2^e * p_m^e_m is a primitive Zumkeler number (A180332). Therefore, 2^e_1 * p_m^e_m is a Zumkeller number (A083207). Therefore, for n > 2, a(n) = 2^e_1 * p_m^e_m * r, where r is relatively prime to 2*p_m, is a Zumkeller number (see my proof at A002182 for details). - Ivan N. Ianakiev, May 10 2020
For n > 1, 2|(a(n)+2) ... n|(a(n)+n), so a(n)+2 .. a(n)+n are all composite and (part of) a prime gap of at least n. (Compare n!+2 .. n!+n). - Stephen E. Witham, Oct 09 2021

Examples

			LCM of {1,2,3,4,5,6} = 60. The primes up to 6 are 2, 3 and 5. floor(log(6)/log(2)) = 2 so the exponent of 2 is 2.
floor(log(6)/log(3)) = 1 so the exponent of 3 is 1.
floor(log(6)/log(5)) = 1 so the exponent of 5 is 1. Therefore, a(6) = 2^2 * 3^1 * 5^1 = 60. - _David A. Corneth_, Jun 02 2017
		

References

  • J. M. Borwein and P. B. Borwein, Pi and the AGM, Wiley, 1987, p. 365.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row products of A133233.
Cf. A025528 (number of prime factors of a(n) with multiplicity).
Cf. A275120 (lengths of runs of consecutive equal terms), A276781 (ordinal transform from term a(1)=1 onward).

Programs

  • Haskell
    a003418 = foldl lcm 1 . enumFromTo 2
    -- Reinhard Zumkeller, Apr 04 2012, Apr 25 2011
    
  • Magma
    [1] cat [Exponent(SymmetricGroup(n)) : n in [1..28]]; // Arkadiusz Wesolowski, Sep 10 2013
    
  • Magma
    [Lcm([1..n]): n in [0..30]]; // Bruno Berselli, Feb 06 2015
    
  • Maple
    A003418 := n-> lcm(seq(i,i=1..n));
    HalfFarey := proc(n) local a,b,c,d,k,s; a := 0; b := 1; c := 1; d := n; s := NULL; do k := iquo(n + b, d); a, b, c, d := c, d, k*c - a, k*d - b; if 2*a > b then break fi; s := s,(a/b); od: [s] end: LCM := proc(n) local i; (1/2)*mul(2*sin(Pi*i),i=HalfFarey(n))^2 end: # Peter Luschny
    # next Maple program:
    a:= proc(n) option remember; `if`(n=0, 1, ilcm(n, a(n-1))) end:
    seq(a(n), n=0..33);  # Alois P. Heinz, Jun 10 2021
  • Mathematica
    Table[LCM @@ Range[n], {n, 1, 40}] (* Stefan Steinerberger, Apr 01 2006 *)
    FoldList[ LCM, 1, Range@ 28]
    A003418[0] := 1; A003418[1] := 1; A003418[n_] := A003418[n] = LCM[n,A003418[n-1]]; (* Enrique Pérez Herrero, Jan 08 2011 *)
    Table[Product[Prime[i]^Floor[Log[Prime[i], n]], {i, PrimePi[n]}], {n, 0, 28}] (* Wei Zhou, Jun 25 2011 *)
    Table[Product[Cyclotomic[n, 1], {n, 2, m}], {m, 0, 28}] (* Fred Daniel Kline, May 22 2014 *)
    a1[n_] := 1/12 (Pi^2+3(-1)^n (PolyGamma[1,1+n/2] - PolyGamma[1,(1+n)/2])) // Simplify
    a[n_] := Denominator[Sqrt[a1[n]]];
    Table[If[IntegerQ[a[n]], a[n], a[n]*(a[n])[[2]]], {n, 0, 28}] (* Gerry Martens, Apr 07 2018 [Corrected by Vaclav Kotesovec, Jul 16 2021] *)
  • PARI
    a(n)=local(t); t=n>=0; forprime(p=2,n,t*=p^(log(n)\log(p))); t
    
  • PARI
    a(n)=if(n<1,n==0,1/content(vector(n,k,1/k)))
    
  • PARI
    a(n)=my(v=primes(primepi(n)),k=sqrtint(n),L=log(n+.5));prod(i=1,#v,if(v[i]>k,v[i],v[i]^(L\log(v[i])))) \\ Charles R Greathouse IV, Dec 21 2011
    
  • PARI
    a(n)=lcm(vector(n,i,i)) \\ Bill Allombert, Apr 18 2012 [via Charles R Greathouse IV]
    
  • PARI
    n=1; lim=100; i=1; j=1; until(n==lim, a=lcm(j,i+1); i++; j=a; n++; print(n" "a);); \\ Mike Winkler, Sep 07 2013
    
  • Python
    from functools import reduce
    from operator import mul
    from sympy import sieve
    def integerlog(n,b): # find largest integer k>=0 such that b^k <= n
        kmin, kmax = 0,1
        while b**kmax <= n:
            kmax *= 2
        while True:
            kmid = (kmax+kmin)//2
            if b**kmid > n:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmin
    def A003418(n):
        return reduce(mul,(p**integerlog(n,p) for p in sieve.primerange(1,n+1)),1) # Chai Wah Wu, Mar 13 2021
    
  • Python
    # generates initial segment of sequence
    from math import gcd
    from itertools import accumulate
    def lcm(a, b): return a * b // gcd(a, b)
    def aupton(nn): return [1] + list(accumulate(range(1, nn+1), lcm))
    print(aupton(30)) # Michael S. Branicky, Jun 10 2021
  • Sage
    [lcm(range(1,n)) for n in range(1, 30)] # Zerinvary Lajos, Jun 06 2009
    
  • Scheme
    (define (A003418 n) (let loop ((n n) (m 1)) (if (zero? n) m (loop (- n 1) (lcm m n))))) ;; Antti Karttunen, Jan 03 2018
    

Formula

The prime number theorem implies that lcm(1,2,...,n) = exp(n(1+o(1))) as n -> infinity. In other words, log(lcm(1,2,...,n))/n -> 1 as n -> infinity. - Jonathan Sondow, Jan 17 2005
a(n) = Product (p^(floor(log n/log p))), where p runs through primes not exceeding n (i.e., primes 2 through A007917(n)). - Lekraj Beedassy, Jul 27 2004
Greg Martin showed that a(n) = lcm(1,2,3,...,n) = Product_{i = Farey(n), 0 < i < 1} 2*Pi/Gamma(i)^2. This can be rewritten (for n > 1) as a(n) = (1/2)*(Product_{i = Farey(n), 0 < i <= 1/2} 2*sin(i*Pi))^2. - Peter Luschny, Aug 08 2009
Recursive formula useful for computations: a(0)=1; a(1)=1; a(n)=lcm(n,a(n-1)). - Enrique Pérez Herrero, Jan 08 2011
From Enrique Pérez Herrero, Jun 01 2011: (Start)
a(n)/a(n-1) = A014963(n).
if n is a prime power p^k then a(n)=a(p^k)=p*a(n-1), otherwise a(n)=a(n-1).
a(n) = Product_{k=2..n} (1 + (A007947(k)-1)*floor(1/A001221(k))), for n > 1. (End)
a(n) = A079542(n+1, 2) for n > 1.
a(n) = exp(Sum_{k=1..n} Sum_{d|k} moebius(d)*log(k/d)). - Peter Luschny, Sep 01 2012
a(n) = A025529(n) - A027457(n). - Eric Desbiaux, Mar 14 2013
a(n) = exp(Psi(n)) = 2 * Product_{k=2..A002088(n)} (1 - exp(2*Pi*i * A038566(k+1) / A038567(k))), where i is the imaginary unit, and Psi the second Chebyshev's function. - Eric Desbiaux, Aug 13 2014
a(n) = A064446(n)*A038610(n). - Anthony Browne, Jun 16 2016
a(n) = A000142(n) / A025527(n) = A000793(n) * A225558(n). - Antti Karttunen, Jun 02 2017
log(a(n)) = Sum_{k>=1} (A309229(n, k)/k - 1/k). - Mats Granvik, Aug 10 2019
From Petros Hadjicostas, Jul 24 2020: (Start)
Nair (1982) proved that 2^n <= a(n) <= 4^n for n >= 9. See also Farhi (2009). Nair also proved that
a(n) = lcm(m*binomial(n,m): 1 <= m <= n) and
a(n) = gcd(a(m)*binomial(n,m): n/2 <= m <= n). (End)
Sum_{n>=1} 1/a(n) = A064859. - Bernard Schott, Aug 24 2020

A038566 Numerators in canonical bijection from positive integers to positive rationals <= 1: arrange fractions by increasing denominator then by increasing numerator.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 2, 3, 4, 1, 5, 1, 2, 3, 4, 5, 6, 1, 3, 5, 7, 1, 2, 4, 5, 7, 8, 1, 3, 7, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 5, 7, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 3, 5, 9, 11, 13, 1, 2, 4, 7, 8, 11, 13, 14, 1, 3, 5, 7, 9, 11, 13, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
Offset: 1

Views

Author

Keywords

Comments

For denominators see A038567.
Row n has length A000010(n).
Also numerators in canonical bijection from positive integers to all positive rational numbers: arrange fractions in triangle in which in the n-th row the phi(n) numbers are the fractions i/j with gcd(i,j) = 1, i+j=n, i=1..n-1, j=n-1..1. n>=2. Denominators (A020653) are obtained by reversing each row.
Also triangle in which n-th row gives phi(n) numbers between 1 and n that are relatively prime to n.
A038610(n) = least common multiple of n-th row. - Reinhard Zumkeller, Sep 21 2013
Row n has sum A023896(n). - Jamie Morken, Dec 17 2019
This irregular triangle gives in row n the smallest positive reduced residue system modulo n, for n >= 1. If one takes 0 for n = 1 it becomes the smallest nonnegative residue system modulo n. - Wolfdieter Lang, Feb 29 2020

Examples

			The beginning of the list of positive rationals <= 1: 1/1, 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, .... This is A038566/A038567.
The beginning of the triangle giving all positive rationals: 1/1; 1/2, 2/1; 1/3, 3/1; 1/4, 2/3, 3/2, 4/1; 1/5, 5/1; 1/6, 2/5, 3/4, 4/3, 5/2, 6/1; .... This is A020652/A020653, with A020652(n) = A038566(n+1). [Corrected by _M. F. Hasler_, Mar 06 2020]
The beginning of the triangle in which n-th row gives numbers between 1 and n that are relatively prime to n:
n\k 1 2 3  4  5  6  7  8 9 10 11 12 13 14 15 16 17 18
1:  1
2:  1
3:  1 2
4:  1 3
5:  1 2 3  4
6:  1 5
7:  1 2 3  4  5  6
8:  1 3 5  7
9:  1 2 4  5  7  8
10: 1 3 7  9
11: 1 2 3  4  5  6  7  8 9 10
12: 1 5 7 11
13: 1 2 3  4  5  6  7  8 9 10 11 12
14: 1 3 5  9 11 13
15: 1 2 4  7  8 11 13 14
16: 1 3 5  7  9 11 13 15
17: 1 2 3  4  5  6  7  8 9 10 11 12 13 14 15 16
18: 1 5 7 11 13 17
19: 1 2 3  4  5  6  7  8 9 10 11 12 13 14 15 16 17 18
20: 1 3 7  9 11 13 17 19
... Reformatted. - _Wolfdieter Lang_, Jan 18 2017
------------------------------------------------------
		

References

  • Richard Courant and Herbert Robbins. What Is Mathematics?, Oxford, 1941, pp. 79-80.
  • H. Lauwerier, Fractals, Princeton Univ. Press, p. 23.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 163.

Crossrefs

A054424 gives mapping to Stern-Brocot tree.
Row sums give rationals A111992(n)/A069220(n), n>=1.
A112484 (primes, rows n >=3).

Programs

  • Haskell
    a038566 n k = a038566_tabf !! (n-1) !! (k-1)
    a038566_row n = a038566_tabf !! (n-1)
    a038566_tabf=
       zipWith (\v ws -> filter ((== 1) . (gcd v)) ws) [1..] a002260_tabl
    a038566_list = concat a038566_tabf
    -- Reinhard Zumkeller, Sep 21 2013, Feb 23 2012
    
  • Maple
    s := proc(n) local i,j,k,ans; i := 0; ans := [ ]; for j while i
    				
  • Mathematica
    Flatten[Table[Flatten[Position[GCD[Table[Mod[j, w], {j, 1, w-1}], w], 1]], {w, 1, 100}], 2]
    row[n_]:=Select[Range[n],GCD[n,#]==1 &]; Array[row,17]//Flatten (* Stefano Spezia, Jul 20 2025 *)
  • PARI
    first(n)=my(v=List(),i,j);while(iCharles R Greathouse IV, Feb 07 2013
    
  • PARI
    row(n) = select(x->gcd(n, x)==1, [1..n]); \\ Michel Marcus, May 05 2020
    
  • SageMath
    def aRow(n):
        if n == 1: return 1
        return [k for k in ZZ(n).coprime_integers(n+1)]
    print(flatten([aRow(n) for n in range(1, 18)])) # Peter Luschny, Aug 17 2020

Formula

The n-th "clump" consists of the phi(n) integers <= n and prime to n.
a(n) = A002260(A169581(n)). - Reinhard Zumkeller, Dec 02 2009
a(n+1) = A020652(n) for n > 1. - Georg Fischer, Oct 27 2020

Extensions

More terms from Erich Friedman
Offset corrected by Max Alekseyev, Apr 26 2010

A034699 Largest prime power factor of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 4, 13, 7, 5, 16, 17, 9, 19, 5, 7, 11, 23, 8, 25, 13, 27, 7, 29, 5, 31, 32, 11, 17, 7, 9, 37, 19, 13, 8, 41, 7, 43, 11, 9, 23, 47, 16, 49, 25, 17, 13, 53, 27, 11, 8, 19, 29, 59, 5, 61, 31, 9, 64, 13, 11, 67, 17, 23, 7, 71, 9, 73, 37, 25, 19, 11, 13, 79
Offset: 1

Views

Author

Keywords

Comments

n divides lcm(1, 2, ..., a(n)).
a(n) = A210208(n,A073093(n)) = largest term of n-th row in A210208. - Reinhard Zumkeller, Mar 18 2012
a(n) = smallest m > 0 such that n divides A003418(m). - Thomas Ordowski, Nov 15 2013
a(n) = n when n is a prime power (A000961). - Michel Marcus, Dec 03 2013
Conjecture: For all n between two consecutive prime numbers, all a(n) are different. - I. V. Serov, Jun 19 2019
Disproved with between p=prime(574) = 4177 and prime(575) = 4201, a(4180) = a(4199) = 19. See A308752. - Michel Marcus, Jun 19 2019
Conjecture: For any N > 0, there exist numbers n and m, N < n < n+a(n) <= m, such that all n..m are composite and a(n) = a(m). - I. V. Serov, Jun 21 2019
Conjecture: For all n between two consecutive prime numbers, all (-1)^n*a(n) are different. Checked up to 5*10^7. - I. V. Serov, Jun 23 2019
Disproved: between p = prime(460269635) = 10120168277 and p = prime(460269636) = 10120168507 the numbers n = 10120168284 and m = 10120168498 form a pair such that (-1)^n*a(n) = (-1)^m*a(m) = 107. - L. Joris Perrenet, Jan 05 2020
a(n) = cardinality of smallest set on which idempotence of order n+1 (f^{n+1} = f) differs from idempotence of order e for 2 <= e <= n (see von Eitzen link for proof); derivable from A245501. - Mark Bowron, May 22 2025

Crossrefs

Programs

  • Haskell
    a034699 = last . a210208_row
    -- Reinhard Zumkeller, Mar 18 2012, Feb 14 2012
    
  • Mathematica
    f[n_] := If[n == 1, 1, Max[ #[[1]]^#[[2]] & /@ FactorInteger@n]]; Array[f, 79] (* Robert G. Wilson v, Sep 02 2006 *)
    Array[Max[Power @@@ FactorInteger@ #] &, 79] (* Michael De Vlieger, Jul 26 2018 *)
  • PARI
    a(n) = if(1==n,n,my(f=factor(n)); vecmax(vector(#f[, 1], i, f[i, 1]^f[i, 2]))); \\ Charles R Greathouse IV, Nov 20 2012, check for a(1) added by Antti Karttunen, Aug 06 2018
    
  • PARI
    A034699(n) = if(1==n,n,fordiv(n, d, if(isprimepower(n/d), return(n/d)))); \\ Antti Karttunen, Aug 06 2018
    
  • Python
    from sympy import factorint
    def A034699(n): return max((p**e for p, e in factorint(n).items()), default=1) # Chai Wah Wu, Apr 17 2023

Formula

If n = p_1^e_1 *...* p_k^e_k, p_1 < ... < p_k primes, then a(n) = Max_i p_i^e_i.
a(n) = A088387(n)^A088388(n). - Antti Karttunen, Jul 22 2018
a(n) = n/A284600(n) = n - A081805(n) = A034684(n) + A100574(n). - Antti Karttunen, Aug 06 2018
a(n) = a(m) iff m = d*a(n), where d is a divisor of A038610(a(n)). - I. V. Serov, Jun 19 2019

A099795 Least common multiple of 1, 2, 3, ..., prime(n)-1.

Original entry on oeis.org

1, 2, 12, 60, 2520, 27720, 720720, 12252240, 232792560, 80313433200, 2329089562800, 144403552893600, 5342931457063200, 219060189739591200, 9419588158802421600, 3099044504245996706400, 164249358725037825439200, 9690712164777231700912800
Offset: 1

Views

Author

Ray Chandler, Oct 29 2004

Keywords

Comments

Alternative definition: a(n) = Product{i = 1..(n-1)}prime(i)^e_i, where prime(i)^e_i is the greatest power of prime(i) which does not exceed prime(n). Every term is a product of prime powers, and also of primorial powers(the greatest of which is A002110(n-1); see Example and A053589). - David James Sycamore, Oct 24 2024

Examples

			For n = 7, prime(7) = 17, using the alternative definition (see Comment), a(7) = 2^4*3^2*5^1*7^1*11^1*13^1 = 16*9*5*7*11*13 = 720720 = 24*30030 = 2^2*6*30030 = A002110(1)^2*A002110(2)*A002110(6). - _David James Sycamore_, Oct 24 2024
		

Crossrefs

Programs

  • Magma
    [Lcm([2..p-1]): p in PrimesUpTo(70)]; // Bruno Berselli, Feb 06 2015
  • Maple
    Primes:= select(isprime, [2,$3..100]):
    seq(ilcm($2..Primes[i]-1),i=1..nops(Primes)); # Robert Israel, Jul 19 2016
  • Mathematica
    LCM@@Range[#]&/@(Prime[Range[20]]-1) (* Harvey P. Dale, Jan 30 2015 *)

Formula

a(n) = (A094998(n)-1) / A099796(n).
a(n) = A038610(A000040(n)). - Anthony Browne, Jul 19 2016
Rad(a(n)) = A007947(a(n)) = A002110(n-1). - David James Sycamore, Oct 24 2024

Extensions

a(18) from Bruno Berselli, Feb 06 2015

A064446 a(n) = gcd(n!, n^n, lcm(1, 2, ..., n)), or gcd(n^n, lcm(1, 2, ..., n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 12, 7, 8, 9, 40, 11, 72, 13, 56, 45, 16, 17, 144, 19, 80, 63, 176, 23, 144, 25, 208, 27, 112, 29, 10800, 31, 32, 297, 544, 175, 864, 37, 608, 351, 800, 41, 6048, 43, 352, 675, 736, 47, 864, 49, 800, 459, 416, 53, 864, 275, 1568, 513, 928, 59, 21600, 61
Offset: 1

Views

Author

Labos Elemer, Oct 02 2001

Keywords

Comments

gcd(n^n, lcm(1..n)) must be limited to products of all the distinct prime divisors p of n. We can regard lcm(1..n) as the product of a "regular" factor r produced by primes that also divide n and a coprime factor s produced by primes that are coprime to n. Since the distinct prime divisors p of n are the only distinct prime divisors of n^n, we need only consider r and can ignore s when considering gcd(n^n, lcm(1..n)). Because r is the product of the largest power e_1 of each distinct prime divisor p, and since the power e_2 of the corresponding primes that divide n^n must always be such that e_2 >= e_1, it is sufficient to compute r to determine a(n). - Michael De Vlieger, Oct 26 2015

Examples

			n=6: a(6) = gcd(720, 60, 46656) = 12.
Since only 1 and 5 are relatively prime to 6, a(6) = lcm(1,2,3,4,5,6) / lcm(1,5) = 60/5 = 12.
		

Crossrefs

Cf. A000142, A000312, A051696. Equals A003418(n)/A038610(n).

Programs

  • GAP
    List([1..70],n->Gcd(Factorial(n),n^n,Lcm([1..n]))); # Muniru A Asiru, Mar 20 2018
  • Maple
    A064446 := n -> ilcm(seq(i,i=1..n))/ilcm(op(select(k->igcd(n,k)=1,[$1..n])));
    seq(A064446(i),i=0..61); # Peter Luschny, Jun 25 2011
    N:= 1000: # to get a(1) to a(N)
    Primes:= select(isprime, [2,seq(2*i+1,i=1..floor((N-1)/2))]):
    A:= Vector(N,1):
    for p in Primes do
      for d from 1 to floor(log[p](N)) do
        for j from p^d to min(N, p^(d+1)-p) by p do
           A[j]:= A[j]*p^d
    od od od:
    convert(A,list); # Robert Israel, Oct 26 2015
  • Mathematica
    Table[GCD[n!,n^n,LCM@@Range[n]],{n,70}] (* Harvey P. Dale, Jun 25 2011 *)
    f[n_] := Block[{p = First /@ FactorInteger@ n}, Times @@ Power @@@ Transpose[{p, Floor@ Log[#, n] & /@ p}]]; {1}~Join~Table[f@ n, {n, 2, 10000}] (* Michael De Vlieger, Oct 26 2015 *)
  • PARI
    L=1; for (n=1, 1000, L=lcm(L, n); write("b064446.txt", n, " ", gcd(n^n, L))) \\ Harry J. Smith, Sep 14 2009
    
  • PARI
    a(n)=my(f=factor(n)); for(i=1,#f~, f[i,2]=logint(n,f[i,1])); factorback(f) \\ Charles R Greathouse IV, Nov 19 2015
    
  • PARI
    a(n) = gcd(n^n, lcm(vector(n, k, k))); \\ Michel Marcus, Mar 18 2018
    

Formula

a(n) = gcd(A000142(n), A000312(n), A003418(n)) = gcd(A000312(n), A003418(n)) = gcd(A051696(n), A003418(n)).
a(n) = Product_{prime p | n} p^floor(log_p(n)). - Robert Israel, Oct 26 2015
a(n) = e^(Sum_{k=1..n} (floor(n^k/k) - floor((n^k - 1)/k))*Mangoldt(k)) where Mangoldt is the Mangoldt function. - Anthony Browne, Jun 16 2016

A216917 Square array read by antidiagonals, T(N,n) = lcm{1<=j<=N, gcd(j,n)=1 | j} for N >= 0, n >= 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 6, 1, 1, 1, 12, 3, 2, 1, 1, 60, 3, 2, 1, 1, 1, 60, 15, 4, 3, 2, 1, 1, 420, 15, 20, 3, 6, 1, 1, 1, 840, 105, 20, 15, 12, 1, 2, 1, 1, 2520, 105, 140, 15, 12, 1, 6, 1, 1, 1, 2520, 315, 280, 105, 12, 5, 12, 3, 2, 1, 1, 27720, 315, 280, 105, 84
Offset: 1

Views

Author

Peter Luschny, Oct 02 2012

Keywords

Comments

T(N,n) is the least common multiple of all integers up to N that are relatively prime to n.
Replacing LCM in the definition with "product" gives the Gauss factorial A216919.

Examples

			   n | N=0 1 2 3  4  5  6   7   8    9   10
-----+-------------------------------------
   1 |   1 1 2 6 12 60 60 420 840 2520 2520
   2 |   1 1 1 3  3 15 15 105 105  315  315
   3 |   1 1 2 2  4 20 20 140 280  280  280
   4 |   1 1 1 3  3 15 15 105 105  315  315
   5 |   1 1 2 6 12 12 12  84 168  504  504
   6 |   1 1 1 1  1  5  5  35  35   35   35
   7 |   1 1 2 6 12 60 60  60 120  360  360
   8 |   1 1 1 3  3 15 15 105 105  315  315
   9 |   1 1 2 2  4 20 20 140 280  280  280
  10 |   1 1 1 3  3  3  3  21  21   63   63
  11 |   1 1 2 6 12 60 60 420 840 2520 2520
  12 |   1 1 1 1  1  5  5  35  35   35   35
  13 |   1 1 2 6 12 60 60 420 840 2520 2520
		

Programs

  • Mathematica
    t[, 0] = 1; t[n, k_] := LCM @@ Select[Range[k], CoprimeQ[#, n]&]; Table[t[n - k + 1, k], {n, 0, 11}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Jul 29 2013 *)
  • Sage
    def A216917(N, n):
        return lcm([j for j in (1..N) if gcd(j, n) == 1])
    for n in (1..13): [A216917(N,n) for N in (0..10)]

Formula

For n > 0:
A(n,1) = A003418(n);
A(n,2^k) = A217858(n) for k > 0;
A(n,3^k) = A128501(n-1) for k > 0;
A(2,n) = A000034(n);
A(3,n) = A129203(n-1);
A(4,n) = A129197(n-1);
A(n,n) = A038610(n);
A(floor(n/2),n) = A124443(n);
A(n,1)/A(n,n) = A064446(n);
A(n,1)/A(n,2) = A053644(n).

A067391 a(n) is the least common multiple of numbers in {1,2,3,...,n-1} which do not divide n.

Original entry on oeis.org

1, 1, 2, 3, 12, 20, 60, 210, 840, 504, 2520, 27720, 27720, 51480, 360360, 180180, 720720, 4084080, 12252240, 232792560, 232792560, 21162960, 232792560, 5354228880, 5354228880, 2059318800, 26771144400, 80313433200, 80313433200
Offset: 1

Views

Author

Labos Elemer, Jan 22 2002

Keywords

Examples

			For n=10: non-divisors = {3,4,6,7,8,9}, lcm(3,4,6,7,8,9) = 8*9*7 = 504 = a(10).
For n=18, a(18) = lcm(4,5,7,8,10,11,12,13,14,15,16,17) = 4084080.
		

Crossrefs

Cf. A049820 [count], A007978 [min], A024816 [sum], A055067 [product].
Cf. A173540.

Programs

  • Haskell
    a067391 n | n <= 2    = 1
              | otherwise = foldl lcm 1 $ a173540_row n
    -- Reinhard Zumkeller, Apr 04 2012
  • Mathematica
    a[n_] := LCM@@Select[Range[1, n-1], Mod[n, # ]!=0& ]
    Join[{1,1},Table[LCM@@Complement[Range[n],Divisors[n]],{n,3,30}]] (* Harvey P. Dale, Mar 27 2013 *)

Formula

Let f(n) = lcm(1, 2, ..., n-1) = A003418(n-1). If n = 2*p^k for some prime p, then a(n) = f(n)/p; otherwise a(n) = f(n).
Showing 1-10 of 13 results. Next