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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A233327 Distance from 2^n to the nearest triangular number. 3
0, 1, 1, 2, 1, 4, 2, 8, 3, 16, 11, 32, 1, 64, 87, 128, 167, 256, 306, 512, 500, 1024, 552, 2048, 688, 4096, 3041, 8192, 579, 16384, 20854, 32768, 37075, 65536, 55618, 131072, 37108, 262144, 222296, 524288, 147729, 1048576, 891994, 2097152, 602155, 4194304, 3523022 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

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

FORMULA

a(2*k+1) = 2^k.

Specifically, both the nearest triangular number below: A006516(n) = A000217((2^n)-1) = 2^(2n-1) - 2^(n-1) and the nearest triangular number above: A007582(n) = A000217(2^n) = 2^(2n-1) + 2^(n-1) are at the same distance from 2^(2n-1). - Antti Karttunen, Feb 26 2014

EXAMPLE

Triangular number nearest to 2^8=256 is 253, so a(8)=256-253=3.

MATHEMATICA

a[n_] := Module[{k, k0}, k0 = k /. FindRoot[2^n == k*(k+1)/2, {k, 2^(n/2)}, WorkingPrecision -> 20] // Round; Abs[2^n-k0*(k0+1)/2]]; Table[a[n], {n, 0, 46}] (* Jean-Fran├žois Alcover, Feb 27 2014 *)

CROSSREFS

Bisections: a(2n) = abs(A238455(n)), a(2n+1) = A000079(n).

Cf. A000217, A006516, A007582.

Sequence in context: A113418 A117000 A082392 * A085086 A274623 A265256

Adjacent sequences:  A233324 A233325 A233326 * A233328 A233329 A233330

KEYWORD

nonn,easy

AUTHOR

Alex Ratushnyak, Feb 23 2014

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 February 15 22:28 EST 2019. Contains 320138 sequences. (Running on oeis4.)