Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A076072
Largest multiple of n that can be formed by using the digits of the next n numbers, or 0 if no such number exists.
7
1, 32, 654, 97180, 4321111115, 987622111110, 87654322222222, 9654333333332120, 987544444443333210, 98765555555444443210, 9876666666665555524130, 988777777777776666543120, 99998888888888877654321100
OFFSET
1,2
COMMENTS
Conjecture: No entry is zero. (At least one multiple of n can be formed by using the digits of the next n numbers.)
"Next n numbers" means {1+n(n-1)/2,...,n(n+1)/2}. - M. F. Hasler, Jul 22 2011
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)} /* generic function, could be simplified/optimized for here */
A076072(n)={ my(d=vecsort(Vec(concat(vector(n, i, Str(i+n*(n-1)/2)))), , 4)); for( i=1, (#d)!, eval(concat(d))%n || break; d=precperm(d)); eval(concat(d))} \\ M. F. Hasler, Jul 24 2011
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Oct 05 2002
EXTENSIONS
More terms from David Wasserman, Mar 23 2005
STATUS
approved