N is a 5-digit duodecimal prime number which consists of precisely two distinct
nonzero base-12 digits.
Determine the smallest and largest value of N.
*** N cannot admit of any leading zeros.
The smallest and largest are 10011 and bbbb7, corresponding to decimal 20749 and 248827 respectively.
There are 172 altogether:
base
12 10
10011 20749
11151 22669
11177 22699
11191 22717
111b1 22741
111bb 22751
11221 22777
11411 23053
11511 23197
11515 23201
11771 23557
11777 23563
11811 23629
11911 23773
11991 23869
11a11 23917
11b11 24061
11b1b 24071
11bb1 24181
15115 29537
15151 29581
15511 30109
15515 30113
15555 30161
16161 31321
16611 31981
17777 33931
18881 35809
19191 36541
19991 37693
1a1a1 38281
1b111 39901
1b1bb 40031
1bb11 41341
1bb1b 41351
22227 45247
22255 45281
22277 45307
22525 45677
22777 46027
27227 53887
27777 54667
2bb2b 62099
2bbbb 62207
31311 64381
33337 67867
333bb 67967
33737 68443
33777 68491
33bbb 69119
35555 71633
37337 74779
37377 74827
37777 75403
3bb3b 82847
41441 85297
44441 90481
44477 90523
44555 90641
44b4b 91499
44bbb 91583
45545 92357
45555 92369
47477 95707
4b44b 102587
51151 105613
51551 106189
52225 107453
55115 112481
55535 113081
55545 113093
5555b 113111
55565 113117
55577 113131
55595 113153
555b5 113177
55775 113417
55855 113537
55b55 113969
55bb5 114041
56555 114833
57755 116849
58885 118757
59555 120017
59995 120641
5b55b 123479
5b5bb 123551
5bb55 124337
5bb5b 124343
61661 127081
65565 133853
66565 135581
66611 135661
66661 135721
66667 135727
6666b 135731
66bbb 136511
6bb6b 145091
72227 148927
75557 154579
76777 156619
77117 157411
77171 157477
77177 157483
77277 157627
77377 157771
77711 158269
77771 158341
7777b 158351
77787 158359
77797 158371
77b77 158923
77b7b 158927
78787 160087
78887 160231
79977 162091
7a7a7 163567
7b7bb 165311
7bbb7 165883
7bbbb 165887
81811 168781
85585 175349
85885 175781
87777 179083
88181 179953
88555 180497
88585 180533
88777 180811
88bbb 181439
8b8bb 186191
8bb8b 186587
91911 189661
91991 189757
97777 199819
97997 200131
99977 203563
9999b 203591
a11a1 209353
aa111 224797
aaaa1 226201
aabbb 226367
ababb 227951
b1111 229981
b11b1 230101
b1b1b 231431
b1bbb 231551
b2bbb 233279
b333b 233759
b3bbb 235007
b5bbb 238463
b6b6b 240131
b7777 241291
b77bb 241343
b7b77 241867
b7bbb 241919
b8bbb 243647
b99bb 245087
baaab 246947
bb1b1 247381
bb1bb 247391
bb44b 247739
bb555 247889
bb66b 248051
bb777 248203
bb9bb 248543
bbb11 248701
bbb2b 248723
bbb55 248753
bbb77 248779
bbb7b 248783
bbbb1 248821
bbbb7 248827
found by
clearvars,clc
d='0123456789ab'; ct=0; solNo={};
for c1=1:12
d1=d(c1);
for c2=1:12
d2=d(c2);
if c1~=c2
for ch=1:2
idx=nchoosek(1:5,ch);
for i=1:length(idx)
nd=repmat(d2,1,5);
nd(idx(i,:))=d1;
p=base2dec(nd,12);
if isprime(p) && nd(1)~='0'
ct=ct+1;
solNo{end+1}=[char(nd) ' ' char(string(p))];
end
end
end
end
end
end
solNo=sort(solNo);
for i=1:length(solNo)
disp(solNo{i})
end
|
Posted by Charlie
on 2023-03-24 08:27:06 |