A245474 a(n) = smallest positive integer s such that s*n - floor(sqrt(s*n))^2 is a square.
1, 1, 1, 3, 1, 1, 6, 7, 1, 1, 1, 11, 3, 1, 14, 3, 1, 1, 2, 19, 1, 21, 22, 23, 6, 1, 1, 3, 7, 1, 3, 31, 2, 33, 1, 35, 1, 1, 38, 6, 1, 2, 42, 43, 11, 1, 46, 47, 3, 1, 1, 3, 2, 1, 6, 55, 14, 57, 1, 59, 6, 2, 62, 7, 1, 1, 66, 67, 1, 69, 35, 71, 2, 1, 2, 3, 19
Offset: 0
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
Programs
-
Maple
A:= proc(n) local s,a; for s from 1 do a:= floor(sqrt(s*n)); if issqr(s*n-a^2) then return s fi od end proc: seq(A(n),n=0..1000); # Robert Israel, Jul 23 2014
-
Mathematica
a245474[n_Integer] := Catch[ Do[ If[IntegerQ[Sqrt[(s*n - Floor[Sqrt[s*n]]^2)]] == True, Throw[s]], {s, n}] ]; Map[a245474, Range[100]] (* Michael De Vlieger, Aug 03 2014 *)
-
PARI
a(n) = s=1; while(!issquare(s*n-sqrtint(s*n)^2), s++); s \\ Colin Barker, Jul 23 2014
Extensions
More terms from Colin Barker, Jul 23 2014
Comments