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.

A327898 a(n) is the nearest integer to the reciprocal of the difference between the square root of n and the nearest integer to this square root unless n is a perfect square, in which case a(n) equals 0.

This page as a plain text file.
%I A327898 #41 Oct 03 2019 16:44:36
%S A327898 0,2,-4,0,4,2,-3,-6,0,6,3,2,-3,-4,-8,0,8,4,3,2,-2,-3,-5,-10,0,10,5,3,
%T A327898 3,2,-2,-3,-4,-6,-12,0,12,6,4,3,2,2,-2,-3,-3,-5,-7,-14,0,14,7,5,4,3,2,
%U A327898 2,-2,-3,-3,-4,-5,-8,-16,0,16,8,5,4,3,3,2,2,-2,-3
%N A327898 a(n) is the nearest integer to the reciprocal of the difference between the square root of n and the nearest integer to this square root unless n is a perfect square, in which case a(n) equals 0.
%C A327898 If n is a perfect square, i.e., 1, 4, 9, or 16, then the computation is not possible and a(n) is given as 0.
%H A327898 Michel Marcus, <a href="/A327898/b327898.txt">Table of n, a(n) for n = 1..10000</a>
%F A327898 a(n) = round(1/(sqrt(n)-round(sqrt(n)))) for n not a square; a(n) = 0 otherwise.
%t A327898 Array[If[IntegerQ@ #2, 0, Round[1/(#2 - Round[#2])]] & @@ {#, Sqrt@ #} &, 64] (* _Michael De Vlieger_, Sep 29 2019 *)
%o A327898 (PARI) a(n)={if(issquare(n), 0, my(t=sqrt(n)); round(1/(t-round(t))))} \\ _Andrew Howroyd_, Sep 30 2019
%Y A327898 Cf. A000290 (squares), A013942, A091453 (if floor is used instead of round).
%K A327898 sign
%O A327898 1,2
%A A327898 _Sebastian F. Orellana_, Sep 29 2019