+0  
 
0
63
4
avatar

N is a four-digit positive integer. Dividing N by 9 , the remainder is 5. Dividing N by 7, the remainder is 5. Dividing N by 5, the remainder is 1. What is the smallest possible value of  N?

 Jan 23, 2021
 #1
avatar
0

i=0;j=0;m=0;t=0;a=(9, 7, 5);r= (5,5,1);c=lcm(a); d=c / a[i];n=d % a[i] ;loop1:m++; if(n*m % a[i] ==1, goto loop, goto loop1);loop:s=(c/a[i]*r[j]*m);i++;j++;t=t+s;m=0;if(i< count a, goto4,m=m);printc,"m + ",t % c;return

 

 

OUTPUT: 315 m +  131, where m=0, 1, 2, 3........etc.

When m = 0, the smallest vlaue of N == 131

 Jan 24, 2021
 #3
avatar
+1

315m  +  131

When m = 3, [315 * 3 + 131] ==1,076 - Smallest 4-digit value of N

Guest Jan 24, 2021
 #4
avatar+112523 
0

Neat! 

Melody  Jan 24, 2021
 #2
avatar+112523 
+1

 

N is a four-digit positive integer. Dividing N by 9 , the remainder is 5. Dividing N by 7, the remainder is 5. Dividing N by 5, the remainder is 1. What is the smallest possible value of  N?

 

\(1000 \le N \le9999\)

All the pronumerals I use here are positive integers.

 

N=9k+5

N=7m+5

so

N=63T+5

(N-5)/63=T

 

\((1000-5)/63=15.7\\ (9999-5)/63=158.6\\\)

 

So T must be between 16 and 158    

 

N=5g+1

So

the last digit of N must be 1 or 6

N=63T+5

N - 5=63T

***1-5=***6        ***6-5=***1

 So the last digit of 63T must also be 6 or 1         

 

3 times what single digit ends in 6 or 1?     3*2=6,  3*7=21

So T must end in a 2 or a 7

 

So T is a number between 16 and 158 that ends in 2 or 7. 

We want the smallest one.

Try T=22       

 

 Edit:

Silly me, T=17 is the smallest that fits these restrictions and it will give N=63*17+5=1076. 

Just as our guest has already determined with his/her computer program.

 

N=63*22+5 = 1391

does this really work?

 

check:

1391 does equal 1 mod 5

1391 does equal 5 mod 9

1391 does equal 5 mod 7

 

So I believe the answer to be  N=1391

 Jan 24, 2021
edited by Melody  Jan 24, 2021

53 Online Users

avatar
avatar
avatar