login
Opmanis's sequence: a(n) is the smallest integer k such that k or one of its nonzero substrings (regarded as an integer) is divisible by every integer in the range 1 through n.
6

%I #21 Jan 22 2022 09:38:55

%S 1,2,6,12,45,54,56,56,245,504,1440,1440,5044,5044,10456,10569,11704,

%T 11704,11704,13608,13608,13608,26460,26460,198007,258064,264600,

%U 264600,475440,475440,1754608,1754608,2258064,2258064,2646004,2646004,2992520

%N Opmanis's sequence: a(n) is the smallest integer k such that k or one of its nonzero substrings (regarded as an integer) is divisible by every integer in the range 1 through n.

%C Comment from _N. J. A. Sloane_, May 28 2010: (Start)

%C The factorizations of the initial terms are:

%C 1, 2, 2*3, 2^2*3, 3^2*5, 2*3^3, 2^3*7, 2^3*7, 5*7^2, 2^3*3^2*7, 2^5*3^2*5, 2^5*3^2*5, 2^2*13*97, 2^2*13*97, 2^3*1307, 3*13*271, 2^3*7*11*19,

%C 2^3*7*11*19, 2^3*7*11*19, 2^3*3^5*7, 2^3*3^5*7, 2^3*3^5*7, 2^2*3^3*5*7^2, 2^2*3^3*5*7^2, 23*8609, 2^4*127^2, 2^3*3^3*5^2*7^2, 2^3*3^3*5^2*7^2, 2^4*3*5*7*283,

%C 2^4*3*5*7*283, 2^4*109663, 2^4*109663, 2^4*3^3*5227, 2^4*3^3*5227, 2^2*139*4759, 2^2*139*4759, 2^3*5*79*947, ...

%C The name "Opmanis's sequence" is due to _N. J. A. Sloane_, not the author. (End)

%H Robert Gerbicz, <a href="/A177834/b177834.txt">Table of n, a(n) for n = 1..102</a>

%e a(8)=56 because 56 is divisible by 1,2,4,7,8; 5 is divisible by 5; 6 is divisible by 3 and 6. Therefore the set {1,2,3,4,5,6,7,8} is covered by the divisors. 56 is the smallest number with this property.

%t k = 1; lst = {}; mx = 0; f[n_] := Block[{a, d, id = IntegerDigits@ n}, a = Complement[ Union[ FromDigits /@ Flatten[ Table[ Partition[ id, k, 1], {k, Length@ id}], 1]], {0}]; d = Union[ Flatten[ Divisors /@ a]]; Complement[ Range@ 100, d][[1]] - 1]; While[k < 3000000, a = f@k; If[a > mx, Print[{a, k}]; AppendTo[lst, k]; mx = a]; k++ ] (* _Zak Seidov_ & _Robert G. Wilson v_, May 30 2010 *)

%o (Python)

%o def substrings(n): # returns set of nonzero substrings of n

%o s = str(n)

%o ss = (s[i:j] for i in range(len(s)) for j in range(i+1, len(s)+1))

%o return set(int(sij) for sij in ss) - {0}

%o def a(n, startk=1):

%o k = startk

%o while True:

%o subsk = substrings(k)

%o if all(any(kij%m == 0 for kij in subsk) for m in range(1, n+1)):

%o return k

%o k += 1

%o def afind():

%o n, an = 1, 1

%o while True:

%o n, an = n+1, a(n, startk=an)

%o print(an, end=", ")

%o afind() # _Michael S. Branicky_, Jan 22 2022

%Y Cf. A003418 (a weak upper bound), A169819, A169858.

%K nonn,base,nice

%O 1,2

%A _Martins Opmanis_, May 14 2010

%E Edited by _N. J. A. Sloane_, May 28 2010

%E a(1)-a(37) confirmed by _Zak Seidov_, May 28 2010