EUROPEAN JOURNAL OF PURE AND APPLIED MATHEMATICS 2025, Vol. 18, Issue 4, Article Number 6605 ISSN 1307-5543 – ejpam.com Published by New York Business Global On Generalized Mersenne Numbers and Extended Fermat Numbers Shefa A. Bani Melhem1,∗, Ala’a Al-Kateeb1,∗, Afnan Dagher1 1 Department of Mathematics, Faculty of Science, Yarmouk University, Irbid, Jordan Abstract. In this paper, we study a generalization of Mersenne numbers and we introduce an extension of Fermat numbers, we find their generating functions binet formulas, related matrix representation and many other properties. Also, we provide some applications in cryptography. 2020 Mathematics Subject Classifications: 11B39, 11B83 Key Words and Phrases: Mersenne and Fermat numbers, generating function, Binet formula, key exchange and authentication protocols 1. Introduction Fibonacci and Lucas integer sequences and their generalization/ extensions have many interesting properties and have been heavily studied [1–5]. The Fibonacci/ Lucas se- quences are given by the following recurrence relations: Fn = Fn−1 + Fn−2, Ln = Ln−1 + Ln−2 where n ≥ 2, F0 = 0, F1 = 1 and L0 = 2, L1 = 1. There are other Fibonacci and Lucas type sequences such as: • Pell and Pell-Lucas numbers: Pn = 2Pn−1 + Pn−2;Qn = 2Qn−1 + Qn−2, where n ≥ 2, P0 = 0, P1 = 1, Q0 = Q1 = 1. • Jacobsthal and Jacobsthal-Lucas numbers: Jn = Jn−1 + 2Jn−2; jn = jn−1 + 2jn−2, where n ≥ 2, J0 = 0, J1 = 1, j0 = j1 = 2. ∗Corresponding author. ∗Corresponding author. DOI: https://doi.org/10.29020/nybg.ejpam.v18i4.6605 Email addresses: shefa.bm@yu.edu.jo (Sh. A. Bani Melhem), alaa.kateeb@yu.edu.jo (Al-Kateeb), afnand@yu.edu.jo (A. Dagher) https://www.ejpam.com 1 Copyright: © 2025 The Author(s). (CC BY-NC 4.0) Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 2 of 15 All listed above sequences satisfy a set of common properties and identities, for example Bi- net formulas, Catalan and Cassini’s identities. Recently, these sequences were generalized or extended by many authors. Mersenne numbers are given by the formula Mn = 2n − 1 or using the recurrence relation Mn+2 = 3Mn+1−2Mn, where n ≥ 2,M0 = 0 and M1 = 1. Also, Fermat numbers are given by Fn = 22 n +1. Next we define the generalized Mersenne and extended Fermat numbers, which are the main interests of this paper. Definition 1. Let k ≥ 3, n ≥ 2 be two integers. We define the generalized Mersenne and extended Fermat numbers respectively by Mk,n = kMk,n−1 + (1 − k)Mk,n−2, Fk,n = kFk,n−1 + (1 − k)Fk,n−2 where Mk,0 = 0,Mk,1 = 1 and Fk,0 = 2, Fk,1 = 3. Remark 1. The sequence Mk,n was introduced and studied before in [6]. The search for Mersenne primes is an active field in number theory, since each even perfect number equals 2k−1Mk, where Mk is a prime Mersenne number. Fermat primes are useful in generating pseudo-random sequences of numbers an important application in computer science and cryptography, also they are important for some integer factor- ization algorithms like in [7, 8], the new defined sequences maybe used to improve such algorithms. In this paper we introduce and study a generalization to the Mersenne and extended Fermat numbers. This paper is structured as follows in section 2 we introduce the generalized Mersenne and extended Fermat numbers and derive their generating func- tions and Binet formulas, in section 3 we find more other properties, in section 4 we find the generating matrices of the generalized Mersenne and extended Fermat numbers, also we present some results involving Mersenne numbers and some tridiagonal and Hessenberg matrices, finally, in the last section we gave two applications of the generalized Mersenne numbers matrices in cryptography, namely we present a key-exchange protocol and an authentication scheme using matrices. 2. Basic Properties Theorem 1 (Generating functions). The generating functions of the sequences Mk,n and Fk, n respectively are (i) M(x) = x 1−kx+(k−1)x2 (ii) F (x) = 2+(3−2k)x 1−kx+(k−1)x2 Proof. Let M(x) represents the generating functions of Mk,n. Note, M(x) = ∞∑ n=0 Mk,nx n Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 3 of 15 = Mk,0 + Mk,1x + ∞∑ n=2 Mk,nx n = x + ∞∑ n=2 (kMk,n−1 + (1 − k)Mk,n−2)x n = x + kx ∞∑ n=0 Mk,nx n + (1 − k)x2 ∞∑ n=0 Mk,nx n Thus, x = (1− kx− (1− k)x2)M(x) ⇒ M(x) = x 1−kx+(k−1)x2 . Similarly we can prove the theorem for F (x). F (x) = ∞∑ n=0 Fk,nx n = Fk,0 + Fk,1x + ∞∑ n=2 Fk,nx n = 2 + 3x + ∞∑ n=2 (kFk,n−1 + (1 − k)Fk,n−2)x n = 2 + 3x− 2kx + kx ∞∑ n=0 Fk,nx n + (1 − k)x2 ∞∑ n=0 Fk,nx n Thus, 2 + (3 − 2k)x = (1 − kx− (1 − k)x2)F (x) ⇒ F (x) = 2+(3−2k)x 1−kx+(k−1)x2 . Theorem 2 (Binet formula). The n-th terms of the generalized Mersenne and extended Fermat sequences are given by Mk,n = (k − 1)n − 1 k − 2 and Fk,n = (k − 1)n + 2k − 5 k − 2 Proof. A proof for Mk,n can be found in [6], the formula for Fk,n can be proved easily by induction. Proposition 1. For n > 1 we have Fk,n = Mk,n + 2 Proof. Immediate from the Binet formulas. Theorem 3 (Catalan’s identity). We have Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 4 of 15 • Mk,n−rMk,n+r −M2 k,n = −(k − 1)n−rM2 k,r • Fk,n−rFk,n+r − F 2 k,n = (2k − 5)(k − 1)n−rM2 k,r Proof. • Mk,n−rMk,n+r −M2 k,n = (k − 1)n−r − 1 (k − 2) (k − 1)n+r − 1 (k − 2) − ( (k − 1)n − 1 (k − 2) )2 = (k − 1)2n − (k − 1)n−r − (k − 1)n+r + 1 (k − 2)2 − (k − 1)2n − 2(k − 1)n + 1 (k − 2)2 = −(k − 1)n−r − (k − 1)n+r + 2(k − 1)n (k − 2)2 = −(k − 1)n−r 1 + (k − 1)2r − 2(k − 1)r (k − 2)2 = −(k − 1)n−rM2 k,r • Fk,n−rFk,n+r − F 2 k,n = (k − 1)n−r + 2k − 5 k − 2 (k − 1)n+r + 2k − 5 k − 2 − ( (k − 1)n + 2k − 5 k − 2 )2 = (k − 1)2n + (2k − 5)(k − 1)n−r + (2k + 5)(k − 1)n+r + (2k + 5)2 (k − 2)2 − (k − 1)2n + 2(2k − 5)(k − 1)n + (2k − 5)2 (k − 2)2 = (2k − 5)(k − 1)n−r + (2k + 5)(k − 1)n+r − 2(2k − 5)(k − 1)n (k − 2)2 = (2k − 5)(k − 1)n−r 1 + (k − 1)2r − 2(k − 1)r (k − 2)2 = (2k − 5)(k − 1)n−rM2 k,r. Theorem 4 (d’Ocagne’s identity). If ℓ ≥ n, then • Mk,ℓMk,n+1 −Mk,ℓ+1Mk,n = (k − 1)nMk,ℓ−n. • Fk,ℓFk,n+1 − Fk,ℓ+1Fk,n = −(5 − 2k)(k − 1)nMk,ℓ−n. Proof. • Mk,ℓMk,n+1 −Mk,ℓ+1Mk,n = (k − 1)ℓ − 1 (k − 2) (k − 1)n+1 − 1 (k − 2) − (k − 1)ℓ+1 − 1 (k − 2) (k − 1)n − 1 (k − 2) Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 5 of 15 = (k − 1)ℓ+1 − (k − 1)ℓ − (k − 1)n+1 + (k − 1)n (k − 2)2 = (k − 1)ℓ(k − 2) − (k − 1)n(k − 2) (k − 2)2 = (k − 1)n (k − 1)ℓ−n − 1 k − 2 = (k − 1)nMk,ℓ−n • Fk,ℓFk,n+1 − Fk,ℓ+1Fk,n = (k − 1)ℓ + 2k − 5 (k − 2) (k − 1)n+1 + 2k − 5 (k − 2) − (k − 1)ℓ+1 + 2k − 5 (k − 2) (k − 1)n + 2k − 5 (k − 2) = (2k − 5) −(k − 1)ℓ+1 + (k − 1)ℓ + (k − 1)n+1 − (k − 1)n (k − 2)2 = (2k − 5) (k − 1)ℓ(2 − k) + (k − 1)n(k − 2) (k − 2)2 = (2k − 5) (k − 1)n − (k − 1)ℓ (k − 2) = (2k − 5)(k − 1)n 1 − (k − 1)ℓ−n (k − 2) = −(5 − 2k)(k − 1)nMk,ℓ−n. Theorem 5 (Vajda’s identity). (i) (Formulation 1) Mk,n+iMk,n+j −Mk,nMk,n+i+j = (k − 1)nMk,iMk,j (ii) (Formulation 2) Mk,n+jMk,m−j −Mk,nMk,m = (k − 1)nMk,m−n−jMk,j Proof. (i) (Formulation 1) Mk,n+iMk,n+j −Mk,nMk,n+i+j = (k − 1)n+i − 1 (k − 2) (k − 1)n+j − 1 (k − 2) − (k − 1)n − 1 (k − 2) (k − 1)n+i+j − 1 (k − 2) = (k − 1)n − (k − 1)n+i − (k − 1)n+j + (k − 1)n+i+j (k − 2)2 = (k − 1)n 1 − (k − 1)i − (k − 1)j + (k − 1)i+j (k − 2)2 = (k − 1)n 1 − (k − 1)i − (k − 1)j(1 − (k − 1)i) (k − 2)2 Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 6 of 15 = (k − 1)n (1 − (k − 1)i)(1 − (k − 1)j) (k − 2)2 = (k − 1)nMk,iMk,j (ii) (Formulation 2) Mk,n+iMk,m−j −Mk,nMk,m = (k − 1)n+j − 1 (k − 2) (k − 1)m−j − 1 (k − 2) − (k − 1)n − 1 (k − 2) (k − 1)m − 1 (k − 2) = (k − 1)m − (k − 1)m−j − (k − 1)n+j + (k − 1)n (k − 2)2 = (k − 1)n 1 − (k − 1)m−n−j + (k − 1)j((k − 1)m−n−j − 1) (k − 2)2 = (k − 1)nMk,m−n−jMk,j Theorem 6 (Sum of terms). If n ≥ 2, then (i) ∑n i=0Mk,i = 1 k−2(Mk,n+1 − n− 1) (ii) ∑n i=0 Fk,i = 1 k−2(Fk,n+1 − 2 + (n + 1)(2k − 5)) = 1 k−2(Mk,n+1 + (n + 1)(2k − 5)) (iii) ∑n i=0Mk,2i = 1 k−2( 1kMk,2(n+1) − n− 1) (iv) ∑n i=0 Fk,2i = 1 k−2( 1kMk,2(n+1)+(n+1)(2k−5)) = 1 k−2( 1k (Fk,2(n+1)−2)+(n+1)(2k−5)) Proof. (i) n∑ i=0 Mk,i = n∑ i=0 (k − 1)i − 1 k − 2 = 1 (k − 2) ( 1 − (k − 1)n+1 2 − k − (n + 1) ) , geometric series = 1 k − 2 (Mk,n+1 − n− 1) (ii) n∑ i=0 Fk,i = n∑ i=0 (k − 1)i + (2k − 5) k − 2 = 1 (k − 2) ( 1 − (k − 1)n+1 2 − k + (n + 1)(2k − 5) ) , geometric series = 1 k − 2 (Fk,n+1 − 2 + (n + 1)(2k − 5)) = 1 k − 2 (Mk,n+1 + (n + 1)(2k − 5)) Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 7 of 15 (iii) n∑ i=0 Mk,2i = n∑ i=0 ((k − 1)2)i − 1 k − 2 = 1 (k − 2) ( 1 − ((k − 1)2)n+1 1 − (k − 1)2 − (n + 1) ) , geometric series = 1 (k − 2) ( 1 − ((k − 1)2n+2 k(2 − k) − (n + 1) ) = 1 k − 2 ( 1 k Mk,n+1 − n− 1) (iv) n∑ i=0 Fk,2i = n∑ i=0 ((k − 1)2)i + (2k − 5) k − 2 = 1 (k − 2) ( 1 − ((k − 1)2)n+1 1 − (k − 1)2 + (n + 1)(2k − 5) ) , geometric series = 1 (k − 2) ( 1 − ((k − 1)2n+2 k(2 − k) + (n + 1)(2k − 5) ) = 1 k − 2 ( 1 k Mk,2(n+1) + (n + 1)(2k − 5)) = 1 k − 2 ( 1 k (Fk,2(n+1) − 2) + (n + 1)(2k − 5)) Lemma 1. We have limn→∞ Mk,n+1 Mk,n = k − 1. Proof. limn→∞ Mk,n+1 Mk,n = limn→∞ (k−1)n+1−1 k−2 · k−2 (k−1)n−1 = limn→∞ (k−1)n+1(1− 1 (k−1)n+1 ) (k−1)n(1− 1 (k−1)n ) = k − 1 Lemma 2. The series ∑∞ n=0 1 Mk,n is a convergent series. Proof. By ratio test limn→∞ Mk,n Mk,n+1 = 1 k−1 < 1, so the series is convergent, Lemma 3. The series ∑∞ n=1 Mk,n kn = k k−1 . Proof. Let S = ∑∞ n=1 Mk,n kn . Then ∞∑ n=1 Mk,n kn = 1 k + ∞∑ n=2 Mk,n kn Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 8 of 15 = 1 k + ∞∑ n=1 Mk,n+1 kn+1 = 1 k + ∞∑ n=1 kMk,n + (1 − k)Mk,n−1 kn+1 = 1 k + ∞∑ n=1 Mk,n kn + (1 − k) k2 ∞∑ n=1 Mk,n−1 kn−1 = 1 k + S + (1 − k) k2 ∞∑ n=0 Mk,n kn = 1 k + S + (1 − k) k2 S Thus, S = k k−1 . We need the next remark in the proof of the next theorem. In fact it is exercise 16 in section 3.3 in [9]. Remark 2. For any three integers a, b and c such that gcd(a, b) = gcd(a, c) = 1, we have gcd(a, bc) = 1 Theorem 7. For n ≥ 1, we have (i) gcd(Mk,n, k − 1) = 1 (ii) gcd(Mk,n, k) = { 1, if n is odd k, if n is even (iii) gcd(Mk,n,Mk,n+1) = 1 (iv) gcd(Fk,n, k − 1) = 1 (v) gcd(Fk,n, k) = { gcd(3, k), if n is odd gcd(2, k), if n is even (vi) gcd(Fk,n, Fk,n+1) = 1 Proof. (i) We prove this property using mathematical induction. At first gcd(Mk,1, k − 1) = gcd(1, k − 1) = 1. Assume that gcd(Mk,n, k − 1) = 1, consider gcd(Mk,n+1, k − 1) = gcd(kMk,n + (1−k)Mk,n−1, k−1) = gcd(kMk,n, k−1) = gcd(Mk,n, k−1) = 1, using the well-known property gcd(a + bc, b) = gcd(a, b) Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 9 of 15 (ii) We prove this property using mathematical induction. At first gcd(Mk,1, k) = 1 and gcd(Mk,2, k) = 2. Assume that gcd(Mk,n, k) = { 1, if n is odd k, if n is even , now consider gcd(Mk,n+1, k) = gcd(kMk,n + (1 − k)Mk,n−1, k) = gcd((1 − k)Mk,n−1, k) = gcd(Mk,n−1, k) = { 1, if n− 1 is odd k, if n− 1 is even = { 1, if n + 1 is odd k, if n + 1 is even as desired. (iii) The result is clear for n = 1, so we proceed by mathematical induction. Let d = gcd(Mk,n+1,Mk,n+2). We have d|Mk,n+1 and d|Mk,n+2 so it divides any lin- ear combination of them that is d|(Mk,n+2 − kMk,n+1) = (1 − k)Mk,n Thus, d|(gcd(Mk,n+1, (1 − k)Mk,n)). Now, from Remark 2 and part 1 we have gcd(Mk,n+1, (1 − k)Mk,n) = 1 which leads to the fact that d = 1. (iv) Similar to number 1 above. (v) Similar to number 2 above. (vi) Similar to number 3 above. Lemma 4. If k is even, then gcd(Mk,n, Fk,n) = { 1, if n is odd 2, if n is even Proof. Recall that Fk,n = Mk,n + 2 (Proposition 1), also if k is even we have Mk,n ≡ n mod 2, thus gcd(Mk,n, Fk,n) = { 1, if n is odd 2, if n is even , as desired. Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 10 of 15 3. Matrix representations Theorem 8 (Matrix of generalized Mersenne numbers). Let Qk = [ 0 1 1 − k k ] . Then for n ≥ 2 we have Qn k = [ (1 − k)Mk,n−1 Mk,n (1 − k)Mk,n Mk,n+1 ] Proof. We prove the result by mathematical induction: • If n = 2, we have Q2 k = [ 1 − k k k(1 − k) k2 + (1 − k)2 ] = [ (1 − k)Mk,1 Mk,2 (1 − k)Mk,2 Mk,3 ] • Assuming that the result is true for all 2 ≤ m ≤ n. • Consider Qn+1 k = QkQ n k = [ 0 1 1 − k k ] [ (1 − k)Mk,n−1 Mk,n (1 − k)Mk,n Mk,n+1 ] = [ (1 − k)Mk,n Mk,n+1 (1 − k)Mk,n+1 Mk,n+2 ] as desired. Lemma 5. For any integers m and n and k ≥ 2 we have (i) Mk,n+m = (1 − k)Mk,n−1Mk,m + Mk,nMk,m+1. (ii) Mk,n+m+1 = (1 − k)Mk,nMk,m + Mk,n+1Mk,m+1. (iii) Mk,2n = (1 − k)Mk,n−1Mk,n + Mk,nMk,n+1. (iv) Mk,2n+1 = (1 − k)M2 k,n + M2 k,n+1. Proof. Consider Qn+m k = Qn kQ m k = [ (1 − k)Mk,n+m+1 Mk,n+m (1 − k)Mk,n+m Mk,n+m+1 ] = [ (1 − k)Mk,n−1 Mk,n (1 − k)Mk,n Mk,n+1 ] [ (1 − k)Mk,m−1 Mk,m (1 − k)Mk,m Mk,m+1 ] we get 1 and 2 from equating the corresponding entries of the equal matrices. Also, we get 3 and 4 by letting m = n in 1 and 2. Lemma 6 (Matrix of Extended Fermat Numbers ). Let Rk = [ 2 3 3 2 + k ] . Then Qn kRk = [ Fk,n Fk,n+1 Fk,n+1 Fk,n+2 ] Proof. Can be proved easily by mathematical induction. Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 11 of 15 4. Special Kind of Tridiagonal and Hessenberg matrices A tridiagonal matrix is a matrix that has nonzero elements only on the main diagonal and on the first diagonal below and above the main diagonal. In this subsection we represent some tridiagonal matrices whose determinant or permanent is a generalized Mersenne number. Lemma 7. Suppose that n ≥ 1 is an integer. (i) Let Nn(k) =  k k − 1 0 · · · · · · · · · · · · 0 −1 k 1 − k 0 · · · · · · · · · 0 0 −1 k 1 − k · · · · · · · · · 0 0 0 −1 k 1 − k · · · · · · 0 ... ... ... ... ... ... ... ... 0 ... −1 k  Then det(Nn) = Mk,n+1. (ii) Let Hn(k) =  0 1 0 · · · · · · · · · · · · 0 −1 0 1 − k 0 · · · · · · · · · 0 0 −1 k 1 − k · · · · · · · · · 0 0 0 −1 k 1 − k · · · · · · 0 ... ... ... ... ... ... ... 0 0 · · · · · · · · · · · · · · · −1 k  . Then det(Hn) = Mk,n. Proof. Clear from Section 2.1 and 2.2 in [3] Lemma 8. Suppose that n ≥ 1 is an integer. Let Tn(k) =  k 1 0 · · · · · · · · · · · · 0 k − 1 k 1 0 · · · 0 0 k − 1 k 1 0 ... 0 ... ... ... ... ... 0 ... k − 1 k . Then det(Tn) = Mk,n+1. Proof. Let α = k − 1, β = 1. Then Mk,n = αn−βn α−β , following the work of Kilic and Tasci in [10, 11] we have det(Tn) = Mk,n+1. Finally, we use Theorems 1-3 from [10] to get the following result. Lemma 9. We have (i) Let An(k) =  k 1 − k 0 ... ... ... 0 1 k 1 − k 0 ... 0 0 1 k 1 − k 0 ... 0 ... ... ... ... ... 0 ... 1 k . Then per(An) = Mk,n+1. Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 12 of 15 (ii) Let Hn(k) =  k 1 − k 0 ... ... 0 1 0 0 0 0 0 0 An(k) 0 · · · 0 0 0 · · · 0 . Then per(Hn) = ∑i=0 n Mk,i where n ≥ 2 and An(k) defined as the last part. (iii) Let Gn(k) =  1 1 1 ... ... ... 1 −1 k 1 − k 0 ... 0 0 −1 k 1 − k 0 ... 0 ... ... ... ... ... 0 ... −1 k . Then det(Gn) = ∑i=0 n Mk,i where n ≥ 2. Proof. Using α = k − 1, β = 1 and Mk,n = αn−βn α−β (i) Statement 1 is true by Theorem 1 from [10]. (ii) Statement 2 is true by Theorem 2 from [10]. (iii) Statement 3 is true by Theorem 3 from [10]. 5. Some Applications In this section we give two applications in cryptography for the matrix representation of Mk,m, which was found in Section 3. 5.1. An authentication protocol In this section we will introduce an authentication protocol based on matrices. At first, Alice chooses a large integer n = pq a product of two primes and an integer k > 2. Then Alice chooses two matrices A = Qn1 k and B = Qn2 k and computes their squares modulo n. Namely, C = A2 = Q2n1 k mod n and D = B2 = Q2n2 k mod n. Alice publishes C and D. The method works as follows: Algorithm 1. (i) Alice chooses two random integers m1,m2 and finds the matrices X1 = Qm1 k , X2 = Qm2 k . Then she computes Y1 = X2 1 mod n and Y2 = X2 2 mod n and sends Y1, Y2 to Bob. (ii) Bob chooses two random numbers v1, v2 ∈ {0, 1} and sends them to Alice. (iii) Alice computes Z = X1X2A v1Bv2 mod n and send it to Bob. (iv) Bob verifies the identity of Alice by checking that Z2 = Y1Y2C v1Dv2 (v) Bob asks Alice to send him one of X1 or X2 and he checks that Y1 = X2 1 or Y2 = X2 2 . Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 13 of 15 Example 1. Let n = 11 · 13 = 143, and k = 5. If Alice takes on n1 = 2 and n2 = 3. Then A = [ 139 5 123 21 ] and B = [ 123 21 59 85 ] . Also, we have C = A2 = [ 59 85 89 55 ] and D = B2 = [ 66 78 117 27 ] (i) Alice chooses two random integers m1 = 3,m2 = 4 and finds the matrices X1 = Qm1 5 = [ 123 21 59 85 ] X2 = Qm2 5 = [ 59 85 89 55 ] Then she computes Y1 = X2 1 = [ 66 78 117 27 ] and Y2 = X2 2 = [ 35 109 136 8 ] and sends Y1, Y2 to Bob. (ii) Bob chooses two random numbers v1 = 0, v2 = 1 and sends them to Alice. (iii) Alice computes Z = X1X2A v1Bv2 mod n = [ 111 33 11 133 ] and send it to Bob. (iv) Bob verifies the identity of Alice by checking that Z2 = Y1Y2C v1Dv2 = [ 100 44 110 34 ] (v) Bob asks Alice to send him one of X1 or X2 and he checks that Y1 = X2 1 or Y2 = X2 2 . We should mention that it is very hard to know the matrices A and B from C and D. Also, be choosing a very large number the problem will be more and more harder. 5.2. A Key Exchange Protocol In this section we propose a key exchange protocol based on matrices At first Alice and Bob choose and integer n = pq and k > 2 . Then they choose a 2 × 2 matrix A The protocol works as follows: Algorithm 2. (i) Alice selects an integer t > 0 and a secret matrix B = Qn1 k mod n that doesn’t commute with A. She computes X1 = AtB mod n and send it to Bob. (ii) Bob chooses an integer s > 0 and a secret matrix C = Qn2 k mod n that doesn’t commute with A and computes X2 = AsC mod n and send it to Alice. (iii) Alice computes KA = AtX2B mod n. Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 14 of 15 (iv) Bob computes KB = AsX1C mod n we have KA = KB = K. Example 2. Let k = 4 and A = [ 1 2 3 4 ] . (i) Alice selects an integer t = 3 and computes B = Q3 k = [ 131 13 104 40 ] which doesn’t commute with A. She computes X1 = AtB = [ 24 67 3 53 ] and send it to Bob. (ii) Bob chooses s = 7 and find C = Q5 k mod n = [ 23 121 66 78 ] which doesn’t commute with A and computes X2 = AsC = [ 130 42 85 72 ] and send it to Alice. (iii) Alice computes KA = AtX2B = [ 1 112 111 29 ] . (iv) Bob computes KB = AsX1C = [ 1 112 111 29 ] 6. Conclusion In this paper we consider a generalization of Merssen and Fermat numbers into complex numbers, we derive some properties of the new sequence. For future work we may consider more generalizations and extensions of such sequence and try to relate them with real life applications. Acknowledgements The publication of this paper was supported by the Yarmouk University Research Council. References [1] ID Bruggles and VE Hoggatt Jr. A primer on the fibonacci numbers-part iv. The Fibonacci Quarterly, 1(4):65–71, 1963. [2] Marcia Edson and Omer Yayenie. A new generalization of fibonacci sequence & extended binet’s formula. 2009. [3] Sergio Falcón and Ángel Plaza. On the fibonacci k-numbers. Chaos, Solitons & Fractals, 32(5):1615–1624, 2007. [4] Henry W Gould. A history of the fibonacci q-matrix and a higher-dimensional prob- lem. The Fibonacci Quarterly, 19(3):250–257, 1981. Sh. A. Bani Melhem, Al-Kateeb, A. Dagher / Eur. J. Pure Appl. Math, 18 (4) (2025), 6605 15 of 15 [5] VE Hoggat. Fibonacci and lucas numbers, houghton-mifflin. Palo Alto, California, 1969. [6] Pawe l Ochalik and Andrzej W loch. On generalized mersenne numbers, their inter- pretations and matrix generators. Annales Universitatis Mariae Curie-Sk lodowska, sectio A–Mathematica, 72(1), 2018. [7] Tian-Xiao He, Peter JS Shiue, and Yaotsu Chang. Computation of fermat’s pseu- doprimes (dedicated to the memory of professor leetsch c. hsu). Journal of Discrete Mathematical Sciences and Cryptography, 25(2):335–352, 2022. [8] Kritsanapong Somsuk. The improvement of initial value closer to the target for fer- mat’s factorization algorithm. Journal of Discrete Mathematical Sciences and Cryp- tography, 21(7-8):1573–1580, 2018. [9] Kenneth H Rosen. Elementary number theory. Pearson Education London, 2011. [10] E Kilic and D Taşci. On sums of second order linear recurrences by hessenberg matrices. The Rocky Mountain Journal of Mathematics, pages 531–544, 2008. [11] Emrah Kilic and Dursun Tasci. On the second order linear recurrences by tridiagonal matrices. Ars Combin, 91:11–18, 2009.