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

A006530 Gpf(n): greatest prime dividing n, for n >= 2; a(1)=1.

Original entry on oeis.org

1, 2, 3, 2, 5, 3, 7, 2, 3, 5, 11, 3, 13, 7, 5, 2, 17, 3, 19, 5, 7, 11, 23, 3, 5, 13, 3, 7, 29, 5, 31, 2, 11, 17, 7, 3, 37, 19, 13, 5, 41, 7, 43, 11, 5, 23, 47, 3, 7, 5, 17, 13, 53, 3, 11, 7, 19, 29, 59, 5, 61, 31, 7, 2, 13, 11, 67, 17, 23, 7, 71, 3, 73, 37, 5, 19, 11, 13, 79, 5, 3, 41, 83, 7, 17, 43
Offset: 1

Views

Author

Keywords

Comments

The initial term a(1)=1 is purely conventional: The unit 1 is not a prime number, although it has been considered so in the past. 1 is the empty product of prime numbers, thus 1 has no largest prime factor. - Daniel Forgues, Jul 05 2011
Greatest noncomposite number dividing n, (cf. A008578). - Omar E. Pol, Aug 31 2013
Conjecture: Let a, b be nonzero integers and f(n) denote the maximum prime factor of a*n + b if a*n + b <> 0 and f(n)=0 if a*n + b=0 for any integer n. Then the set {n, f(n), f(f(n)), ...} is finite of bounded size. - M. Farrokhi D. G., Jan 10 2021

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 844.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section IV.1.
  • H. L. Montgomery, Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis, Amer. Math. Soc., 1996, p. 210.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000040, A020639 (smallest prime divisor), A034684, A028233, A034699, A053585.
Cf. A046670 (partial sums), A104350 (partial products).
See A385503 for "popular" primes.

