A055085 Smallest integer containing all digits in all bases from 2 to n.
2, 11, 75, 978, 8350, 160773, 2217404, 45623244, 1093265784, 37206483195, 1587937206284, 109746121381518, 2697545063614180, 64810523515743579, 21538286780426129155
Offset: 2
Examples
75 is the smallest integer containing 0 and 1 in base 2 (1001011), 0, 1 and 2 in base 3 (2210) and 0, 1, 2 and 3 in base 4 (1023), hence a(4) = 75. a(12) = 1587937206284 is 217904B5A638 in base 12; 562493178A90 in base 11.
Links
- Project Euler, Problem 571: Super Pandigital Numbers
Crossrefs
A051640 uses a weaker definition.
Programs
-
PARI
isok(i, n) = {for (b = 2, n, if (#Set(digits(i, b)) != b, return (0));); return (1);} a(n) = {i = n^(n-1); while (! isok(i, n), i++); i;} \\ Michel Marcus, Nov 10 2013
-
Python
from itertools import count, product from sympy.utilities.iterables import multiset_permutations from gmpy2 import digits, mpz def A055085(n): # assumes n <= 62 dlist = tuple(digits(d,n) for d in range(n)) for l in count(n-1): for t in product(dlist,repeat=l-n+1): for d in range(1,n): for u in multiset_permutations(sorted(t+dlist[:d]+dlist[d+1:])): m = mpz(''.join((dlist[d],)+tuple(u)),n) for b in range(n-1,1,-1): if len(set(digits(m,b))) < b: break else: return int(m) # Chai Wah Wu, Mar 14 2022
Extensions
a(11) from David Wasserman, Mar 25 2002
a(12) from Tom Womack (tom(AT)womack.net), Jun 19 2007
a(13)-a(15) from Ignat Soroko, Jan 05 2017
a(16) from Ignat Soroko, Aug 14 2017
Comments