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.

Original entry on oeis.org

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

Views

Author

Thomas Ordowski, Jul 23 2014

Keywords

Comments

a(n) <= n for n > 0. If prime p == 3 (mod 4) then a(p) = p.
Conjecture: a(p) < p for prime p == 1 (mod 4).
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
For the first 100000 primes p == 1 (mod 4), a(p) < sqrt(p)/2. - Robert Israel, Aug 03 2014

Crossrefs

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