login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A333589 a(n) = floor(a(n-1)*3/2) bitwise-OR LSB(a(n-1)*n), with a(1)=2 (LSB = Least Significant Bit). 0
2, 3, 5, 7, 11, 16, 24, 36, 54, 81, 121, 181, 271, 406, 609, 913, 1369, 2053, 3079, 4618, 6927, 10390, 15585, 23377, 35065, 52597, 78895, 118342, 177513, 266269, 399403, 599104, 898656, 1347984, 2021976, 3032964, 4549446, 6824169, 10236253, 15354379, 23031569, 34547353, 51821029, 77731543, 116597315 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..45.

FORMULA

a(n) = floor(a(n-1)*3/2) bitwise-OR LSB(a(n-1)*n), with a(1)=2 (LSB = Least Significant Bit).

EXAMPLE

even index = x + (x>>1)

odd index = ((x + (x>>1)) | least significant bit of x

3 = 2 + 1

5 = (3 + 1) | 1

7 = 5 + 2

11 = (7 + 3) | 1

16 = 11 + 5

24 = (16 + 8) | 0

36 = 24 + 12

54 = (36 + 18) | 0

81 = 54 + 27

121 = (81 + 40) | 1

MATHEMATICA

a[1] = 2; a[n_] := a[n] = BitOr[Floor[a[n - 1]*3/2], Mod[a[n - 1]*n, 2]]; Array[a, 45] (* Amiram Eldar, May 01 2020 *)

PROG

(Ruby) values = [2]; 100.times { |index| x = values.last; values << ((x + (x>>1)) | (x&1&index)) }; p values

(PARI) lista(nn) = {my(a=2, va = List(a)); for (n=2, nn, my(x = a + a>>1); if (n%2, a = bitor(x, a%2), a = x); listput(va, a); ); Vec(va); } \\ Michel Marcus, May 03 2020

CROSSREFS

Cf. A112088, A333588.

Sequence in context: A091501 A286271 A083198 * A112088 A333588 A117792

Adjacent sequences:  A333586 A333587 A333588 * A333590 A333591 A333592

KEYWORD

nonn,base

AUTHOR

Simon Strandgaard, Mar 27 2020

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 25 14:40 EST 2021. Contains 341609 sequences. (Running on oeis4.)