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.
%I A244586 #37 Aug 07 2023 02:10:12 %S A244586 4,5,6,7,4,5,6,7,12,13,14,15,12,13,14,15,20,21,22,23,20,21,22,23,28, %T A244586 29,30,31,28,29,30,31,36,37,38,39,36,37,38,39,44,45,46,47,44,45,46,47, %U A244586 52,53,54,55,52,53,54,55,60,61,62,63,60,61,62,63 %N A244586 a(n) = n OR 4. %C A244586 a(n) = n if n is congruent to (4, 5, 6, 7) mod 8. In general, (n OR 2^k) has the closed form n + 2^k * floor( ( (n+2^k) mod 2^(k+1) )/2^k ). %F A244586 a(n) = (n+4) - (n AND 4). %F A244586 a(n) = (n XOR 4) + (n AND 4). %F A244586 a(n) = n + 4*floor(((n+4) mod 8)/4). %F A244586 From _Bruno Berselli_, Jul 01 2014: (Start) %F A244586 a(n) = 2 + n + 2*(-1)^floor(n/4). %F A244586 G.f.: (4 - 3*x + x^5)/((1 - x)^2*(1 + x^4)). (End) %F A244586 Sum_{n>=0} (-1)^n/a(n) = (2*sqrt(2)-1)*Pi/8 - 3*log(2)/4. - _Amiram Eldar_, Aug 07 2023 %e A244586 a(10) = 14 because 10 in binary is 1010 and 4 is 0100, and 1010 OR 0100 = 1110, which is 14 in decimal. %e A244586 a(11) = 15 because 11 in binary is 1011 and 4 is 0100, and 1011 OR 0100 = 1111, which is 15 in decimal. %e A244586 a(12) = 12 because 12 in binary is 1100 and 4 is 0100, and 1100 OR 0100 = 1100, which is 12 in decimal. %p A244586 with(Bits): seq(Or(n,4), n = 0..60); %t A244586 Table[BitOr[n, 4], {n, 0, 63}] (* _Alonso del Arte_, Jul 01 2014 *) %o A244586 (Magma) [BitwiseOr(n, 4): n in [0..70]]; // _Bruno Berselli_, Jul 01 2014 %o A244586 (Python) %o A244586 def A244586(n): return n|4 # _Chai Wah Wu_, Jan 18 2023 %Y A244586 Cf. A047566. %Y A244586 Cf. similar sequences listed in A244587. %K A244586 nonn,easy %O A244586 0,1 %A A244586 _Gary Detlefs_, Jun 30 2014 %E A244586 Some terms corrected by _Bruno Berselli_, Jul 01 2014