The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 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). 7

%I

%S 1,0,27,0,2285,0,874615,0,381654729,0,0,0,559922224824157,0,0,0,0,0,0,

%T 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 0,0,0

%N 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 Sequence gives smallest term with desired property.

%C For n=2 and 10, there is only one such number.

%C For n=4, there are 2 solutions: 27 and 57, the latter 321(4).

%C For n=6, there are 2 solutions: 2285 and 7465, the latter 54321(6).

%C For n=8, there are 3 solutions: 874615, 1391089 and 1538257, these last two being 5234761(8) and 5674321(8).

%C 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 Is it true that a(n) = 0 for n > 14? - _Chai Wah Wu_, Jun 07 2015

%C 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 If a(n) <> 0 and is expressed in base n, the middle digit must be n/2. - _Thomas Kaeding_, Sep 01 2019

%H Werner Brefeld, <a href="http://www.brefeld.homepage.t-online.de/neunstellig-1.html">Neunstellige Zahl und Teilbarkeit</a> (in German).

%H Albert Franck, <a href="http://www.paulcooijmans.com/others/puzfrank.html">Puzzles</a>, see item 7.

%F a(2n+1) = 0 (see proof in comment). - _Michel Marcus_, Dec 09 2013

%e 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 a(4) = 27, that is 123 in base 4, such that 1, 12, and 123 are respectively divisible by 1, 2 and 3.

%e Expansion of each term in the corresponding base : 27 = 123 (4); 2285 = 14325 (6); 874615 = 3254167 (8); 381654729 = 381654729 (10); 559922224824157 = 9C3A5476B812D (14).

%o (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 (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 (PARI) okdigits(v, i) = {for (j=1, i-1, if (v[i] == v[j], return (0));); return (1);}

%o 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 (Python)

%o def vgen(n,b):

%o ....if n == 1:

%o ........t = list(range(1,b))

%o ........for i in range(1,b):

%o ............u = list(t)

%o ............u.remove(i)

%o ............yield i, u

%o ....else:

%o ........for d, v in vgen(n-1,b):

%o ............for g in v:

%o ................k = d*b+g

%o ................if not k % n:

%o ....................u = list(v)

%o ....................u.remove(g)

%o ....................yield k, u

%o def A163574(n):

%o ....for a, b in vgen(n-1,n):

%o ........return a

%o ....return 0 # _Chai Wah Wu_, Jun 07 2015

%K nonn,base,more

%O 2,3

%A _Gaurav Kumar_, Jul 31 2009

%E Corrected and edited by _Michel Marcus_, Dec 02 2013

%E More terms from _Michel Marcus_, Dec 09 2013

%E a(31)-a(41) from _Chai Wah Wu_, Jun 07 2015

%E a(42)-a(49) from _David Radcliffe_, Apr 24 2016

%E a(50)-a(53) from _Kevin Thomas_, Jun 11 2019

%E a(54)-a(57) from _Thomas Kaeding_, Sep 03 2019

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 20 05:58 EDT 2020. Contains 337264 sequences. (Running on oeis4.)