cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A369689 a(n) is the least positive number k such that k^2 is the concatenation of m and m + n for some positive number m, or -1 if there is no such k.

This page as a plain text file.
%I A369689 #25 Feb 18 2024 22:57:04
%S A369689 36363636364,428,8874,5,310,4,39,-1,7747,465
%N A369689 a(n) is the least positive number k such that k^2 is the concatenation of m and m + n for some positive number m, or -1 if there is no such k.
%C A369689 a(n) is the least number k > 0, if it exists, such that k^2 = (10^d + 1) m + n for some m > 0 where 10^(d-1) <= m + n < 10^d.
%C A369689 The attached file a369689.txt has lines n k m where k = a(n) and k^2 is the concatenation of m and m + n, n -1 where a(n) can be proved to be -1, and n -1 ? where I have not found a k that works but I have not been able to prove that a(n) = -1.
%H A369689 Robert Israel, <a href="/A369689/a369689_1.pdf">Proving a(n) = -1</a>
%H A369689 Robert Israel, <a href="/A369689/a369689_1.txt">Table of n, a(n), m</a> for n = 0 .. 300 with some conjectured entries.
%e A369689 a(3) = 5 because 5^2 = 25 is the concatenation of 2 and 2 + 3 = 5, and 5 is the least m that works.
%e A369689 a(7) = -1 because it can be proven that 7 is not a square mod (10^d + 1) for any d, and therefore there are no k and m such that k^2 is the concatenation of m and m + 7.
%o A369689 (Python)
%o A369689 from itertools import count
%o A369689 from sympy import sqrt_mod
%o A369689 def A369689(n):
%o A369689     for j in count(0):
%o A369689         b = 10**j
%o A369689         a = b*10+1
%o A369689         for k in sorted(sqrt_mod(n,a,all_roots=True)):
%o A369689             m = (k**2-n)//a
%o A369689             if m>0 and b <= m+n < a-1:
%o A369689                 return k # _Chai Wah Wu_, Feb 18 2024
%Y A369689 Cf. A106497.
%K A369689 sign,more
%O A369689 0,1
%A A369689 _Robert Israel_, Jan 28 2024