Find a 13 digit positive integer N whose base ten representation consists entirely of 7s and 8s such that 313 divides N.
list=[];
for n=0:8191
ns=dec2bin(n,13);
N=str2double(char(ns+7));
m=mod(N,3^13);
if ~ismember(mod(N,3^13),list)
list(end+1)=mod(N,3^13);
end
% disp(mod(N,3^13))
if mod(N,3^13)==0
disp(N)
end
end
length(list)
min(list)
max(list)
3^13-max(list)
checks all such numbers and finds no such divisible number.
The output
ans =
8100
ans =
303
ans =
1588566
ans =
5757
shows there are 8100 different values mod 3^13, the smallest being 303 and the largest 1588566, which is 5757 short of being congruent to zero.
The numbers that lead to the lowest and highest mod values are 8877888777777 and 8788888878888.
|
Posted by Charlie
on 2024-11-20 13:45:56 |