cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A114342 Largest number whose base-n representation does not contain any digit more than once and which is not divisible by any of its base-n digits, or 0 if no such number exists.

This page as a plain text file.
%I A114342 #29 Mar 08 2020 11:41:09
%S A114342 0,0,0,35,577,5909,16331,2053379,42374099,987654203,2334368201,
%T A114342 736867783013,23136292864661,789018236128979,1936265501684027,
%U A114342 1147797409030816259,48471109094902544503,2178347851919531380901,5463472083532379956913,5228356786703601108032803
%N A114342 Largest number whose base-n representation does not contain any digit more than once and which is not divisible by any of its base-n digits, or 0 if no such number exists.
%D A114342 "Enigma 1343: Digital Dividend", New Scientist, Jun 04 2005, 28.
%H A114342 Enigmatic Code, <a href="https://enigmaticcode.wordpress.com/2014/03/01/enigma-1343-digital-dividend/">Enigma 1343: Digital Dividend</a>, from New Scientist, Jun 04 2005, 28.
%e A114342 There are 49 numbers whose base-4 representation does not contain repeated digits. Of these, the largest which is not divisible by any of its digits is a(4) = 203_4 = 35_10.
%e A114342 Any base-3 number containing only 0's and 2's with at least one 2 is divisible by 2, while any number with a 1 is divisible by 1, so no positive integer meets the criteria in base 3. Thus a(3) = 0.
%o A114342 (Sage)
%o A114342 def A114342(n):
%o A114342     dd = [0] + [2..n-1]
%o A114342     for width in [1..n-1][::-1]:
%o A114342         found = []
%o A114342         for dc in Combinations(dd, width):
%o A114342             m = sum(dc) % (n-1)
%o A114342             if gcd(m,n-1) in dc: continue # rule of nines
%o A114342             for p in Permutations(dc[::-1]):
%o A114342                 s = sum((d)*n**i for i,d in enumerate(p[::-1]))
%o A114342                 if not any(d != 0 and s % d == 0 for d in p): found.append(s)
%o A114342                 if found and width == len(dd): return s
%o A114342                 if found and s < max(found): break
%o A114342         if found: return max(found)
%o A114342     return 0 # _D. S. McNeil_, Oct 01 2011
%Y A114342 Cf. A113028.
%K A114342 nonn,base
%O A114342 1,4
%A A114342 Francis Carr (fcarr(AT)alum.mit.edu), Feb 08 2006
%E A114342 a(12)-a(20) from _Nathaniel Johnston_, Sep 30 2011