Testing Kak's Conjecture on Binary Reciprocal of Primes and Cryptographic Applications
TTesting Kak’s Conjecture on Binary Reciprocal of Primes and Cryptographic Applications
Sumanth Kumar Reddy Gangasani
Oklahoma State University, Stillwater
Abstract:
This note considers reciprocal of primes in binary representation and shows that the conjecture that 0s exceed 1s in most cases continues to hold for primes less than one million. The conjecture has also been tested for ternary representation with similar results. Some applications of this result to cryptography are discussed.
Introduction
In a note nearly 25 years ago, Kak conjectured [1] that binary reciprocals of primes have an excess of zeroes. This result is surprising because the expectation is that if a large number of reciprocals of primes are tested, the frequencies of 0s and 1s should be about the same. This conjecture was based on testing primes less that 5,471. In this note we consider Kak’s conjecture for primes up to one million, showing that it continues to hold. Assuming that this property holds in general, this will have cryptographic applications. If, say, for only 3 percent of the prime reciprocals the number of 1s exceeds the number of 0s, then a randomly chosen prime will have a 3 percent chance of satisfying this property. By combining several such choices, one will be able to generate events that have a given probability and such events can be useful in cryptographic protocols for e-commerce and other applications.
Reciprocals of primes
The expansion of the reciprocal of prime is a decimal sequence [2]. For representation in an arbitrary base, the term d-sequence is used. Several cryptographic and communications properties of these sequences are known [3-9]. For maximum-length binary d-sequences, which are expansions of 1/p, p prime, for which 2 is a primitive root of p, there are the same number of 0s and 1s, and such d-sequences have good randomness properties. But for other binary d-sequences the number of 0s and 1s need not be equal. In [1] it was shown that for the first 722 primes there are only 14 anomalous ones for which the number of 1s exceeds that of 0s, which is less than 2 percent. This anomaly was found to hold for prime reciprocals in base 3 also. The binary reciprocal of prime is generated by means of the algorithm [5]: a(i) = 2 i mod p mod where p is the prime number. There is a similar formula to generate reciprocals of primes in other bases. 1 Results of Our Experiments
The main result of our experiment for primes from 7 to 999,983 is:
Table 1:
Proportion of 0s and 1s for primes less one million Cases where 0s exceed 1s 19888Cases where 1s exceed 0s 3059Equal number of 0s and 1s 55544 The proportion of cases where 1s exceed 0s is 3.9 percent whereas the number of cases where 0s exceed 1s is 25.36 percent. For better visualization, we now give the results on the difference between 0s and 1s for primes less than 65,535. As is clear from Figure 1, the cases where 0s exceed 1s are much more numerous than those where 1s exceed 0s. In Figure 2, we have only considered those cases where 1s exceed 0s and to highlight this case, the scale for the y-axis is to a smaller unit. -20020406080100
Prime No % o f o ve r Figure 1:
Plot of percentage difference of 0s and 1s in d-sequences where number of 0s and 1s are not equal (positive y-axis, 0s exceed 1s; negative y-axis, 1s exceed 0s).
On an average 46.71% of non maximum length sequences have different number of 0s and 1s when studied till primes less than 65,535 and 29.26% of all the sequences (including maximum length) have different 0s and 1s. It can be clearly seen that for Mersenne prime 8191 the number of 0s is far more than the number of 1s in the d-sequence. 2
Figure 2 presents only those cases where the number of 1s exceeds 0s. Comparing Figures 1 and 2 it is clear that the percentage difference for such cases is much smaller than for the cases where 0s exceed 1s. -9-8-7-6-5-4-3-2-10
937 4663 7351 9439 11657 12703 15583 18583 20921 24953 28351 32119 36527 38959 41047 44497 47657 50263 51871 55049 57679 60601 63097
Prime numbers % d i ff e r e n ce o f o ve r Figure 2:
Plot of percentage difference of 0s and 1s in d-sequences where number of 0s is less than number of 1s.
It is seen that in around 3.15%of all the cases 1s are greater than 0s. In other cases, 0s are either equal to 1s or exceed 1s. Table 2 summarizes the discrepancy between 0s and 1s in the binary d-sequences in various ranges.
Table 2 : Proportion of 0s and 1s in various ranges
Prime No. range 0s are greater 1s are greater ernary sequences
If one were to extend the original conjecture to ternary (base-3) sequences, one would expect the number of 0s to exceed the number of 1s and 2s. This is seen very clearly in Figures 3 and 4.
Prime No. / r a t i o Figure 3:
The ratio of 0s over 1s for prime reciprocals to base 3
Prime No. / r a t i o Figure 4:
The ratio of 0s over 2s for prime reciprocals to base 3 4 5The 0s are more numerous than 1s and 2s for a large number of cases, although as in the binary case there are situations where the reverse is true.
Conclusions
We have shown that the conjecture that 0s exceed 1s more often than the other way round for binary reciprocals of primes continues to hold for primes up to one million. The number of cases where 0s exceeded 1s was 19,888, whereas the cases where 1s exceeded 0s was only 3,059. Since this is rather surprising, it would be worthwhile to check if this conjecture holds for still greater primes. If a proof of this conjecture can be furnished that would be of much theoretical interest to number theorists and to cryptographers. Even if the conjecture does not hold for all primes but is true for primes in a certain range, one can take advantage of the result by requiring the parties in the cryptographic protocol to use primes in that range.
References S. Kak, A structural redundancy in d-sequences. IEEE Transactions on Computers, vol. C-32, pp. 1069-1070, 1983. 2.
G.H. Hardy and E.M. Wright, An Introduction to the Theory of Numbers. Oxford University Press, 1954. 3.
S. Kak and A. Chatterjee, On decimal sequences. IEEE Transactions on Information Theory, vol. IT-27, pp. 647 – 652, 1981. S. Kak, Encryption and error-correction coding using D sequences. IEEE Transactions on Computers, vol. C-34, pp. 803-809, 1985. S. Kak, New results on d-sequences. Electronics Letters, vol. 23, p. 617, 1987. 6.
D. Mandelbaum, On subsequences of arithmetic sequences. IEEE Transactions on Computers, vol. C-37, pp 1314-1315, 1988. 7.
S. Kak, A new method for coin flipping by telephone. Cryptologia, vol. 13, pp. 73-78, 1989. 8.
S.K.R. Gangasani, Testing d-sequences for their randomness, 2007. arXiv:0710.3779 9.