login
Numbers k such that both k and k+1 are in A010342.
1

%I #46 May 28 2026 19:55:30

%S 7,74,135,818,1129,18938,35954,244647,334799,5995730,11448871,

%T 78439682,107528977,1929108530,3684200834,25251313255,34614832471,

%U 621134108570,1186259960295,1238420918199,8130736409714,11145780010489,200002771707050,381971282645042

%N Numbers k such that both k and k+1 are in A010342.

%C There are infinitely many such k.

%C k+1 is never prime.

%C k is never a multiple of 4 or 2p, where p is a 3 mod 4 prime.

%C If k is even then its continued fraction has an even length of 1's. This implies that k+1's continued fraction will have an odd length of 1's.

%C Given a pair of twins (k,k+1), if the minimum of the length of 1's among them is m, then k > 1/4 * F(m+1)^2 * F(m+2)^2 where F(n)=A000045(n).

%C Given k having a length of m1 and k+1 having a length of m2, then (m2-m1) divides m1+1 with the exception of m2-m1=2.

%H Asher Shmidov, <a href="/A395071/b395071.txt">Table of n, a(n) for n = 1..2661</a>

%e The second twin pair (corresponding to n = 2) is (74, 75).

%e For k = 74, sqrt(74) = [8; 1, 1, 1, 1, 16]. The periodic part is (1, 1, 1, 1, 16), which consists of 1's and a final partial quotient of 16.

%e For k = 75, sqrt(75) = [8; 1, 1, 1, 16]. The periodic part is (1, 1, 1, 16), which consists of 1's and a final partial quotient of 16.

%e Since 74 and 75 are consecutive, 74 belongs to this sequence.

%o (Python)

%o def twin_list(term_count=24):

%o f = [0, 1, 1]

%o def fib(n):

%o while len(f) <= n:

%o f.append(f[-1] + f[-2])

%o return f[n]

%o k_set = set()

%o m1 = 1

%o while True:

%o least_k = (fib(m1+1) * fib(m1+2))**2 // 4

%o if len(k_set) >= term_count:

%o if sorted(list(k_set))[term_count-1] < least_k:

%o break

%o for d in range(1, m1+2):

%o if (m1+1) % d != 0 and d != 2:

%o continue

%o m2 = m1 + d

%o F_d = fib(d)

%o if m1 % 3 == 2 or m2 % 3 == 2:

%o continue

%o num = fib(m1+1) * fib(m2+1)

%o two_q_minus1 = num // F_d

%o if two_q_minus1 % 2 == 1:

%o q = two_q_minus1 // 2 + 1

%o k1 = q**2 + 1 + two_q_minus1 * fib(m1) // fib(m1+1)

%o k2 = q**2 + 1 + two_q_minus1 * fib(m2) // fib(m2+1)

%o k_set.add(min(k1, k2)) # least of the pair. k2 could be least as m2>m1 doesn't necessarily imply k2>k1.

%o m1 += 1

%o k_sorted = sorted(list(k_set))

%o k_trunc = k_sorted[:term_count]

%o return k_trunc

%Y Subsequence of A010342.

%Y Cf. A000045 (Fibonacci).

%K nonn

%O 1,1

%A _Asher Shmidov_, Apr 10 2026