A359800 a(n) is the least m such that the concatenation of n^2 and m is a square.
6, 9, 61, 9, 6, 1, 284, 516, 225, 489, 104, 4, 744, 249, 625, 3201, 444, 9, 201, 689, 4201, 416, 984, 4801, 681, 5201, 316, 996, 5801, 601, 6201, 144, 936, 6801, 449, 7201, 7401, 804, 7801, 225, 8201, 8401, 6, 8801, 9001, 9201, 9401, 324, 9801, 19344, 769, 38025
Offset: 1
Examples
For n=3, 61 is the least number m such that the concatenation of 3^2 and m is a square: 961 = 31^2. So a(3) = 61. For n=7, 284 is the least number m such that the concatenation of 7^2 and m is a square: 49284 = 222^2. So a(7) = 284.
Links
Programs
-
PARI
a(n)={my(m=n^2, b=1); while(1, m*=10; my(r=(sqrtint(m+b-1)+1)^2-m); b*=10; if(rAndrew Howroyd, Jan 13 2023
-
Python
from math import isqrt def a(n): t, k = str(n*n), isqrt(10*n**2) while not (s:=str(k*k)).startswith(t) or s[len(t)]=="0": k += 1 return int(s[len(t):]) print([a(n) for n in range(1, 53)]) # Michael S. Branicky, Jan 15 2023
-
Python
from math import isqrt from sympy.ntheory.primetest import is_square def A359800(n): m = 10*n*n if is_square(m): return 0 a = 1 while (k:=(isqrt(a*(m+1)-1)+1)**2-m*a)>=10*a: a *= 10 return k # Chai Wah Wu, Feb 15 2023
Comments