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

A046665 Largest prime divisor of n - smallest prime divisor of n (a(1)=0).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 1, 0, 5, 2, 0, 0, 1, 0, 3, 4, 9, 0, 1, 0, 11, 0, 5, 0, 3, 0, 0, 8, 15, 2, 1, 0, 17, 10, 3, 0, 5, 0, 9, 2, 21, 0, 1, 0, 3, 14, 11, 0, 1, 6, 5, 16, 27, 0, 3, 0, 29, 4, 0, 8, 9, 0, 15, 20, 5, 0, 1, 0, 35, 2, 17, 4, 11, 0, 3, 0, 39, 0, 5, 12, 41, 26, 9, 0
Offset: 1

Views

Author

Keywords

Comments

Even nonzero terms correspond to odd composite numbers that are not powers of primes. Terms of A030173 appear in this sequence infinitely often. - Alonso del Arte, Nov 27 2011
A135093(n) = first occurrence of A030173(n). - Reinhard Zumkeller, Jul 03 2015

References

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

Crossrefs

Programs

  • Haskell
    a046665 n = a006530 n - a020639 n  -- Reinhard Zumkeller, Jul 03 2015
    
  • Maple
    a:= n-> `if`(n=1, 0, (s-> max(s)-min(s))(numtheory[factorset](n))):
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 07 2020
  • Mathematica
    f[n_]:=Transpose[FactorInteger[n]][[1]];Table[Last[f[n]-First[f[n]]],{n,200}] (* Vladimir Joseph Stephan Orlovsky, Apr 08 2011 *)
    lpd[n_]:=Module[{fi=FactorInteger[n]},fi[[-1,1]]-fi[[1,1]]]; Array[lpd,90] (* Harvey P. Dale, Dec 31 2017 *)
  • PARI
    a(n)={if(n==1, 0, my(f=factor(n)[,1]); f[#f]-f[1])} \\ Andrew Howroyd, Mar 07 2020

Formula

a(n) = A006530(n) - A020639(n).

Extensions

More terms from James Sellers

A130064 a(n) = (n / SmallestPrimeFactor(n)) * GreatestPrimeFactor(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 7, 8, 9, 25, 11, 18, 13, 49, 25, 16, 17, 27, 19, 50, 49, 121, 23, 36, 25, 169, 27, 98, 29, 75, 31, 32, 121, 289, 49, 54, 37, 361, 169, 100, 41, 147, 43, 242, 75, 529, 47, 72, 49, 125, 289, 338, 53, 81, 121, 196, 361, 841, 59, 150, 61, 961, 147, 64, 169, 363
Offset: 1

Views

Author

Reinhard Zumkeller, May 05 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := With[{pp = FactorInteger[n][[All, 1]]}, n*pp[[-1]]/pp[[1]]];
    Array[a, 100] (* Jean-François Alcover, Nov 18 2021 *)
  • PARI
    a(n) = if (n==1, 1, my(f=factor(n)[, 1]~); n*vecmax(f)/vecmin(f)); \\ Michel Marcus, Sep 24 2022
    
  • Python
    from sympy import factorint
    def a(n): f = factorint(n); return 1 if n == 1 else n//min(f)*max(f)
    print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Sep 24 2022

Formula

a(n) = n*A006530(n)/A020639(n) = A032742(n)*A006530(n);
a(n) >= n.
a(n) = n iff n is a prime power: a(A000961(n)) = A000961(n);
a(A001221(n)) <= A001221(n); a(A001222(n)) = A001222(n);
a(n) = A130065(n)+n*A046665(n)*A074320(n)/A066048(n) = A000290(n)/A130065(n).
Sum_{k=1..n} k/a(k) ~ n/log(n) + 3*n/log(n)^2 + o(n/log(n)^2) (Erdős and van Lint, 1982). - Amiram Eldar, Oct 14 2022

A130065 a(n) = (n / GreatestPrimeFactor(n)) * SmallestPrimeFactor(n).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 05 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{ps = First /@ FactorInteger[n]}, n * First[ps] / Last[ps]]; Array[a, 100] (* Amiram Eldar, Nov 27 2020 *)
  • PARI
    a(n) = if (n==1, 1, my(f=factor(n)[,1]~); n*vecmin(f)/vecmax(f)); \\ Michel Marcus, Nov 27 2020

Formula

a(n) = n*A020639(n)/A006530(n) = A052126(n)*A020639(n);
a(n) <= n; a(n) = n iff n is a prime power: a(A000961(n)) = A000961(n);
a(A001221(n)) <= A001221(n); a(A001222(n)) = A001222(n);
a(n) = A130064(n) - n*A046665(n)*A074320(n)/A066048(n) = A000290(n)/A130064(n).

A199745 Numbers such that the sum of the largest and the smallest prime divisor equals the sum of the other distinct prime divisors.

Original entry on oeis.org

2145, 2730, 4641, 4845, 5005, 5460, 5610, 6435, 7410, 8190, 8778, 9177, 10725, 10920, 11220, 11305, 11730, 13485, 13585, 13650, 13923, 14535, 14820, 16380, 16830, 17017, 17556, 19110, 19305, 20010, 20930, 21489, 21505, 21840, 22230, 22440, 23460, 23529, 23595
Offset: 1

Views

Author

Michel Lagneau, Nov 09 2011

Keywords

Comments

The definition implies that members of the sequence have at least four distinct prime factors. An even term must have at least five distinct prime factors.

Examples

			22440 is in the sequence because the distinct prime divisors are  {2, 3, 5, 11, 17} and 17+2 = 3+5+11.
		

Crossrefs

Programs

  • Haskell
    a199745 n = a199745_list !! (n-1)
    a199745_list = filter (\x -> 2 * (a074320 x) == a008472 x) [1..]
    -- Reinhard Zumkeller, Nov 10 2011
  • Maple
    isA199745 := proc(n)
      local p;
      p := sort(convert(numtheory[factorset](n),list)) ;
      if nops(p) >= 3 then
        return ( op(1,p) + op(-1,p) = add(op(i,p),i=2..nops(p)-1) ) ;
      else
        false;
      end if;
    end proc:
    for n from 2 to 20000 do
      if isA199745(n) then
        printf("%d,",n) ;
      end if ;
    end do: # R. J. Mathar, Nov 10 2011
  • Mathematica
    Select[Range[25000],Plus@@(pl=First/@FactorInteger[#])/2==pl[[1]]+pl[[-1]]&] (* Ray Chandler, Nov 10 2011 *)
  • Sage
    def isA199745(n) :
        p = factor(n)
        return len(p) > 2 and p[0][0] + p[-1][0] == add(p[i][0] for i in (1..len(p)-2))
    [n for n in (2..20000) if isA199745(n)]  # Peter Luschny, Nov 10 2011
    

Formula

n such that A008472(n)/2 = A074320(n) = A020639(n) + A006530 (n). - Ray Chandler, Nov 10 2011
Sum_{k=2..A001221(a(n))} A027748(a(n),k) = A027748(a(n),1) + A027748(a(n), A001221(a(n))). - Reinhard Zumkeller, Nov 10 2011

A120454 a(n) = ceiling(GPF(n)/LPF(n)) where GPF is greatest prime factor, LPF is least prime factor.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 4, 2, 1, 1, 2, 1, 3, 3, 6, 1, 2, 1, 7, 1, 4, 1, 3, 1, 1, 4, 9, 2, 2, 1, 10, 5, 3, 1, 4, 1, 6, 2, 12, 1, 2, 1, 3, 6, 7, 1, 2, 3, 4, 7, 15, 1, 3, 1, 16, 3, 1, 3, 6, 1, 9, 8, 4, 1, 2, 1, 19, 2, 10, 2, 7, 1, 3, 1, 21, 1, 4, 4, 22, 10, 6, 1, 3, 2, 12, 11, 24, 4, 2, 1, 4, 4
Offset: 1

Views

Author

Jonathan Vos Post, Aug 16 2006

Keywords

Comments

Given GPF(n) and LPF(n), the sum is A074320, the difference is A046665 and the product is A066048. a(n) = 1 iff n is p^k iff n is in A000961.

Examples

			a(26) = ceiling(GPF(26)/LPF(26)) = ceiling(13/2) = 7.
		

Crossrefs

Programs

  • Maple
    A120454 := proc(n) local ifs ; if n = 1 then RETURN(1) ; else ifs := ifactors(n)[2] ; RETURN( ceil(op(1,op(-1,ifs))/op(1,op(1,ifs))) ) ; fi ; end ; for n from 1 to 100 do printf("%d, ",A120454(n)) ; od ; # R. J. Mathar, Dec 16 2006
  • Mathematica
    a[n_] := Module[{p = FactorInteger[n][[;;, 1]]}, Ceiling[p[[-1]] / p[[1]]]]; Array[a, 100] (* Amiram Eldar, Oct 24 2024 *)
  • PARI
    A120454(n) = if(1==n,1, my(f = factor(n), lpf = f[1, 1], gpf = f[#f~, 1]); ceil(gpf/lpf)); \\ Antti Karttunen, Sep 06 2018

Formula

a(n) = ceiling(A006530(n)/A020639(n)).
a(n) = A069897(n) + 1 if n is not a power of a prime (A024619), and 1 otherwise. - Amiram Eldar, Oct 24 2024

Extensions

Corrected and extended by R. J. Mathar, Dec 16 2006

A271621 a(1) = 2, a(2) = 3, a(n) = A020639(a(n-2)) + A006530(a(n-1)).

Original entry on oeis.org

2, 3, 5, 8, 7, 9, 10, 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Offset: 1

Views

Author

Cody M. Haderlie, Apr 10 2016

Keywords

Comments

Any sequence generated by this formula and any values for a(1) and a(2) will have a finite number of terms not equal to 4; i.e., all such sequences will eventually end up at 4 (and all following terms will be 4; 4 is the only term that can appear more than twice in a row in a sequence because it is the only number equal to the sum of its least and greatest prime factors). Example: a(1) = 77713; a(2) = 16; the sequence is: 77713, 16, 77715, 159, 56, 10, 7, 9, 10, 8, 4, 4, 4, ...

Examples

			a(1) = 13; a(2) = 46.
lpf(13) = 13; gpf(46) = 23.
a(3) = 13 + 23 = 36.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 2; a[2] = 3; a[n_] := a[n] = FactorInteger[a[n - 2]][[1, 1]] +
    FactorInteger[a[n - 1]][[-1, 1]]; Array[a, {120}] (* Michael De Vlieger, Apr 12 2016 *)
  • PARI
    spf(n) = if (n==1, 1, vecmin(factor(n)[,1]));
    gpf(n) = if (n==1, 1, vecmax(factor(n)[,1]));
    lista(nn) = {print1(x=2, ", "); print1(y=3, ", "); for (n=1, nn, ny = spf(x) + gpf(y); print1(ny, ", "); x = y; y = ny;);} \\ Michel Marcus, Apr 15 2016

Formula

a(n) = lpf(a(n-2)) + gpf(a(n-1)), where lpf(n) is the least prime dividing n and gpf(n) is the greatest prime dividing n.
Showing 1-6 of 6 results.