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.

A274006 Largest proper prime power divisor of n, or 1 if n is squarefree.

Original entry on oeis.org

1, 1, 1, 4, 1, 1, 1, 8, 9, 1, 1, 4, 1, 1, 1, 16, 1, 9, 1, 4, 1, 1, 1, 8, 25, 1, 27, 4, 1, 1, 1, 32, 1, 1, 1, 9, 1, 1, 1, 8, 1, 1, 1, 4, 9, 1, 1, 16, 49, 25, 1, 4, 1, 27, 1, 8, 1, 1, 1, 4, 1, 1, 9, 64, 1, 1, 1, 4, 1, 1, 1, 9, 1, 1, 25, 4, 1, 1, 1, 16, 81, 1
Offset: 1

Views

Author

Keywords

Comments

These values were mistakenly entered into A203025.

Examples

			36 = 2^2 * 3^2. 3^2 = 9 > 2^2 = 4, so a(36) = 9.
20 = 2^2 * 5, so 2^2 = 4 is the only proper prime power divisor of 20, thus a(20) = 4.
		

Crossrefs

Programs

  • Maple
    A274006:=proc(n)
        local a, pe;
        a := 1;
        for pe in ifactors(n)[2] do
            if pe[2] > 1 then
                a:=max(a, pe[1]^pe[2]);
            end if;
        end do;
        a
    end proc:
    seq(A274006(n), n=1..100); # R. J. Mathar, Jun 02 2025
  • Mathematica
    Table[s = Select[FactorInteger[n], #[[2]] > 1 &]; If[s == {}, 1, Max[#1^#2 & @@@ s]], {n, 100}] (* T. D. Noe, Jan 02 2012 *)
    Table[If[SquareFreeQ[n],1,Max[#[[1]]^#[[2]]&/@Select[FactorInteger[n],#[[2]]>1&]]],{n,90}] (* Harvey P. Dale, Feb 18 2025 *)
  • PARI
    a(n) = my(fm=factor(n),r=1); for(k=1, #fm[,1], if(fm[k,2]!=1&&fm[k,1]^fm[k,2]>r, r=fm[k,1]^fm[k,2]));r