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.

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

This page as a plain text file.
%I A046665 #28 Jul 02 2025 16:01:57
%S A046665 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,
%T A046665 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,
%U A046665 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
%N A046665 Largest prime divisor of n - smallest prime divisor of n (a(1)=0).
%C A046665 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
%C A046665 A135093(n) = first occurrence of A030173(n). - _Reinhard Zumkeller_, Jul 03 2015
%D A046665 Handbook of Number Theory, D. S. Mitrinovic et al., Kluwer, Section IV.1.
%H A046665 T. D. Noe, <a href="/A046665/b046665.txt">Table of n, a(n) for n = 1..1000</a>
%F A046665 a(n) = A006530(n) - A020639(n).
%p A046665 a:= n-> `if`(n=1, 0, (s-> max(s)-min(s))(numtheory[factorset](n))):
%p A046665 seq(a(n), n=1..100);  # _Alois P. Heinz_, Mar 07 2020
%t A046665 f[n_]:=Transpose[FactorInteger[n]][[1]];Table[Last[f[n]-First[f[n]]],{n,200}] (* _Vladimir Joseph Stephan Orlovsky_, Apr 08 2011 *)
%t A046665 lpd[n_]:=Module[{fi=FactorInteger[n]},fi[[-1,1]]-fi[[1,1]]]; Array[lpd,90] (* _Harvey P. Dale_, Dec 31 2017 *)
%o A046665 (Haskell)
%o A046665 a046665 n = a006530 n - a020639 n  -- _Reinhard Zumkeller_, Jul 03 2015
%o A046665 (PARI) a(n)={if(n==1, 0, my(f=factor(n)[,1]); f[#f]-f[1])} \\ _Andrew Howroyd_, Mar 07 2020
%Y A046665 Cf. A006530, A020639, A074320, A066048, A130064, A130065.
%K A046665 nonn,easy,nice
%O A046665 1,10
%A A046665 _N. J. A. Sloane_
%E A046665 More terms from _James Sellers_