login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 5000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".

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). 6
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]

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|. a(n) = |n-t*t-t-1|, where t = floor(sqrt(n-1)). - Boris Putievskiy, Jan 29 2013

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)

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, A053188, A196199, A049581.

Sequence in context: A228110 A255175 A196199 * A002819 A037834 A212496

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

License Agreements, Terms of Use, Privacy Policy .

Last modified December 4 17:40 EST 2016. Contains 278755 sequences.