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.

A085392 a(n) = largest prime divisor of n, or 1 if n is 1 or a prime.

This page as a plain text file.
%I A085392 #29 Jun 19 2022 02:21:33
%S A085392 1,1,1,2,1,3,1,2,3,5,1,3,1,7,5,2,1,3,1,5,7,11,1,3,5,13,3,7,1,5,1,2,11,
%T A085392 17,7,3,1,19,13,5,1,7,1,11,5,23,1,3,7,5,17,13,1,3,11,7,19,29,1,5,1,31,
%U A085392 7,2,13,11,1,17,23,7,1,3,1,37,5,19,11,13,1,5,3,41,1,7,17,43,29,11,1,5,13
%N A085392 a(n) = largest prime divisor of n, or 1 if n is 1 or a prime.
%H A085392 Reinhard Zumkeller, <a href="/A085392/b085392.txt">Table of n, a(n) for n = 1..10000</a>
%F A085392 a(n) = A006530(A032742(n)). - _R. J. Mathar_, Jun 26 2011
%p A085392 A085392 := proc(n) max( op(numtheory[divisors](n) minus {n})) ; A006530(%) ;
%p A085392 end proc:
%p A085392 seq(A085392(n),n=1..50) ; # _R. J. Mathar_, Jun 26 2011
%t A085392 PrimeFactors[n_] := Flatten[ Table[ # [[1]], {1}] & /@ FactorInteger[n]]; f[n_] := Block[{gpd = Divisors[n][[ -2]]}, If[gpd == 1, 1, PrimeFactors[gpd][[ -1]] ]]; Table[ If[n == 1, 1, f[n]], {n, 1, 95}]
%t A085392 Join[{1},Table[FactorInteger[Divisors[n][[-2]]][[-1,1]],{n,2,120}]] (* _Harvey P. Dale_, Jul 02 2019 *)
%t A085392 a[n_] := If[CompositeQ[n], FactorInteger[n][[-1, 1]], 1]; Array[a, 100] (* _Amiram Eldar_, Jun 19 2022 *)
%o A085392 (Haskell)
%o A085392 a085392 = a006530 . a032742  -- _Reinhard Zumkeller_, Oct 03 2012
%o A085392 (PARI) gpd(n) = if (n==1, 1, n/factor(n)[1,1]);
%o A085392 gpf(n) = if (n==1, 1, vecmax(factor(n)[,1]));
%o A085392 a(n) = gpf(gpd(n)); \\ _Michel Marcus_, Apr 08 2018
%Y A085392 Cf. A006530, A014673, A032742, A085393.
%K A085392 nonn
%O A085392 1,4
%A A085392 _Robert G. Wilson v_ and _Reinhard Zumkeller_, Jun 26 2003
%E A085392 Definition corrected by _N. J. A. Sloane_, Jul 02 2019. Also deleted an incorrect comment.