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.

A292144 a(n) is the greatest k < n such that k*n is square.

This page as a plain text file.
%I A292144 #24 Sep 11 2017 19:58:33
%S A292144 0,0,0,1,0,0,0,2,4,0,0,3,0,0,0,9,0,8,0,5,0,0,0,6,16,0,12,7,0,0,0,18,0,
%T A292144 0,0,25,0,0,0,10,0,0,0,11,20,0,0,27,36,32,0,13,0,24,0,14,0,0,0,15,0,0,
%U A292144 28,49,0,0,0,17,0,0,0,50,0,0,48,19,0,0,0,45
%N A292144 a(n) is the greatest k < n such that k*n is square.
%C A292144 a(n) = 0 if and only if n is squarefree: a(A005117(n)) = 0 for all n, and a(A013929(n)) > 0 for all n.
%C A292144 A072905 is the right inverse of a: a(A072905(n)) = n.
%C A292144 If a(n) = a(m) != 0, then n = m.
%C A292144 Proof: Without loss of generality, assume a(n) = a(m) < n < m. Then n*a(n)*m*a(m) is square and a(n)*a(m) is square, which implies that n*m is square. Notice that n > a(m), so a(m) is not the greatest integer k such that k*m is square. This is a contradiction.
%H A292144 Robert Israel, <a href="/A292144/b292144.txt">Table of n, a(n) for n = 1..10000</a>
%F A292144 a(n) = A007913(n)*(ceiling(sqrt(n/A007913(n))-1)^2). - _Robert Israel_ and _Michel Marcus_, Sep 11 2017
%e A292144 For n = 63, a(63) = 28 because 28*63 = (7*4)*(7*9) = (7*2*3)^2 = 42^2, and there is no integer 28 < k < 63 such that 63*k is square.
%p A292144 f:= proc(n) local F,r;
%p A292144    F:= ifactors(n)[2];
%p A292144    r:= mul(t[1], t = select(t -> t[2]::odd, F));
%p A292144    r*(ceil(sqrt(n/r))-1)^2;
%p A292144 end proc: # _Robert Israel_, Sep 10 2017
%t A292144 a[n_] := If[SquareFreeQ[n], 0, For[k = n-1, k > 0, k--, If[IntegerQ[ Sqrt[ k*n] ], Return[k]]]]; Array[a, 80] (* _Jean-François Alcover_, Sep 11 2017 *)
%o A292144 (PARI) forstep (k=n-1, 1, -1, if (issquare(k*n), return (k))); return (0); \\ _Michel Marcus_, Sep 10 2017
%Y A292144 Cf. A005117, A007913, A013929, A072905.
%K A292144 nonn
%O A292144 1,8
%A A292144 _Peter Kagey_, Sep 09 2017