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.
%I A379816 #24 Feb 25 2025 09:58:06 %S A379816 0,4,12,0,25,18,448,16,12,100,1100,18,4225,112,240,18,289,36,549100, %T A379816 25,588,2178,13248,72,45,676,108,126,142129,180,71622400,64,396,612, %U A379816 1260,48,1369,722,507,400,42025,294,521345932,242,225,559728,108288,72,112,100,127500,169,1755625,162,2475,448,4332,568516,16573100,150 %N A379816 a(n) is the smallest integer k > n such that sqrt(1/n - 1/k) is a rational number; or 0 if no such k exists. %C A379816 a(1) = a(4) = 0. Proof: See Huber link. %C A379816 k > n exists for n > 4. %C A379816 Continues a(61) <= 53872731025, a(62) = 1984, a(63) = 112, a(64) = 72, a(65) = 4225, a(66) = 2178, a(67) <= 159831244588, a(68) = 1156, a(69) = 268272, a(70) = 8820, a(71) <= 859838400, a(72) = 144, a(73) <= 83265625, a(74) = 136900, a(75) = 300, a(76) = 6498, a(77) = 13552, a(78) = 2106, a(79) = 505600, a(80) = 100, a(81) = 108, a(82) = 6724, a(83) = 558092, a(84) = 147, a(85) = 12145225, a(86) = 447458, a(87) = 68208, a(88) = 8712, a(89) = 22250089, a(90) = 100, a(91) = 225450316, a(92)=1150, a(93) = 565068, a(97) <= 3046267249, a(101) = 10201, a(103) <= 5332206050752, a(107) = 99022508. - _R. J. Mathar_, Feb 21 2025 %C A379816 For nonsquare n, solutions k (not necessarily the smallest ones) are given by k= n*A002350(n)^2 such that 1/n-1/k= (A002349(n)/A002350(n))^2. - _R. J. Mathar_, Feb 25 2025 %C A379816 For n=p^2, squared odd primes, solutions k (not necessarily the smallest) are constructed by k=p*(p+1)^2/4 such that 1/n -1/k = 1/p^2-1/k = [(p-1)/(p*(p+1))]^2 is a rational square. For other perfect squares n, start from such a solution for a prime factor p|n, n=(p*f)^2, and multiply the 3 terms of both sides of that solution with 1/f^2 to find a solution for n. - _R. J. Mathar_, Feb 25 2025 %H A379816 Felix Huber, <a href="/A379816/a379816.txt">Proof that a(1) = a(4) = 0</a> %e A379816 a(16) = 18 because sqrt(1/16 - 1/17) = sqrt(1/272) is irrational but sqrt(1/16 - 1/18) = sqrt(1/144) = 1/12 is rational. %p A379816 A379816:=proc(n) %p A379816 local k; %p A379816 if n=1 or n=4 then %p A379816 return 0 %p A379816 else %p A379816 for k from n+1 do %p A379816 if type(sqrt(1/n-1/k),rational) then %p A379816 return k %p A379816 fi %p A379816 od %p A379816 fi; %p A379816 end proc; %p A379816 seq(A379816(n),n=1..58); %o A379816 (PARI) a(n) = if ((n==1) || (n==4), return(0)); my(k=n+1); while (!issquare(1/n - 1/k), k++); k; \\ _Michel Marcus_, Feb 08 2025 %Y A379816 Cf. A024352, A378501, A379815, A002349, A002350. %K A379816 nonn %O A379816 1,2 %A A379816 _Felix Huber_, Feb 07 2025 %E A379816 Terms a(59-60) from _R. J. Mathar_, Feb 12 2025