login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A229118 Distance from the n-th triangular number to the nearest square. 6

%I #21 Apr 08 2019 11:09:55

%S 0,1,2,1,1,4,3,0,4,6,2,3,9,5,1,8,9,2,6,14,6,3,13,11,1,10,17,6,6,19,12,

%T 1,15,19,5,10,26,12,4,21,20,3,15,29,11,8,28,20,0,21,30,9,13,36,19,4,

%U 28,30,6,19,42,17,9,36,29,2,26,42,14,15,45,27,3,34,41,10,22,55,24,9,43,39,5,30,55,20,16,53,36,1

%N Distance from the n-th triangular number to the nearest square.

%C The maximum of a(n)/n appears to converge to sqrt(2)/2 (A010503), i.e. n*(n+1)/2 seems not more than n*sqrt(2)/2 distant from a square.

%C Some values don't seem to be in the sequence (checked up to n=10^7): 7,18,23,31,37,38...

%C Those values k are not in the sequence because the Pell-type equations x^2 - 8*y^2 = 8*k+1 and x^2 - 8*y^2 = -8*k+1 have no solutions. - _Robert Israel_, Apr 08 2019

%C a(A001108(n)) = 0, a(A229131(n)) = 1, a(A229083(n)) <= 1, a(A229133(n)) is square.

%H Harvey P. Dale, <a href="/A229118/b229118.txt">Table of n, a(n) for n = 1..1000</a>

%t dns[n_]:=Module[{a=Floor[Sqrt[n]]^2,b=Ceiling[Sqrt[n]]^2},Min[n-a, b-n]]; dns/@Accumulate[Range[90]] (* _Harvey P. Dale_, Nov 07 2016 *)

%o (PARI) m=0;for(n=1, 100, t=n*(n+1)/2;s=sqrtint(t);d=min(t-s^2,(s+1)^2-t);print1(d, ","))

%Y Cf. A229117, A000217, A000290.

%K nonn,easy

%O 1,3

%A _Ralf Stephan_, Sep 14 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 22:36 EDT 2024. Contains 371917 sequences. (Running on oeis4.)