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 A360074 #12 Sep 04 2023 11:19:30 %S A360074 1,2,3,4,5,6,7,8,9,10,1,12,1,7,5,8,1,18,1,20,21,2,1,24,5,2,27,7,1,30, %T A360074 1,8,3,2,7,36,1,2,3,40,1,42,1,4,45,2,1,48,7,50,3,4,1,54,5,8,3,2,1,60, %U A360074 1,2,63,8,5,6,1,4,3,70,1,72,1,2,5,4,7,6,1,80 %N A360074 a(n) is the greatest divisor of n divisible by the sum of its own digits. %C A360074 Numbers divisible by the sum of their digits are called Niven (or Harshad, or harshad) numbers (A007602). %H A360074 Rémy Sigrist, <a href="/A360074/b360074.txt">Table of n, a(n) for n = 1..10000</a> %H A360074 <a href="/index/Di#divisors">Index entries for sequences related to divisors</a> %F A360074 a(n) = n iff n belongs to A005349. %e A360074 For n = 32: %e A360074 - the divisors of 32 are 1, 2, 4, 8, 16 and 32, %e A360074 - 8 is divisible by 8 whereas 16 is not divisible by 1+6 and 32 is not divisible by 3+2, %e A360074 - so a(32) = 8. %t A360074 Table[Max[Select[Divisors[n],Mod[#,Total[IntegerDigits[#]]]==0&]],{n,80}] (* _Harvey P. Dale_, Sep 04 2023 *) %o A360074 (PARI) a(n) = fordiv (n, d, my (t=n/d); if (t%sumdigits(t)==0, return (t))) %Y A360074 Cf. A005349, A332268, A360073. %K A360074 nonn,base,easy %O A360074 1,2 %A A360074 _Rémy Sigrist_, Jan 24 2023