%I #13 Apr 19 2019 02:50:04
%S 0,0,0,2,0,0,0,2,3,0,0,1,0,0,0,4,0,3,0,0,0,0,0,1,5,0,6,0,0,0,0,6,0,0,
%T 0,3,0,0,0,0,0,0,0,0,1,0,0,3,7,5,0,0,0,6,0,0,0,0,0,0,0,0,0,6,0,0,0,0,
%U 0,0,0,3,0,0,5,0,0,0,0,1,6,0,0,0,0,0,0,0,0,1,0,0,0,0,0,5,0,7,0,5,0,0,0,0,0
%N Difference between the smallest number S(n) with S(n)! a multiple of n and the largest prime factor of n [taking a(1)=0].
%D Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 284-292.
%H Antti Karttunen, <a href="/A057108/b057108.txt">Table of n, a(n) for n = 1..65537</a>
%H Steven R. Finch, <a href="http://www.people.fas.harvard.edu/~sfinch/constant/golomb/smarand/smarand1.html">The Average Value of the Smarandache Function</a> [Broken link]
%H Steven R. Finch, <a href="http://fs.unm.edu/SF/TheAverageValue.pdf">The Average Value of the Smarandache Function</a>
%F a(n) = A002034(n) - A006530(n).
%e a(12)=1 since 12 is a factor of 4!, 3 is the largest prime factor of 12 and 4-3=1
%o (PARI)
%o A002034(n) = if(1==n,n, my(s=factor(n)[, 1], k=s[#s], f=Mod(k!, n)); while(f, f*=k++); (k)); \\ After code in A002034.
%o A006530(n) = if(n>1, vecmax(factor(n)[, 1]), 1); \\ From A006530.
%o A057108(n) = (A002034(n) - A006530(n)); \\ _Antti Karttunen_, Jul 22 2018
%Y Cf. A002034, A006530, A057109, A057110.
%K easy,nonn
%O 1,4
%A _Henry Bottomley_, Aug 08 2000
%E More terms from _James A. Sellers_, Aug 22 2000