A292144 a(n) is the greatest k < n such that k*n is square.
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, 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, 28, 49, 0, 0, 0, 17, 0, 0, 0, 50, 0, 0, 48, 19, 0, 0, 0, 45
Offset: 1
Keywords
Examples
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.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local F,r; F:= ifactors(n)[2]; r:= mul(t[1], t = select(t -> t[2]::odd, F)); r*(ceil(sqrt(n/r))-1)^2; end proc: # Robert Israel, Sep 10 2017
-
Mathematica
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 *)
-
PARI
forstep (k=n-1, 1, -1, if (issquare(k*n), return (k))); return (0); \\ Michel Marcus, Sep 10 2017
Comments