login
A192392
Largest multiple of n which can be formed as concatenation of the next n numbers, {1+n(n-1)/2,...,n(n+1)/2} (written in decimal), or 0 if no such number exists.
5
1, 32, 654, 97108, 1413121115, 212019181716, 28272625222324, 3635343331293032, 454443424140393837, 55545352514948474650, 6665646362616059585756, 787776757473727170696768, 91908988878685848382817980, 9998979695949392105104103101100102
OFFSET
1,2
COMMENTS
Equal to A076069(n) whenever A076069(n) is a multiple of n. Less than or equal to A076072(n), where permutations of individual digits are allowed.
PROG
(PARI) precperm(p)={ my(t); forstep( i=#p-1, 1, -1, p[i]>p[i+1] && for( j=1, #t=vecsort( vecextract( p, 2^#p-2^(i-1) ), , 4), t[j]<p[i] && return( concat([ vecextract( p, 2^(i-1)-1 ), [t[j]], vecextract( t, Str( "^"j ))])))); vecsort(p, , 4)}
A192392(n)={ my( d=vecsort( vector( n, i, Str( i+n*(n-1)/2 )), , 4 ), t );
for( i=1, n!, eval(concat(d))%n || break; d=precperm(d)); eval(concat(d))}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Jun 29 2011
STATUS
approved