The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A309914 Distance from n to closest triangular number that is different from n. 0
1, 1, 1, 2, 1, 1, 3, 1, 2, 1, 4, 1, 2, 2, 1, 5, 1, 2, 3, 2, 1, 6, 1, 2, 3, 3, 2, 1, 7, 1, 2, 3, 4, 3, 2, 1, 8, 1, 2, 3, 4, 4, 3, 2, 1, 9, 1, 2, 3, 4, 5, 4, 3, 2, 1, 10, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 11, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 12, 1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1, 13, 1, 2, 3, 4, 5, 6, 7, 6, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
MATHEMATICA
a[n_] := Module[{k = 1}, While[! IntegerQ[Sqrt[8 (n + k) + 1]] && ! IntegerQ[Sqrt[8 (n - k) + 1]], k++]; k]; Table[a[n], {n, 0, 100}]
CROSSREFS
Sequence in context: A128221 A327856 A175488 * A364911 A115758 A228351
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Aug 22 2019
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 June 4 22:04 EDT 2024. Contains 373102 sequences. (Running on oeis4.)