login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A359982 Numbers whose digits are distinct nonprimes and are not a permutation of a smaller such number. 0

%I #30 May 03 2023 15:02:53

%S 0,1,4,6,8,9,10,14,16,18,19,40,46,48,49,60,68,69,80,89,90,104,106,108,

%T 109,146,148,149,168,169,189,406,408,409,468,469,489,608,609,689,809,

%U 1046,1048,1049,1068,1069,1089,1468,1469,1489,1689,4068,4069,4089,4689,6089,10468,10469,10489,10689,14689,40689,104689

%N Numbers whose digits are distinct nonprimes and are not a permutation of a smaller such number.

%C The sequence consists of numbers constructed from the combination of the six nonprime digits 0,1,4,6,8,9 without duplication of the digits. Hence there are 2^6 - 1 = 63 terms.

%e 10 is in the sequence as both 1 and 0 are nonprime, all digits are distinct, and no permutation of those digits yields a smaller number (with no leading 0's).

%e 14 is in the sequence as both 1 and 4 are nonprime, all digits are distinct, and no permutation of those digits yields a smaller number.

%e 41 is not in the sequence as 14 is a permutation of its digits and is a smaller number.

%e 189 is in the sequence, so its permutations 198, 819, 891, 918 and 981, all of which are larger, are not.

%e 104689 is in the sequence as all digits are nonprime and distinct, and no permutation of those digits yields a smaller number (with no leading 0's).

%p sort(map(x-> parse(cat(`if`(nops(x)>1 and x[1]=0,

%p [x[2], x[1], x[3..-1][]], x)[])), [seq(combinat[choose]

%p ([0, 1, 4, 6, 8, 9], i)[], i=1..6)]))[]; # _Alois P. Heinz_, Jan 27 2023

%o (Python)

%o import itertools

%o nums, combinations, flat_list = [0,1,4,6,8,9],[],[]

%o for r in range(len(nums)+1):

%o for combination in itertools.combinations(nums, r):

%o combinations.append(list(combination))

%o for var in range(len(combinations)):

%o subitems=""

%o if (len(combinations[var]) > 1 and combinations[var][0] == 0) :

%o combinations[var][0], combinations[var][1] = combinations[var][1], combinations[var][0]

%o for sub in combinations[var]:

%o subitems += str(sub)

%o flat_list.append(int(subitems))

%o print(sorted(set(flat_list)))

%Y Cf. A062115 (no prime substring), A124673 (distinct prime digits).

%K nonn,base,fini,full

%O 1,3

%A _Glen Gilchrist_, Jan 20 2023

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 22 11:23 EDT 2024. Contains 374490 sequences. (Running on oeis4.)