login
This site is supported by donations 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). 9
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

Table of n, a(n) for n=0..103.

Boris Putievskiy, Transformations [of] Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO], 2012.

Index entries for sequences related to distance to nearest element of some set

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 *)

PROG

(PARI) a(n)=if(n<1, 0, sqrtint(n)-a(n-sqrtint(n)))

CROSSREFS

Cf. A002262, A002378, A004738, A049581, A053188, A196199.

Sequence in context: A228110 A255175 A196199 * A002819 A307672 A037834

Adjacent sequences:  A053612 A053613 A053614 * A053616 A053617 A053618

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 22 16:20 EDT 2019. Contains 328318 sequences. (Running on oeis4.)