Programs

  • Magma
    [ #f eq 0 select 1 else f[ #f][1] where f is Factorization(n): n in [1..86] ]; // Klaus Brockhaus, Oct 23 2008
    
  • Maple
    with(numtheory,divisors); A006530 := proc(n) local i,t1,t2,t3,t4,t5; t1 := divisors(n); t2 := convert(t1,list); t3 := sort(t2); t4 := nops(t3); t5 := 1; for i from 1 to t4 do if isprime(t3[t4+1-i]) then return t3[t4+1-i]; fi; od; 1; end;
    # alternative
    A006530 := n->max(1,op(numtheory[factorset](n))); # Peter Luschny, Nov 02 2010
  • Mathematica
    Table[ FactorInteger[n][[ -1, 1]], {n, 100}] (* Ray Chandler, Nov 12 2005 and modified by Robert G. Wilson v, Jul 16 2014 *)
  • PARI
    A006530(n)=if(n>1,vecmax(factor(n)[,1]),1) \\ Edited to cover n=1. - M. F. Hasler, Jul 30 2015
    
  • Python
    from sympy import factorint
    def a(n): return 1 if n == 1 else max(factorint(n))
    print([a(n) for n in range(1, 87)]) # Michael S. Branicky, Aug 08 2022
    
  • SageMath
    def A006530(n): return list(factor(n))[-1][0] if n > 1 else 1
    print([A006530(n) for n in range(1, 87)])  # Peter Luschny, Jan 07 2024
  • Scheme
    ;; The following uses macro definec for the memoization (caching) of the results. A naive implementation of A020639 can be found under that entry. It could be also defined with definec to make it faster on the later calls. See http://oeis.org/wiki/Memoization#Scheme
    (definec (A006530 n) (let ((spf (A020639 n))) (if (= spf n) spf (A006530 (/ n spf)))))
    ;; Antti Karttunen, Mar 12 2017
    

Formula

a(n) = A027748(n, A001221(n)) = A027746(n, A001222(n)); a(n)^A071178(n) = A053585(n). - Reinhard Zumkeller, Aug 27 2011
a(n) = A000040(A061395(n)). - M. F. Hasler, Jan 16 2015
a(n) = n + 1 - Sum_{k=1..n} (floor((k!^n)/n) - floor(((k!^n)-1)/n)). - Anthony Browne, May 11 2016
n/a(n) = A052126(n). - R. J. Mathar, Oct 03 2016
If A020639(n) = n [when n is 1 or a prime] then a(n) = n, otherwise a(n) = a(A032742(n)). - Antti Karttunen, Mar 12 2017
a(n) has average order Pi^2*n/(12 log n) [Brouwer]. See also A046670. - N. J. A. Sloane, Jun 26 2017

Extensions

Edited by M. F. Hasler, Jan 16 2015

A020639 Lpf(n): least prime dividing n (when n > 1); a(1) = 1. Or, smallest prime factor of n, or smallest prime divisor of n.

Original entry on oeis.org

1, 2, 3, 2, 5, 2, 7, 2, 3, 2, 11, 2, 13, 2, 3, 2, 17, 2, 19, 2, 3, 2, 23, 2, 5, 2, 3, 2, 29, 2, 31, 2, 3, 2, 5, 2, 37, 2, 3, 2, 41, 2, 43, 2, 3, 2, 47, 2, 7, 2, 3, 2, 53, 2, 5, 2, 3, 2, 59, 2, 61, 2, 3, 2, 5, 2, 67, 2, 3, 2, 71, 2, 73, 2, 3, 2, 7, 2, 79, 2, 3, 2, 83, 2, 5, 2, 3, 2, 89, 2, 7, 2, 3, 2, 5, 2, 97
Offset: 1

Views

Author

Keywords

Comments

Also, the largest number of distinct integers such that all their pairwise differences are coprime to n. - Max Alekseyev, Mar 17 2006
The unit 1 is not a prime number (although it has been considered so in the past). 1 is the empty product of prime numbers, thus 1 has no least prime factor. - Daniel Forgues, Jul 05 2011
a(n) = least m > 0 for which n! + m and n - m are not relatively prime. - Clark Kimberling, Jul 21 2012
For n > 1, a(n) = the smallest k > 1 that divides n. - Antti Karttunen, Feb 01 2014
For n > 1, records are at prime indices. - Zak Seidov, Apr 29 2015
The initials "lpf" might be mistaken for "largest prime factor" (A009190), using "spf" for "smallest prime factor" would avoid this. - M. F. Hasler, Jul 29 2015
n = 89 is the first index > 1 for which a(n) differs from the smallest k > 1 such that (2^k + n - 2)/k is an integer. - M. F. Hasler, Aug 11 2015
From Stanislav Sykora, Jul 29 2017: (Start)
For n > 1, a(n) is also the smallest k, 1 < k <= n, for which the binomial(n,k) is not divisible by n.
Proof: (A) When k and n are relatively prime then binomial(n,k) is divisible by n because k*binomial(n,k) = n*binomial(n-1,k-1). (B) When gcd(n,k) > 1, one of its prime factors is the smallest; let us denote it p, p <= k, and consider the binomial(n,p) = (1/p!)*Product_{i=0..p-1} (n-i). Since p is a divisor of n, it cannot be a divisor of any of the remaining numerator factors. It follows that, denoting as e the largest e > 0 such that p^e|n, the numerator is divisible by p^e but not by p^(e+1). Hence, the binomial is divisible by p^(e-1) but not by p^e and therefore not divisible by n. Applying (A), (B) to all considered values of k completes the proof. (End)
From Bob Selcoe, Oct 11 2017, edited by M. F. Hasler, Nov 06 2017: (Start)
a(n) = prime(j) when n == J (mod A002110(j)), n, j >= 1, where J is the set of numbers <= A002110(j) with smallest prime factor = prime(j). The number of terms in J is A005867(j-1). So:
a(n) = 2 when n == 0 (mod 2);
a(n) = 3 when n == 3 (mod 6);
a(n) = 5 when n == 5 or 25 (mod 30);
a(n) = 7 when n == 7, 49, 77, 91, 119, 133, 161 or 203 (mod 210);
etc. (End)
For n > 1, a(n) is the leftmost term, other than 0 or 1, in the n-th row of A127093. - Davis Smith, Mar 05 2019

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section IV.1.

Crossrefs

Cf. A090368 (bisection).
Cf. A046669 (partial sums), A072486 (partial products).
Cf. A127093.

Programs

  • Haskell
    a020639 n = spf a000040_list where
      spf (p:ps) | n < p^2      = n
                 | mod n p == 0 = p
                 | otherwise    = spf ps
    -- Reinhard Zumkeller, Jul 13 2011
    
  • Maple
    A020639 := proc(n) if n = 1 then 1; else min(op(numtheory[factorset](n))) ; end if; end proc: seq(A020639(n),n=1..20) ; # R. J. Mathar, Oct 25 2010
  • Mathematica
    f[n_]:=FactorInteger[n][[1,1]]; Join[{1}, Array[f,120,2]]  (* Robert G. Wilson v, Apr 06 2011 *)
    Join[{1}, Table[If[EvenQ[n], 2, FactorInteger[n][[1,1]]], {n, 2, 120}]] (* Zak Seidov, Nov 17 2013 *)
    Riffle[Join[{1},Table[FactorInteger[n][[1,1]],{n,3,101,2}]],2] (* Harvey P. Dale, Dec 16 2021 *)
  • PARI
    A020639(n) = { vecmin(factor(n)[,1]) } \\ [Will yield an error for n = 1.] - R. J. Mathar, Mar 02 2012
    
  • PARI
    A020639(n)=if(n>1, if(n>n=factor(n,0)[1,1], n, factor(n)[1,1]), 1) \\ Avoids complete factorization if possible. Often the smallest prime factor can be found quickly even if it is larger than primelimit. If factoring takes too long for large n, use debugging level >= 3 (\g3) to display the smallest factor as soon as it is found. - M. F. Hasler, Jul 29 2015
    
  • Python
    from sympy import factorint
    def a(n): return 1 if n == 1 else min(factorint(n))
    print([a(n) for n in range(1, 98)]) # Michael S. Branicky, Dec 09 2021
  • Sage
    def A020639_list(n) : return [1] + [prime_divisors(n)[0] for n in (2..n)]
    A020639_list(97) # Peter Luschny, Jul 16 2012
    
  • Sage
    [trial_division(n) for n in (1..100)] # Giuseppe Coppoletta, May 25 2016
    
  • Scheme
    (define (A020639 n) (if (< n 2) n (let loop ((k 2)) (cond ((zero? (modulo n k)) k) (else (loop (+ 1 k))))))) ;; Antti Karttunen, Feb 01 2014
    

Formula

A014673(n) = a(A032742(n)); A115561(n) = a(A054576(n)). - Reinhard Zumkeller, Mar 10 2006
A028233(n) = a(n)^A067029(n). - Reinhard Zumkeller, May 13 2006
a(n) = A027746(n,1) = A027748(n,1). - Reinhard Zumkeller, Aug 27 2011
For n > 1: a(n) = A240694(n,2). - Reinhard Zumkeller, Apr 10 2014
a(n) = A000040(A055396(n)) = n / A032742(n). - Antti Karttunen, Mar 07 2017
a(n) has average order n/(2 log n) [Brouwer] - N. J. A. Sloane, Sep 03 2017

Extensions

Deleted wrong comment from M. Lagneau in 2012, following an observation by Gionata Neri. - M. F. Hasler, Aug 11 2015
Edited by M. F. Hasler, Nov 06 2017
Expanded definition to make this easier to find. - N. J. A. Sloane, Sep 21 2020

A104350 Partial products of largest prime factors of numbers <= n.

Original entry on oeis.org

1, 2, 6, 12, 60, 180, 1260, 2520, 7560, 37800, 415800, 1247400, 16216200, 113513400, 567567000, 1135134000, 19297278000, 57891834000, 1099944846000, 5499724230000, 38498069610000, 423478765710000, 9740011611330000
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 06 2005

Keywords

Comments

Partial Products of A006530: a(n) = Product_{k=1..n} A006530(k).
a(n) = a(n-1)*A006530(n) for n>1, a(1) = 1;
A020639(a(n)) = A040000(n-1), A006530(a(n)) = A007917(n) for n>1.
A001221(a(n)) = A000720(n), A001222(a(n)) = A001477(n-1).
A007947(a(n)) = A034386(n).
a(n) = A000142(n) / A076928(n). [Corrected by Franklin T. Adams-Watters, Oct 30 2006]
In decimal representation: A104351(n) = number of digits of a(n), A104355(n) = number of trailing zeros of a(n).
A104357(n) = a(n) - 1, A104365(n) = a(n) + 1.

References

  • Gérald Tenenbaum, Introduction à la théorie analytique et probabiliste des nombres, Publ. Inst. Elie Cartan, Vol. 13, Nancy, 1990.

Crossrefs

Programs

  • Haskell
    a104350 n = a104350_list !! (n-1)
    a104350_list = scanl1 (*) a006530_list
    -- Reinhard Zumkeller, Apr 10 2014
    
  • Mathematica
    A104350[n_] := Product[FactorInteger[k][[-1, 1]], {k, 1, n}]; Table[A104350[n], {n, 30}] (* G. C. Greubel, May 09 2017 *)
    FoldList[Times,Table[FactorInteger[n][[-1,1]],{n,30}]] (* Harvey P. Dale, May 25 2023 *)
  • PARI
    gpf(n)=my(f=factor(n)[,1]); f[#f]
    a(n)=prod(i=2,n,gpf(i)) \\ Charles R Greathouse IV, Apr 29 2015
    
  • PARI
    first(n)=my(v=vector(n,i,1)); forfactored(k=2,n, v[k[1]]=v[k[1]-1]*vecmax(k[2][,1])); v \\ Charles R Greathouse IV, May 10 2017

Formula

log(a(n)) = c * n * log(n) + c * (1-gamma) * n + O(n * exp(-log(n)^(3/8-eps))), where c is the Golomb-Dickman constant (A084945) and gamma is Euler's constant (A001620) (Tenenbaum, 1990). - Amiram Eldar, May 21 2021

Extensions

More terms from David Wasserman, Apr 24 2008

A088822 a(n) is the sum of largest prime factors of numbers from 1 to n.

Original entry on oeis.org

0, 2, 5, 7, 12, 15, 22, 24, 27, 32, 43, 46, 59, 66, 71, 73, 90, 93, 112, 117, 124, 135, 158, 161, 166, 179, 182, 189, 218, 223, 254, 256, 267, 284, 291, 294, 331, 350, 363, 368, 409, 416, 459, 470, 475, 498, 545, 548, 555, 560, 577, 590, 643, 646, 657, 664, 683
Offset: 1

Views

Author

Labos Elemer, Oct 22 2003

Keywords

Crossrefs

Programs

  • GAP
    P:=List(List([2..60],n->Reversed(Factors(n))),i->i[1]);;
     a:=Concatenation([0],List([1..Length(P)],i->Sum([1..i],k->P[k]))); # Muniru A Asiru, Nov 29 2018
  • Mathematica
    -1 + Accumulate@ Array[FactorInteger[#][[-1, 1]] &, 57] (* Michael De Vlieger, Jul 23 2017 *)
  • PARI
    gpf(n)=if(n<4, n, n=factor(n)[, 1]; n[#n])
    a(n)=sum(k=2, n, gpf(k)) \\ Charles R Greathouse IV, Feb 19 2014
    

Formula

a(n) = Pi^2/12 * n^2/log n + O(n^2/log^2 n). - Charles R Greathouse IV, Feb 19 2014
a(n) ~ zeta(2) * A088821(n), where zeta(2) = Pi^2/6. - Thomas Ordowski, Nov 29 2018

A046669 Partial sums of A020639.

Original entry on oeis.org

1, 3, 6, 8, 13, 15, 22, 24, 27, 29, 40, 42, 55, 57, 60, 62, 79, 81, 100, 102, 105, 107, 130, 132, 137, 139, 142, 144, 173, 175, 206, 208, 211, 213, 218, 220, 257, 259, 262, 264, 305, 307, 350, 352, 355, 357, 404, 406, 413, 415, 418, 420, 473
Offset: 1

Views

Author

Keywords

References

  • M. Kalecki, On certain sums extended over primes or prime factors (in Polish), Prace Mat., Vol. 8 (1963/64), pp. 121-129.
  • József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Section IV.1, p. 121.

Crossrefs

Programs

  • Haskell
    a046669 n = a046669_list !! (n-1)
    A046669_list = scanl1 (+) a020639_list -- Reinhard Zumkeller, Jun 15 2013
  • Mathematica
    Accumulate[Array[FactorInteger[#][[1,1]]&,60]]  (* Harvey P. Dale, Apr 20 2011 *)

Formula

a(n) = A088821(n) + 1.
From Amiram Eldar, Mar 04 2021: (Start)
a(n) ~ ((1 + o(1))/2)* n^2/log(n) (Kalecki, 1963/64).
a(n) = (1/2) * n^2/log(n) + O(n^2/log(n)^2) (Brouwer, 1974). (End)

A284521 Sum of largest prime power factors of numbers <= n.

Original entry on oeis.org

1, 3, 6, 10, 15, 18, 25, 33, 42, 47, 58, 62, 75, 82, 87, 103, 120, 129, 148, 153, 160, 171, 194, 202, 227, 240, 267, 274, 303, 308, 339, 371, 382, 399, 406, 415, 452, 471, 484, 492, 533, 540, 583, 594, 603, 626, 673, 689, 738, 763, 780, 793, 846, 873, 884, 892, 911, 940, 999, 1004, 1065, 1096, 1105, 1169, 1182
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 28 2017

Keywords

Comments

Partial sums of A034699.

Examples

			a(1) = 1;
a(2) = 3 because 2 is a prime and 1 + 2 = 3;
a(3) = 6 because 3 is a prime and 3 + 3 = 6;
a(4) = 10 because 4 = 2^2 and 6 + 4 = 10;
a(5) = 15 because 5 is a prime and 10 + 5 = 15;
a(6) = 18 because 12 = 2*3 and 15 + 3 = 18, etc.
		

Crossrefs

Programs

  • Maple
    g:= n -> max(map(t -> t[1]^t[2], ifactors(n)[2])): g(1):= 1:
    ListTools:-PartialSums(map(g, [$1..100])); # Robert Israel, Mar 29 2017
  • Mathematica
    Accumulate[Join[{1}, Table[Last[Select[Divisors[n], PrimePowerQ[#1] & ]], {n, 2, 65}]]]
  • PARI
    a(n) = if (n==1, 1, 1+ sum(k=2, n, f = factor(k); f[#f~,1]^f[#f~,2])); \\ Michel Marcus, Mar 28 2017

Formula

Conjecture: a(n) = O(n^2/log(n)).

A360559 Alternating partial sum of A006530.

Original entry on oeis.org

1, -1, 2, 0, 5, 2, 9, 7, 10, 5, 16, 13, 26, 19, 24, 22, 39, 36, 55, 50, 57, 46, 69, 66, 71, 58, 61, 54, 83, 78, 109, 107, 118, 101, 108, 105, 142, 123, 136, 131, 172, 165, 208, 197, 202, 179, 226, 223, 230, 225, 242, 229, 282, 279, 290, 283, 302, 273, 332, 327, 388, 357, 364, 362
Offset: 1

Views

Author

Luca Onnis, Feb 11 2023

Keywords

Comments

a(2) = -1 is the only negative term of the sequence.

Examples

			a(4) = 0 since the greatest prime factors of {1,2,3,4} are {1,2,3,2} and the alternating sum 1-2+3-2 = 0.
		

Crossrefs

Programs

  • Mathematica
    a[k_] := Sum[(-1)^(n + 1)*ResourceFunction["LargestPrimeFactor"][n], {n, 1, k}]; Table[a[n], {n, 1, 64}]
    (* or *)
    Accumulate[Table[(-1)^(n + 1)*FactorInteger[n][[-1, 1]], {n, 1, 100}]] (* Vaclav Kotesovec, Aug 09 2025 *)
  • PARI
    a(n)=if(n>1, vecmax(factor(n)[, 1]), 1); s(k)=sum(n=1, k, a(n)*(-1)^(n+1))

Formula

a(n) ~ (Pi^2*n^2*log(n/4))/(24*log(n/2)*log(n)) as n -> infinity.

A280050 a(n) = Sum_{k=2..n} k/lpf(k), where lpf(k) is the least prime dividing k (A020639).

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 13, 16, 21, 22, 28, 29, 36, 41, 49, 50, 59, 60, 70, 77, 88, 89, 101, 106, 119, 128, 142, 143, 158, 159, 175, 186, 203, 210, 228, 229, 248, 261, 281, 282, 303, 304, 326, 341, 364, 365, 389, 396, 421, 438, 464, 465, 492, 503, 531, 550, 579, 580, 610, 611, 642, 663, 695, 708, 741, 742, 776, 799, 834, 835
Offset: 1

Views

Author

Ilya Gutkovskiy, Jan 02 2017

Keywords

Comments

Sum of the largest proper divisors of all positive integers <= n.

Examples

			For n = 8 the divisors of the first eight positive integers are {1}, {1, 2}, {1, 3}, {1, 2, 4}, {1, 5}, {1, 2, 3, 6}, {1, 7}, {1, 2, 4, 8}, so a(8) = 1 + 1 + 2 + 1 + 3 + 1 + 4 = 13.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[k/FactorInteger[k][[1, 1]], {k, 2, n}], {n, 71}]
    Join[{0}, Accumulate[Table[k/FactorInteger[k][[1, 1]], {k, 2, 71}]]] (* Amiram Eldar, Jul 03 2025 *)
  • PARI
    list(kmax) = {my(s = 0); print1(s, ", "); for(k = 2, kmax, s += k/factor(k)[1,1]; print1(s, ", "));} \\ Amiram Eldar, Jul 03 2025

Formula

a(n) = Sum_{k=2..n} k/A020639(k).
a(n) + 1 = Sum_{k=1..n} A032742(k).
a(p^k) = a(p^k-1) + p^(k-1), when p is prime.
a(n) ~ c * n^2, where c = (1/2) * Sum_{k>=1} A005867(k-1)/(prime(k)*A002110(k)) = 0.165049... . - Amiram Eldar, Jul 03 2025

A303659 Numbers k such that the average of greatest prime factors of all positive integers <= k is an integer.

Original entry on oeis.org

2, 5, 6, 24, 27, 28, 79, 1171, 1901, 1932, 7845, 19152, 360698, 649358, 1731441, 1979944, 30658517, 34337898, 400114748, 412626117, 3738454462, 7725156081, 97366414806, 129951504625, 290788509485
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 28 2018

Keywords

Comments

Numbers k such that (k - 1) | (A046670(k) - 1).
Numbers k such that (k - 1) | A088822(k).
a(26) > 10^12. - Giovanni Resta, May 05 2018

Examples

			6 is in the sequence because (gpf(2) + gpf(3) + gpf(4) + gpf(5) + gpf(6))/5 = (2 + 3 + 2 + 5 + 3)/5 = 3 is an integer.
		

Crossrefs

Programs

  • PARI
    isok(n) = (n>1) && !(sum(k=2, n, vecmax(factor(k)[,1])) % (n-1)); \\ Michel Marcus, Apr 29 2018
    
  • PARI
    lista(nn) = {s = 0; for (n=2, nn, s += vecmax(factor(n)[,1]); if (! (s % (n-1)), print1(n, ", ")););} \\ Michel Marcus, Apr 29 2018

Extensions

a(13)-a(18) from Michel Marcus, Apr 29 2018
a(19)-a(25) from Giovanni Resta, May 05 2018
Showing 1-9 of 9 results.