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.
%I A364391 #17 Aug 21 2023 08:25:27 %S A364391 1,2,3,2,5,3,7,4,6,5,11,6,13,7,10,8,17,9,19,10,14,11,23,12,20,13,18, %T A364391 14,29,15,31,16,22,17,28,18,37,19,26,20,41,21,43,22,30,23,47,24,42,25, %U A364391 34,26,53,27,44,28,38,29,59,30,61,31,42,32,52,33,67,34,46,35 %N A364391 a(n) = n - (largest nontrivial divisor of n, or 0 if there is none). %F A364391 a(n) = n - A032742(n) if n is composite, n otherwise. - _Jon E. Schoenfield_, Jul 21 2023 %e A364391 The largest nontrivial divisor of 6 is 3, so a(6) = 6 - 3 = 3. %t A364391 a[n_] := n - If[CompositeQ[n], n/FactorInteger[n][[1, 1]], 0]; Array[a, 100] (* _Amiram Eldar_, Jul 22 2023 *) %o A364391 (Python) %o A364391 from sympy import isprime, primefactors %o A364391 def A364391(n): return n if n==1 or isprime(n) else n-n//min(primefactors(n)) # _Chai Wah Wu_, Aug 20 2023 %Y A364391 Cf. A032742, A060681. %K A364391 nonn %O A364391 1,2 %A A364391 _Todor Szimeonov_, Jul 21 2023