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.

A179312 Largest semiprime dividing n, or 0 if no semiprime divides n.

Original entry on oeis.org

0, 0, 0, 4, 0, 6, 0, 4, 9, 10, 0, 6, 0, 14, 15, 4, 0, 9, 0, 10, 21, 22, 0, 6, 25, 26, 9, 14, 0, 15, 0, 4, 33, 34, 35, 9, 0, 38, 39, 10, 0, 21, 0, 22, 15, 46, 0, 6, 49, 25, 51, 26, 0, 9, 55, 14, 57, 58, 0, 15, 0, 62, 21, 4, 65, 33, 0, 34, 69, 35, 0, 9, 0, 74
Offset: 1

Views

Author

Jonathan Vos Post, Jan 11 2011

Keywords

Comments

a(p in primes A000040) = 0; a(k in semiprimes A001358) = k. This is to semiprimes A001358 as A006530 is to primes A000040.

Examples

			The smallest semiprime is 4, so a(n<4) = 0.
a(4) = 4, since 4 = 2^2 is semiprime, and 4 | 4 (i.e., 4/4 = 1).
a(5) = 0 because 5 is prime, only 1 and 5 evenly divide 5, no prime (with 1 prime factor) is a semiprimes (with two prime factors, not necessarily distinct).
a(6) = 6, since 6 = 2*3 is semiprime, and 6 | ^ (i.e., 6/6 = 1).
a(8) = 4, since 4 = 2^2 is semiprime, and 4 | 8 (i.e., 8/4 = 2).
		

Crossrefs

Cf. A088739 (smallest semiprime divisor of n-th composite number).

Programs

  • Maple
    a:= proc(n) local l;
          if n<4 or isprime(n) then 0
        else l:= sort(ifactors(n)[2], (x, y)-> x[1]>y[1]);
             l[1][1] *l[`if`(l[1][2]>=2, 1, 2)][1]
          fi
        end:
    seq(a(n), n=1..80);  # Alois P. Heinz, Jun 23 2012
  • Mathematica
    semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger@ n == 2; f[n_] := Max@ Select[ Divisors@ n, semiPrimeQ] /. {-\[Infinity] -> 0}; Array[f, 55]

Formula

a(n) = MAX(0, k in A001358 such that k | n).