|
|
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
|
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
|
|
|
FORMULA
|
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
|
|
EXAMPLE
|
a(10) = |10 - 3*4| = 2.
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
|
end proc:
|
|
MATHEMATICA
|
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
|
|
|
KEYWORD
|
easy,nice,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|