[go: up one dir, main page]

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!)
A129523 Numbers of the form 2^j +- 2^i for 0 <= i < j, in ascending order. 2
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 24, 28, 30, 31, 32, 33, 34, 36, 40, 48, 56, 60, 62, 63, 64, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, 127, 128, 129, 130, 132, 136, 144, 160, 192, 224, 240, 248, 252, 254, 255, 256, 257, 258, 260, 264, 272 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Positive sums and differences of pairs of distinct powers of two, sorted, with duplicates removed.
LINKS
FORMULA
x(n) = { 2^x - 2^y if x < y }, { 2^x if x = y }, { 2^x + 2^y if x > y} where x = ceiling(sqrt(n)) and y = n - (x-1)^2 - 1.
Union of A018900 and A023758. - M. F. Hasler, Jul 31 2015
EXAMPLE
1 = 2^1 - 2^0; 2 = 2^2 - 2^1; 3 = 2^1 + 2^0 or 2^2 - 2^0; 4 = 2^3 - 2^2; 5 = 2^2 + 2^0.
MATHEMATICA
Union[Flatten[Table[{2^n, 2^n - 2^k, 2^n + 2^k}, {n, 8}, {k, 0, n - 1}]]] (* Ivan Neretin, Jul 29 2015 *)
PROG
(Octave) x=[]; m=12; for i = 0:m; x=[x, 2^i-2.^([(i-2):-1:0]), 2^i, 2^i+2.^([0 :(i-2)])]; end; x
CROSSREFS
Sequence in context: A333762 A295235 A136490 * A243463 A247805 A164713
KEYWORD
nonn
AUTHOR
Phil Rutschman (phil(AT)rsnsoft.com), Apr 19 2007
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 August 29 11:24 EDT 2024. Contains 375516 sequences. (Running on oeis4.)