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 A163574 #65 Jul 21 2025 01:05:33 %S A163574 1,0,27,0,2285,0,874615,0,381654729,0,0,0,559922224824157,0,0,0,0,0,0, %T A163574 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, %U A163574 0,0,0 %N A163574 Decimal expansion of smallest zeroless pandigital number in base n such that each k-digit substring (1 <= k <= n-1 = number of base-n digits) starting from the left, is divisible by k (or 0 if none exists). %C A163574 Sequence gives smallest term with desired property. %C A163574 For n=2 and 10, there is only one such number. %C A163574 For n=4, there are 2 solutions: 27 and 57, the latter 321(4). %C A163574 For n=6, there are 2 solutions: 2285 and 7465, the latter 54321(6). %C A163574 For n=8, there are 3 solutions: 874615, 1391089 and 1538257, these last two being 5234761(8) and 5674321(8). %C A163574 There are no solutions for a number system of base n, if n is odd. For a solution the sum of the digits is always (n-1)*n/2. A solution is always divisible by n-1. This is only possible if the sum of the digits is divisible by n-1. As a consequence, n/2 has to be an integer and therefore n has to be even (translated from 2nd link from German by web page author, Werner Brefeld). - _Michel Marcus_, Dec 09 2013 %C A163574 Is it true that a(n) = 0 for n > 14? - _Chai Wah Wu_, Jun 07 2015 %C A163574 For a solution in base n, if the k-th digit from the left is d, then gcd(d,n) = gcd(k,n). In particular, digits in even positions are even, and digits in odd positions are odd. - _David Radcliffe_, Apr 24 2016 %C A163574 If a(n) <> 0 and is expressed in base n, the middle digit must be n/2. - _Thomas Kaeding_, Sep 01 2019 %H A163574 Blaine, <a href="http://puzzles.blainesville.com/2008/01/how-about-math-puzzle.html#comments">How about a math puzzle?</a> %H A163574 Werner Brefeld, <a href="http://www.brefeld.homepage.t-online.de/neunstellig-1.html">Neunstellige Zahl und Teilbarkeit</a> (in German). %H A163574 Albert Franck, <a href="http://www.paulcooijmans.com/others/puzfrank.html">Puzzles</a>, see item 7. %F A163574 a(2n+1) = 0 (see proof in comment). - _Michel Marcus_, Dec 09 2013 %e A163574 a(3) = 0, since the 2 possible zeroless numbers, 12 and 21 in base 3, are both odd numbers, so do not satisfy the condition for k=2. %e A163574 a(4) = 27, that is 123 in base 4, such that 1, 12, and 123 are respectively divisible by 1, 2 and 3. %e A163574 Expansion of each term in the corresponding base : 27 = 123 (4); 2285 = 14325 (6); 874615 = 3254167 (8); 381654729 = 381654729 (10); 559922224824157 = 9C3A5476B812D (14). %o A163574 (PARI) a(n) = {n--; for (j=0, n!-1, perm = numtoperm(n, j); ok = 1; for (i=1, n, v = sum(k=1, i, perm[k]*(n+1)^(i-k)); if ((v % i), ok=0; break;);); if (ok, return(v)););} \\ _Michel Marcus_, Dec 01 2013 %o A163574 (PARI) chka(n, b) = {digs = digits(n, b); for (i=1, #digs, v = sum(k=1, i, digs[k]*b^(i-k)); print(v, ": ", v/i); if (v % i, return (0));); return (1);} \\ _Michel Marcus_, Dec 02 2013 %o A163574 (PARI) okdigits(v, i) = {for (j=1, i-1, if (v[i] == v[j], return (0));); return (1);} %o A163574 a(n) = {b = n; n--; v = vector(n, i, 0); i = 1; while (1, v[i]++; while (v[i] > n, v[i] = 0; i --; if (i==0, return (0)); v[i]++); curv = sum (j=1, i, v[j]*(b^(i-j))); if (! (curv % i), if (okdigits(v, i), if (i == n, return (sum (j=1, n, v[j]*(b^(n-j))))); i++;);););} \\ _Michel Marcus_, Dec 08 2013 %o A163574 (Python) %o A163574 def vgen(n, b): %o A163574 if n == 1: %o A163574 t = list(range(1, b)) %o A163574 for i in range(1, b): %o A163574 u = list(t) %o A163574 u.remove(i) %o A163574 yield i, u %o A163574 else: %o A163574 for d, v in vgen(n-1, b): %o A163574 for g in v: %o A163574 k = d*b+g %o A163574 if not k % n: %o A163574 u = list(v) %o A163574 u.remove(g) %o A163574 yield k, u %o A163574 def A163574(n): %o A163574 for a, b in vgen(n-1, n): %o A163574 return a %o A163574 return 0 # _Chai Wah Wu_, Jun 07 2015 %K A163574 nonn,base,more %O A163574 2,3 %A A163574 _Gaurav Kumar_, Jul 31 2009 %E A163574 Corrected and edited by _Michel Marcus_, Dec 02 2013 %E A163574 More terms from _Michel Marcus_, Dec 09 2013 %E A163574 a(31)-a(41) from _Chai Wah Wu_, Jun 07 2015 %E A163574 a(42)-a(49) from _David Radcliffe_, Apr 24 2016 %E A163574 a(50)-a(53) from _Kevin Thomas_, Jun 11 2019 %E A163574 a(54)-a(57) from _Thomas Kaeding_, Sep 03 2019