cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A333589 #38 Apr 12 2025 06:48:25
%S A333589 2,3,5,7,11,16,24,36,54,81,121,181,271,406,609,913,1369,2053,3079,
%T A333589 4618,6927,10390,15585,23377,35065,52597,78895,118342,177513,266269,
%U A333589 399403,599104,898656,1347984,2021976,3032964,4549446,6824169,10236253,15354379,23031569,34547353,51821029,77731543,116597315
%N A333589 a(n) = floor(a(n-1)*3/2) bitwise-OR LSB(a(n-1)*n), with a(1)=2 (LSB = Least Significant Bit).
%F A333589 a(n) = floor(a(n-1)*3/2) bitwise-OR LSB(a(n-1)*n), with a(1)=2 (LSB = Least Significant Bit).
%e A333589 even index = x + (x>>1)
%e A333589 odd index = (x + (x>>1)) | least significant bit of x
%e A333589 3 = 2 + 1
%e A333589 5 = (3 + 1) | 1
%e A333589 7 = 5 + 2
%e A333589 11 = (7 + 3) | 1
%e A333589 16 = 11 + 5
%e A333589 24 = (16 + 8) | 0
%e A333589 36 = 24 + 12
%e A333589 54 = (36 + 18) | 0
%e A333589 81 = 54 + 27
%e A333589 121 = (81 + 40) | 1
%t A333589 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 *)
%o A333589 (Ruby) values = [2]; 100.times { |index| x = values.last; values << ((x + (x>>1)) | (x&1&index)) }; p values
%o A333589 (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
%Y A333589 Cf. A112088, A333588.
%K A333589 nonn,base
%O A333589 1,1
%A A333589 _Simon Strandgaard_, Mar 27 2020