A235133 Numbers whose (decimal) digits are a permutation of 1...n for some n, such that for all k in {1,...,n} the first k digits form a number divisible by k, when considered as representation in base n+1.
1, 123, 321, 14325, 54321, 3254167, 5234761, 5674321, 381654729
Offset: 1
Examples
a(2) = 123 is in the sequence, because in base 4, 12[4]=6 is divisible by 2 and 123[4] = 27 = A235164(2) is divisible by 3. The same is the case for 321, where 32[4]=14 is even and 321[4] = 57 = A235164(3) is divisible by 3. For the 9-digit term 381654729, the initial digits are to be interpreted in base 10: 38, 318, ..., 381654729 are divisible by 2, 3, ..., 9, respectively.
Programs
-
PARI
for(n=1,9,p=vector(n,i,(n+1)^(i-1));for(k=0,n!-1,d=numtoperm(n,k);for(j=2,n,sum(i=1,j,d[i]*p[j-i+1])%j &&next(2)); print1(Vec(d)*vector(n,i,10^(n-i))~", ")))
Comments