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.
%I A053615 #62 Mar 01 2025 23:11:16 %S A053615 0,1,0,1,2,1,0,1,2,3,2,1,0,1,2,3,4,3,2,1,0,1,2,3,4,5,4,3,2,1,0,1,2,3, %T A053615 4,5,6,5,4,3,2,1,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,2,3,4,5,6,7,8,7,6,5, %U A053615 4,3,2,1,0,1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1,0,1,2,3,4,5,6,7,8,9,10,9,8,7 %N A053615 Pyramidal sequence: distance to nearest product of two consecutive integers (promic or heteromecic numbers). %C A053615 a(A002378(n)) = 0; a(n^2) = n. %C A053615 Table A049581 T(n,k) = |n-k| read by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). - _Boris Putievskiy_, Jan 29 2013 %H A053615 Harvey P. Dale, <a href="/A053615/b053615.txt">Table of n, a(n) for n = 0..1000</a> %H A053615 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations [of] Integer Sequences And Pairing Functions</a> arXiv:1212.2732 [math.CO], 2012. %H A053615 <a href="/index/Di#distance_to_the_nearest">Index entries for sequences related to distance to nearest element of some set</a> %F A053615 a(n) = A004738(n+1) - 1. %F A053615 Let u(1)=1, u(n) = n - u(n-sqrtint(n)) (cf. A037458); then a(0)=0 and for n > 0 a(n) = 2*u(n) - n. - _Benoit Cloitre_, Dec 22 2002 %F A053615 a(0)=0 then a(n) = floor(sqrt(n)) - a(n - floor(sqrt(n))). - _Benoit Cloitre_, May 03 2004 %F A053615 a(n) = |A196199(n)|. a(n) = |n - t^2 - t|, where t = floor(sqrt(n)). - _Boris Putievskiy_, Jan 29 2013 [corrected by _Ridouane Oudra_, May 11 2019] %F A053615 a(n) = A000194(n) - A053188(n) = t - |t^2 - n|, where t = floor(sqrt(n)+1/2). - _Ridouane Oudra_, May 11 2019 %e A053615 a(10) = |10 - 3*4| = 2. %e A053615 From _Boris Putievskiy_, Jan 29 2013: (Start) %e A053615 The start of the sequence as table: %e A053615 0, 1, 2, 3, 4, 5, 6, 7, ... %e A053615 1, 0, 1, 2, 3, 4, 5, 6, ... %e A053615 2, 1, 0, 1, 2, 3, 4, 5, ... %e A053615 3, 2, 1, 0, 1, 2, 3, 4, ... %e A053615 4, 3, 2, 1, 0, 1, 2, 3, ... %e A053615 5, 4, 3, 2, 1, 0, 1, 2, ... %e A053615 6, 5, 4, 3, 2, 1, 0, 1, ... %e A053615 ... %e A053615 The start of the sequence as triangle array read by rows: %e A053615 0; %e A053615 1, 0, 1; %e A053615 2, 1, 0, 1, 2; %e A053615 3, 2, 1, 0, 1, 2, 3; %e A053615 4, 3, 2, 1, 0, 1, 2, 3, 4; %e A053615 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5; %e A053615 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6; %e A053615 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7; %e A053615 ... %e A053615 Row number r contains 2*r-1 numbers: r-1, r-2, ..., 0, 1, 2, ..., r-1. (End) %p A053615 A053615 := proc(n) %p A053615 A004738(n+1)-1 ; # reuses code of A004738 %p A053615 end proc: %p A053615 seq(A053615(n),n=0..30) ; # _R. J. Mathar_, Feb 14 2019 %t A053615 a[0] = 0; a[n_] := Floor[Sqrt[n]] - a[n - Floor[Sqrt[n]]]; Table[a[n], {n, 0, 103}] (* _Jean-François Alcover_, Dec 16 2011, after _Benoit Cloitre_ *) %t A053615 Join[{0},Module[{nn=150,ptci},ptci=Times@@@Partition[Range[nn/2+1],2,1];Table[Abs[n-Nearest[ptci,n]],{n,nn}][[All,1]]]] (* _Harvey P. Dale_, Aug 29 2020 *) %o A053615 (PARI) a(n)=sqrtint(n)-a(n-sqrtint(n)) %o A053615 (PARI) apply( {A053615(n)=(t=sqrt(n)\/1)-abs(t^2-n)}, [0..99]) \\ _M. F. Hasler_, Feb 01 2025 %o A053615 (Python) A053615 = lambda n: (t := round(n**.5)) - abs(t**2 - n) # _M. F. Hasler_, Feb 01 2025 %o A053615 (Python) %o A053615 from math import isqrt %o A053615 def A053615(n): return abs((t:=isqrt(n))*(t+1)-n) # _Chai Wah Wu_, Mar 01 2025 %Y A053615 Cf. A002262, A002378, A004738, A049581, A053188, A196199. %K A053615 easy,nice,nonn %O A053615 0,5 %A A053615 _Henry Bottomley_, Mar 20 2000