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 (pronic or heteromecic numbers). 4
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; internal format)
OFFSET

0,5

COMMENTS

a(A002378(n))=0; a(n^2)=n.

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 (benoit7848c(AT)orange.fr), May 03 2004

EXAMPLE

a(10)=|10-3*4|=2

MATHEMATICA

a[0] = 0; a[n_] := Floor[Sqrt[n]] - a[n - Floor[Sqrt[n]]]; Table[a[n], {n, 0, 103}] (* From 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.

Sequence in context: A116433 A106509 A196199 * A002819 A037834 A179765

Adjacent sequences:  A053612 A053613 A053614 * A053616 A053617 A053618

KEYWORD

easy,nice,nonn

AUTHOR

Henry Bottomley (se16(AT)btinternet.com), Mar 20 2000

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 15 05:45 EST 2012. Contains 205694 sequences.