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!)
A053615 Pyramidal sequence: distance to nearest product of two consecutive integers (promic or heteromecic numbers). 11
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
COMMENTS
a(A002378(n)) = 0; a(n^2) = n.
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
LINKS
Boris Putievskiy, Transformations [of] Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO], 2012.
FORMULA
a(n) = A004738(n+1) - 1.
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
a(0)=0 then a(n) = floor(sqrt(n)) - a(n - floor(sqrt(n))). - Benoit Cloitre, May 03 2004
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]
a(n) = A000194(n) - A053188(n) = t - |t^2 - n|, where t = floor(sqrt(n)+1/2). - Ridouane Oudra, May 11 2019
EXAMPLE
a(10) = |10 - 3*4| = 2.
From Boris Putievskiy, Jan 29 2013: (Start)
The start of the sequence as table:
0, 1, 2, 3, 4, 5, 6, 7, ...
1, 0, 1, 2, 3, 4, 5, 6, ...
2, 1, 0, 1, 2, 3, 4, 5, ...
3, 2, 1, 0, 1, 2, 3, 4, ...
4, 3, 2, 1, 0, 1, 2, 3, ...
5, 4, 3, 2, 1, 0, 1, 2, ...
6, 5, 4, 3, 2, 1, 0, 1, ...
...
The start of the sequence as triangle array read by rows:
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, 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;
...
Row number r contains 2*r-1 numbers: r-1, r-2, ..., 0, 1, 2, ..., r-1. (End)
MAPLE
A053615 := proc(n)
A004738(n+1)-1 ; # reuses code of A004738
end proc:
seq(A053615(n), n=0..30) ; # R. J. Mathar, Feb 14 2019
MATHEMATICA
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 *)
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 *)
PROG
(PARI) a(n)=if(n<1, 0, sqrtint(n)-a(n-sqrtint(n)))
CROSSREFS
Sequence in context: A329116 A255175 A196199 * A002819 A357562 A307672
KEYWORD
easy,nice,nonn
AUTHOR
Henry Bottomley, Mar 20 2000
STATUS
approved

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 24 19:31 EDT 2024. Contains 371962 sequences. (Running on oeis4.)