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 A356552 #11 Sep 19 2022 07:23:24 %S A356552 2,2,3,2,5,2,7,2,3,2,11,2,13,7,3,2,17,2,19,2,2,11,23,2,3,5,3,3,29,3, %T A356552 31,2,3,2,3,2,37,19,3,2,41,2,43,6,3,23,47,2,7,4,5,4,53,3,2,3,3,29,59, %U A356552 2,61,31,3,2,3,2,67,2,2,6,71,2,73,37,3,4,3,3,79 %N A356552 a(n) is the least base b > 1 where the sum of digits of n divides n. %C A356552 This sequence is well defined: a(1) = 2, and for n > 1, the sum of digits of n in base n equals 1, which divides n. %C A356552 See A356553 for the corresponding sum of digits. %H A356552 Amiram Eldar, <a href="/A356552/b356552.txt">Table of n, a(n) for n = 1..10000</a> %F A356552 a(n) = 2 iff n belongs to A049445. %F A356552 a(n) = n iff n is prime. %e A356552 For n = 14: %e A356552 - we have: %e A356552 b sum of digits divides 14? %e A356552 -- ------------- ----------- %e A356552 2 3 no %e A356552 3 4 no %e A356552 4 5 no %e A356552 5 6 no %e A356552 6 4 no %e A356552 7 2 yes %e A356552 - so a(14) = 7. %t A356552 a[n_] := Module[{b = 2}, While[!Divisible[n, Plus @@ IntegerDigits[n, b]], b++]; b]; Array[a, 100] (* _Amiram Eldar_, Aug 15 2022 *) %o A356552 (PARI) a(n) = { for (b=2, oo, if (n % sumdigits(n, b)==0, return (b))) } %o A356552 (Python) %o A356552 from sympy.ntheory import digits %o A356552 def a(n): %o A356552 b = 2 %o A356552 while n != 0 and n%sum(digits(n, b)[1:]): b += 1 %o A356552 return b %o A356552 print([a(n) for n in range(1, 80)]) # _Michael S. Branicky_, Aug 12 2022 %Y A356552 Cf. A049445, A356553. %K A356552 nonn,base %O A356552 1,1 %A A356552 _Rémy Sigrist_, Aug 12 2022