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.

A245474 a(n) = smallest positive integer s such that s*n - floor(sqrt(s*n))^2 is a square.

This page as a plain text file.
%I A245474 #39 Jul 06 2023 15:36:07
%S A245474 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,
%T A245474 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,
%U A245474 59,6,2,62,7,1,1,66,67,1,69,35,71,2,1,2,3,19
%N A245474 a(n) = smallest positive integer s such that s*n - floor(sqrt(s*n))^2 is a square.
%C A245474 a(n) <= n for n > 0. If prime p == 3 (mod 4) then a(p) = p.
%C A245474 Conjecture: a(p) < p for prime p == 1 (mod 4).
%C A245474 Outline of proof of conjecture: write p = x^2 + y^2.  Since gcd(x,y) = 1, there are u,v with x*u + y*v = 1, u^2 + v^2 < y^2 + x^2 = p.  Taking s = u^2 + v^2, s*p = (u*y+v*x)^2 + 1^2, and |u*y+v*x| = floor(sqrt(s*p)). - _Robert Israel_, Aug 04 2014
%C A245474 For the first 100000 primes p == 1 (mod 4), a(p) < sqrt(p)/2. - _Robert Israel_, Aug 03 2014
%H A245474 Robert Israel, <a href="/A245474/b245474.txt">Table of n, a(n) for n = 0..10000</a>
%p A245474 A:= proc(n) local s,a;
%p A245474      for s from 1 do
%p A245474        a:= floor(sqrt(s*n));
%p A245474        if issqr(s*n-a^2) then return s fi
%p A245474      od
%p A245474 end proc:
%p A245474 seq(A(n),n=0..1000); # _Robert Israel_, Jul 23 2014
%t A245474 a245474[n_Integer] := Catch[
%t A245474   Do[
%t A245474    If[IntegerQ[Sqrt[(s*n - Floor[Sqrt[s*n]]^2)]] == True, Throw[s]],
%t A245474    {s, n}]
%t A245474   ]; Map[a245474, Range[100]] (* _Michael De Vlieger_, Aug 03 2014 *)
%o A245474 (PARI) a(n) = s=1; while(!issquare(s*n-sqrtint(s*n)^2), s++); s \\ _Colin Barker_, Jul 23 2014
%Y A245474 Cf. A145022, A145023, A363340.
%K A245474 nonn
%O A245474 0,4
%A A245474 _Thomas Ordowski_, Jul 23 2014
%E A245474 More terms from _Colin Barker_, Jul 23 2014