A177834 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.
1, 2, 6, 12, 45, 54, 56, 56, 245, 504, 1440, 1440, 5044, 5044, 10456, 10569, 11704, 11704, 11704, 13608, 13608, 13608, 26460, 26460, 198007, 258064, 264600, 264600, 475440, 475440, 1754608, 1754608, 2258064, 2258064, 2646004, 2646004, 2992520
Offset: 1
Examples
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.
Links
- Robert Gerbicz, Table of n, a(n) for n = 1..102
Programs
-
Mathematica
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 *)
-
Python
def substrings(n): # returns set of nonzero substrings of n s = str(n) ss = (s[i:j] for i in range(len(s)) for j in range(i+1, len(s)+1)) return set(int(sij) for sij in ss) - {0} def a(n, startk=1): k = startk while True: subsk = substrings(k) if all(any(kij%m == 0 for kij in subsk) for m in range(1, n+1)): return k k += 1 def afind(): n, an = 1, 1 while True: n, an = n+1, a(n, startk=an) print(an, end=", ") afind() # Michael S. Branicky, Jan 22 2022
Extensions
Edited by N. J. A. Sloane, May 28 2010
a(1)-a(37) confirmed by Zak Seidov, May 28 2010
Comments