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!)
A309714 The smallest possible nonnegative difference between the sum of the first n positive integers (A000217) and the sum of any number of the directly following and consecutive integers. 1
1, 0, 2, 5, 2, 6, 1, 6, 12, 5, 12, 3, 11, 0, 9, 19, 6, 17, 2, 14, 27, 10, 24, 5, 20, 36, 15, 32, 9, 27, 2, 21, 41, 14, 35, 6, 28, 51, 20, 44, 11, 36, 1, 27, 54, 17, 45, 6, 35, 65, 24, 55, 12, 44, 77, 32, 66, 19, 54, 5, 41, 78, 27, 65, 12, 51, 91, 36, 77, 20, 62 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
a(n) = 0 if a positive integer m exists, such that m * (m + 1) = 2 * n * (n + 1). Let k = m - n, then n = (2 * k - 1 + sqrt(8 * k^2 + 1)) / 2. All k for which 8 * k^2 + 1 is a perfect square (A001109) yield a value for n for which a(n) = 0.
a(A053141(n)) = 0 for all n.
LINKS
EXAMPLE
a(2) = 1 + 2 - 3 = 0;
a(3) = 1 + 2 + 3 - 4 = 2;
a(7) = 1 + 2 + 3 + 4 + 5 + 6 + 7 - (8 + 9 + 10) = 1.
a(A053141(2)) = a(14) = 0, because A000217(20) = 2 * A000217(14).
PROG
(PARI) a(n) = {my(t=n*(n+1)/2, k = n+1); while(t >= k, t -= k; k++); t; } \\ Michel Marcus, Aug 16 2019
CROSSREFS
Sequence in context: A198253 A159989 A195702 * A309431 A344077 A198539
KEYWORD
nonn
AUTHOR
Bob Andriesse, Aug 13 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 April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)