Soluții

How to protect PDF File with password using Microsoft Office’s In-built Tools

PDF is one of the most secure and reliable file formats to share your work with people. You can even increase its security by encrypting it with a password to prevent unauthorized access. You can create and secure your own PDF file with the help of Microsoft’s in-built features that come pre-installed with the Office Suite. With the help of Microsoft Word, you can create a PDF file and encrypt it by adding a password to it.

[mai mult...]

Check if all digits of a number divide it with Python3

Given a number n, find whether all digits of n divide it or not.

Examples:

Input : 128
Output : Yes
128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.

Input : 130
Output : No

We want to test whether each digit is non-zero and divides the number. For example, with 128, we want to test d != 0 && 128 % d == 0 for d = 1, 2, 8. To do that, we need to iterate over each digit of the number.

[mai mult...]

Python Script for Number of solutions to Modular Equations

Given A and B, the task is to find the number of possible values that X can take such that the given modular equation (A mod X) = B holds good. Here, X is also called a solution of the modular equation.

Examples:

Input : A = 26, B = 2
Output : 6
Explanation
X can be equal to any of {3, 4, 6, 8,
12, 24} as A modulus any of these values
equals 2 i. e., (26 mod 3) = (26 mod 4) 
= (26 mod 6) = (26 mod 8) =Output:2 

Input : 21 5
Output : 2
Explanation
X can be equal to any of {8, 16} as A modulus 
any of these values equals 5 i.e. (21 mod 
8) = (21 mod 16) = 5
[mai mult...]

Python Script for Legendre’s Conjecture

Conjecture: A conjecture is a proposition or conclusion based upon incompleate information to which no proof has been found i.e it has not been proved or disproved.

Mathematically,
there is always one prime p in the range n^2 to (n + 1)^2 where n is any natural number.

for examples:
2 and 3 are the primes in the range 1^2 to 2^2.

5 and 7 are the primes in the range 2^2 to 3^2.

11 and 13 are the primes in the range 3^2 to 4^2.

17 and 19 are the primes in the range 4^2 to 5^2.

[mai mult...]