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

A378680 a(n) = numerator(Sum_{k=1..n} 1/P_2(k)), where P_2(k) = A087040(k) is the second largest prime dividing the k-th composite number.

Original entry on oeis.org

1, 1, 3, 11, 7, 17, 10, 11, 25, 9, 5, 16, 35, 19, 98, 211, 221, 118, 41, 87, 271, 143, 146, 151, 317, 109, 57, 176, 367, 377, 196, 407, 2879, 2921, 997, 516, 1583, 1604, 3313, 3383, 1744, 593, 1221, 3733, 1919, 388, 395, 811, 275, 1389, 4237, 2171, 2192, 4489
Offset: 1

Views

Author

Amiram Eldar, Dec 03 2024

Keywords

Examples

			Fractions begin: 1/2, 1, 3/2, 11/6, 7/3, 17/6, 10/3, 11/3, 25/6, 9/2, 5, 16/3, ...
		

Crossrefs

Cf. A006530, A087039, A087040, A378681 (denominators).

Programs

  • Mathematica
    p2[c_] := Module[{f = FactorInteger[c]}, If[f[[-1, 2]] > 1, f[[-1, 1]], f[[-2, 1]]]]; Numerator@ Accumulate[Table[1/p2[c], {c, Select[Range[100], CompositeQ]}]]
  • PARI
    lista(nmax) = {my(s = 0); forcomposite(n = 1, nmax, f = factor(n); s += if(f[#f~, 2] > 1, 1/f[#f~, 1], 1/f[#f~ - 1, 1]); print1(numerator(s), ", "));}

Formula

a(n)/A378681(n) = Sum_{k=1..m} c_k * n/log(n)^k + O(n/log(n)^(m+1)) for any integer m >= 1, where c_k are constants. c_1 = Sum_{k>=1} (1/k)*Sum_{p prime > P(k)} 1/p^2 = Sum_{p prime} (1/p^2)*Product_{primes q < p} (1/(1-1/q)) = 1.254435359..., where P(k) = A006530(k) is the greatest prime dividing k for k >= 2, and P(1) = 1.

A378681 a(n) = denominator(Sum_{k=1..n} 1/P_2(k)), where P_2(k) = A087040(k) is the second largest prime dividing the k-th composite number.

Original entry on oeis.org

2, 1, 2, 6, 3, 6, 3, 3, 6, 2, 1, 3, 6, 3, 15, 30, 30, 15, 5, 10, 30, 15, 15, 15, 30, 10, 5, 15, 30, 30, 15, 30, 210, 210, 70, 35, 105, 105, 210, 210, 105, 35, 70, 210, 105, 21, 21, 42, 14, 70, 210, 105, 105, 210, 210, 210, 105, 35, 70, 210, 210, 105, 105, 210
Offset: 1

Views

Author

Amiram Eldar, Dec 03 2024

Keywords

Comments

See A378680 for more details.

Crossrefs

Cf. A087039, A087040, A378680 (numerators).

Programs

  • Mathematica
    p2[c_] := Module[{f = FactorInteger[c]}, If[f[[-1, 2]] > 1, f[[-1, 1]], f[[-2, 1]]]]; Denominator@ Accumulate[Table[1/p2[c], {c, Select[Range[50], CompositeQ]}]]
  • PARI
    lista(nmax) = {my(s = 0); forcomposite(n = 1, nmax, f = factor(n); s += if(f[#f~, 2] > 1, 1/f[#f~, 1], 1/f[#f~ - 1, 1]); print1(denominator(s), ", "));}

A087039 If n is prime then 1 else 2nd largest prime factor of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 2, 1, 2, 5, 2, 3, 2, 1, 3, 1, 2, 3, 2, 5, 3, 1, 2, 3, 2, 1, 3, 1, 2, 3, 2, 1, 2, 7, 5, 3, 2, 1, 3, 5, 2, 3, 2, 1, 3, 1, 2, 3, 2, 5, 3, 1, 2, 3, 5, 1, 3, 1, 2, 5, 2, 7, 3, 1, 2, 3, 2, 1, 3, 5, 2, 3, 2, 1, 3, 7, 2, 3, 2, 5, 2, 1, 7, 3, 5, 1, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 01 2003

Keywords

Crossrefs

Programs

  • Haskell
    a087039 n | null ps   = 1
              | otherwise = head ps
              where ps = tail $ reverse $ a027746_row n
    -- Reinhard Zumkeller, Oct 03 2012
    
  • Maple
    A087039 := proc(n)
        local pset ,t;
        if isprime(n) or n= 1 then
            1;
        else
            pset := [] ;
            for p in ifactors(n)[2] do
                pset := [op(pset),seq(op(1,p),t=1..op(2,p))] ;
            end do:
            op(-2,sort(pset)) ;
        end if;
    end proc: # R. J. Mathar, Sep 14 2012
  • Mathematica
    gpf[n_] := FactorInteger[n][[-1, 1]];
    a[n_] := If[PrimeQ[n], 1, gpf[n/gpf[n]]];
    Array[a, 105] (* Jean-François Alcover, Dec 16 2021 *)
  • Python
    from sympy import factorint
    def a(n):
        pf = factorint(n, multiple=True)
        return 1 if len(pf) < 2 else pf[-2]
    print([a(n) for n in range(1, 103)]) # Michael S. Branicky, Dec 16 2021

Formula

a(n) = A006530(A052126(n)) = A006530(n/A006530(n));
A087040(n) = a(A002808(n)).

A179938 Third largest prime factor of numbers that are divisible by at least three different primes (A000977).

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 3, 2, 2, 2, 2, 3, 3, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 2, 2, 2, 3, 2, 2, 3, 3, 3, 2, 2, 2, 3, 2, 2, 3, 2, 2, 3, 3, 2, 5, 2, 3, 3, 2, 2, 2, 2, 2, 3, 2, 5, 3, 3, 3, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 2, 2, 2, 3, 5, 2, 2, 3, 3, 3, 2, 2, 2, 2, 3, 5, 2, 2, 3, 2, 3
Offset: 1

Views

Author

Jonathan Vos Post, Jan 12 2011

Keywords

Comments

Third largest prime factor of numbers k such that omega(k) = A001221(k) > 2. The 3rd largest prime factor may equal the second largest. This is not identical to third largest distinct prime factor of numbers that are divisible by at least three different primes. Indices n where a(n) equals 2, 3, 5, 7, 11, 13, 17, 19, 23, ... for the first time are 1, 8, 72, 299, 905, 1718, 3302, 6020, 10330, ... the corresponding numbers from A000977 are 30, 90, 350, 1001, 2431, 4199, 7429, 12673, 20677, ...

Examples

			a(1) = 2 because 30 = 2 * 3 * 5 has third largest prime factor 2.
a(2) = 2 because 42 = 2 * 3 * 7 has third largest prime factor 2.
a(3) = 2 because 60 = 2 * 2 * 3 * 5 has both third and fourth largest prime factor 2.
a(8) = 3 because 90 = 2 * 3 * 3 * 5 has both second and third largest prime factor 3.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local k;
          if n=1 then 30
          else for k from b(n-1)+1 while
                  nops(ifactors(k)[2])<3 do od;
               k
          fi
        end:
    a:= n-> sort(map(x-> x[1]$x[2], ifactors(b(n))[2]))[-3]:
    seq(a(n), n=1..120);
  • Mathematica
    b[n_] := b[n] = Module[{k}, If[n==1, 30, For[k = b[n-1]+1, PrimeNu[k] < 3, k++]; k]];
    a[n_] := (Table[#[[1]], {#[[2]]}]& /@ FactorInteger[b[n]] // Flatten // Sort)[[-3]];
    Array[a, 120] (* Jean-François Alcover, Nov 28 2020, after Alois P. Heinz *)

Extensions

Edited by Alois P. Heinz, Jan 14 2011
Showing 1-4 of 4 results.