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.

Showing 1-8 of 8 results.

A292944 a(n) = A292272(A004754(n)) - 2*A053644(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 2, 0, 1, 2, 2, 4, 5, 4, 4, 0, 1, 2, 2, 4, 5, 4, 4, 8, 9, 10, 10, 8, 9, 8, 8, 0, 1, 2, 2, 4, 5, 4, 4, 8, 9, 10, 10, 8, 9, 8, 8, 16, 17, 18, 18, 20, 21, 20, 20, 16, 17, 18, 18, 16, 17, 16, 16, 0, 1, 2, 2, 4, 5, 4, 4, 8, 9, 10, 10, 8, 9, 8, 8, 16, 17, 18, 18, 20, 21, 20, 20, 16, 17, 18, 18, 16, 17, 16, 16, 32, 33, 34, 34, 36, 37, 36, 36
Offset: 0

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Comments

In binary expansion (A007088) of n, clear the most significant bit and all those 1-bits that have another 1-bit at their left side, except for the second most significant 1-bit, even in cases where the binary expansion begins as "11...".
Because A292943(n) = a(A243071(n)), the sequence works as a "masking function" where the 1-bits in a(n) (always a subset of the 1-bits in binary expansion of n) indicate which numbers are of the form 6k+3 (odd multiples of three) in binary tree A163511 (or its mirror image tree A005940) on that trajectory which leads from the root of the tree to the node containing A163511(n).

Examples

			For n = 23, 10111 in binary, when we clear (change to zero) the most significant bit (always 1) and also all 1-bits that have 1's at their left side, we are left with 100, which in binary stands for 4, thus a(23) = 4.
For n = 27, 11011 in binary, when we clear the most significant bit, and also all 1-bits that have 1's at their left side except the second most significant, we are left with 1010, which in binary stands for ten, thus a(27) = 10.
		

Crossrefs

Programs

Formula

a(n) = A292272(A004754(n)) - 2*A053644(n).
a(n) = A292943(A163511(n)).
Other identities. For all n >= 0:
a(n) + A292264(n) = A292942(n) + a(n) + A292946(n) = a(n) + A292254(n) + A292256(n) = n.
a(n) = a(n) AND n; a(n) AND A292264(n) = 0, where AND is bitwise-and (A004198).

A156552 Unary-encoded compressed factorization of natural numbers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 11, 32, 17, 10, 15, 64, 13, 128, 19, 18, 33, 256, 23, 12, 65, 14, 35, 512, 21, 1024, 31, 34, 129, 20, 27, 2048, 257, 66, 39, 4096, 37, 8192, 67, 22, 513, 16384, 47, 24, 25, 130, 131, 32768, 29, 36, 71, 258, 1025, 65536, 43, 131072, 2049, 38, 63, 68, 69, 262144
Offset: 1

Views

Author

Leonid Broukhis, Feb 09 2009

Keywords

Comments

The primes become the powers of 2 (2 -> 1, 3 -> 2, 5 -> 4, 7 -> 8); the composite numbers are formed by taking the values for the factors in the increasing order, multiplying them by the consecutive powers of 2, and summing. See the Example section.
From Antti Karttunen, Jun 27 2014: (Start)
The odd bisection (containing even terms) halved gives A244153.
The even bisection (containing odd terms), when one is subtracted from each and halved, gives this sequence back.
(End)
Question: Are there any other solutions that would satisfy the recurrence r(1) = 0; and for n > 1, r(n) = Sum_{d|n, d>1} 2^A033265(r(d)), apart from simple variants 2^k * A156552(n)? See also A297112, A297113. - Antti Karttunen, Dec 30 2017

Examples

			For 84 = 2*2*3*7 -> 1*1 + 1*2 + 2*4 + 8*8 =  75.
For 105 = 3*5*7 -> 2*1 + 4*2 + 8*4 = 42.
For 137 = p_33 -> 2^32 = 4294967296.
For 420 = 2*2*3*5*7 -> 1*1 + 1*2 + 2*4 + 4*8 + 8*16 = 171.
For 147 = 3*7*7 = p_2 * p_4 * p_4 -> 2*1 + 8*2 + 8*4 = 50.
		

Crossrefs

One less than A005941.
Inverse permutation: A005940 with starting offset 0 instead of 1.
Cf. also A297106, A297112 (Möbius transform), A297113, A153013, A290308, A300827, A323243, A323244, A323247, A324201, A324812 (n for which a(n) is a square), A324813, A324822, A324823, A324398, A324713, A324815, A324819, A324865, A324866, A324867.

Programs

  • Mathematica
    Table[Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[ Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ n]], {n, 67}] (* Michael De Vlieger, Sep 08 2016 *)
  • PARI
    a(n) = {my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ David A. Corneth, Mar 08 2019
    
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n)))); \\ (based on the given recurrence) - Antti Karttunen, Mar 08 2019
    
  • Perl
    # Program corrected per instructions from Leonid Broukhis. - Antti Karttunen, Jun 26 2014
    # However, it gives correct answers only up to n=136, before corruption by a wrap-around effect.
    # Note that the correct answer for n=137 is A156552(137) = 4294967296.
    $max = $ARGV[0];
    $pow = 0;
    foreach $i (2..$max) {
    @a = split(/ /, `factor $i`);
    shift @a;
    $shift = 0;
    $cur = 0;
    while ($n = int shift @a) {
    $prime{$n} = 1 << $pow++ if !defined($prime{$n});
    $cur |= $prime{$n} << $shift++;
    }
    print "$cur, ";
    }
    print "\n";
    (Scheme, with memoization-macro definec from Antti Karttunen's IntSeq-library, two different implementations)
    (definec (A156552 n) (cond ((= n 1) 0) (else (+ (A000079 (+ -2 (A001222 n) (A061395 n))) (A156552 (A052126 n))))))
    (definec (A156552 n) (cond ((= 1 n) (- n 1)) ((even? n) (+ 1 (* 2 (A156552 (/ n 2))))) (else (* 2 (A156552 (A064989 n))))))
    ;; Antti Karttunen, Jun 26 2014
    
  • Python
    from sympy import primepi, factorint
    def A156552(n): return sum((1<Chai Wah Wu, Mar 10 2023

Formula

From Antti Karttunen, Jun 26 2014: (Start)
a(1) = 0, a(n) = A000079(A001222(n)+A061395(n)-2) + a(A052126(n)).
a(1) = 0, a(2n) = 1+2*a(n), a(2n+1) = 2*a(A064989(2n+1)). [Compare to the entanglement recurrence A243071].
For n >= 0, a(2n+1) = 2*A244153(n+1). [Follows from the latter clause of the above formula.]
a(n) = A005941(n) - 1.
As a composition of related permutations:
a(n) = A003188(A243354(n)).
a(n) = A054429(A243071(n)).
For all n >= 1, A005940(1+a(n)) = n and for all n >= 0, a(A005940(n+1)) = n. [The offset-0 version of A005940 works as an inverse for this permutation.]
This permutations also maps between the partition-lists A112798 and A125106:
A056239(n) = A161511(a(n)). [The sums of parts of each partition (the total sizes).]
A003963(n) = A243499(a(n)). [And also the products of those parts.]
(End)
From Antti Karttunen, Oct 09 2016: (Start)
A161511(a(n)) = A056239(n).
A029837(1+a(n)) = A252464(n). [Binary width of terms.]
A080791(a(n)) = A252735(n). [Number of nonleading 0-bits.]
A000120(a(n)) = A001222(n). [Binary weight.]
For all n >= 2, A001511(a(n)) = A055396(n).
For all n >= 2, A000120(a(n))-1 = A252736(n). [Binary weight minus one.]
A252750(a(n)) = A252748(n).
a(A250246(n)) = A252754(n).
a(A005117(n)) = A277010(n). [Maps squarefree numbers to a permutation of A003714, fibbinary numbers.]
A085357(a(n)) = A008966(n). [Ditto for their characteristic functions.]
For all n >= 0:
a(A276076(n)) = A277012(n).
a(A276086(n)) = A277022(n).
a(A260443(n)) = A277020(n).
(End)
From Antti Karttunen, Dec 30 2017: (Start)
For n > 1, a(n) = Sum_{d|n, d>1} 2^A033265(a(d)). [See comments.]
More linking formulas:
A106737(a(n)) = A000005(n).
A290077(a(n)) = A000010(n).
A069010(a(n)) = A001221(n).
A136277(a(n)) = A181591(n).
A132971(a(n)) = A008683(n).
A106400(a(n)) = A008836(n).
A268411(a(n)) = A092248(n).
A037011(a(n)) = A010052(n) [conjectured, depends on the exact definition of A037011].
A278161(a(n)) = A046951(n).
A001316(a(n)) = A061142(n).
A277561(a(n)) = A034444(n).
A286575(a(n)) = A037445(n).
A246029(a(n)) = A181819(n).
A278159(a(n)) = A124859(n).
A246660(a(n)) = A112624(n).
A246596(a(n)) = A069739(n).
A295896(a(n)) = A053866(n).
A295875(a(n)) = A295297(n).
A284569(a(n)) = A072411(n).
A286574(a(n)) = A064547(n).
A048735(a(n)) = A292380(n).
A292272(a(n)) = A292382(n).
A244154(a(n)) = A048673(n), a(A064216(n)) = A244153(n).
A279344(a(n)) = A279339(n), a(A279338(n)) = A279343(n).
a(A277324(n)) = A277189(n).
A037800(a(n)) = A297155(n).
For n > 1, A033265(a(n)) = 1+A297113(n).
(End)
From Antti Karttunen, Mar 08 2019: (Start)
a(n) = A048675(n) + A323905(n).
a(A324201(n)) = A000396(n), provided there are no odd perfect numbers.
The following sequences are derived from or related to the base-2 expansion of a(n):
A000265(a(n)) = A322993(n).
A002487(a(n)) = A323902(n).
A005187(a(n)) = A323247(n).
A324288(a(n)) = A324116(n).
A323505(a(n)) = A323508(n).
A079559(a(n)) = A323512(n).
A085405(a(n)) = A323239(n).
The following sequences are obtained by applying to a(n) a function that depends on the prime factorization of its argument, which goes "against the grain" because a(n) is the binary code of the factorization of n, which in these cases is then factored again:
A000203(a(n)) = A323243(n).
A033879(a(n)) = A323244(n) = 2*a(n) - A323243(n),
A294898(a(n)) = A323248(n).
A000005(a(n)) = A324105(n).
A000010(a(n)) = A324104(n).
A083254(a(n)) = A324103(n).
A001227(a(n)) = A324117(n).
A000593(a(n)) = A324118(n).
A001221(a(n)) = A324119(n).
A009194(a(n)) = A324396(n).
A318458(a(n)) = A324398(n).
A192895(a(n)) = A324100(n).
A106315(a(n)) = A324051(n).
A010052(a(n)) = A324822(n).
A053866(a(n)) = A324823(n).
A001065(a(n)) = A324865(n) = A323243(n) - a(n),
A318456(a(n)) = A324866(n) = A324865(n) OR a(n),
A318457(a(n)) = A324867(n) = A324865(n) XOR a(n),
A318458(a(n)) = A324398(n) = A324865(n) AND a(n),
A318466(a(n)) = A324819(n) = A323243(n) OR 2*a(n),
A318467(a(n)) = A324713(n) = A323243(n) XOR 2*a(n),
A318468(a(n)) = A324815(n) = A323243(n) AND 2*a(n).
(End)

Extensions

More terms from Antti Karttunen, Jun 28 2014

A292264 a(n) = n - A292944(n).

Original entry on oeis.org

0, 1, 2, 2, 4, 4, 4, 5, 8, 8, 8, 9, 8, 8, 10, 11, 16, 16, 16, 17, 16, 16, 18, 19, 16, 16, 16, 17, 20, 20, 22, 23, 32, 32, 32, 33, 32, 32, 34, 35, 32, 32, 32, 33, 36, 36, 38, 39, 32, 32, 32, 33, 32, 32, 34, 35, 40, 40, 40, 41, 44, 44, 46, 47, 64, 64, 64, 65, 64, 64, 66, 67, 64, 64, 64, 65, 68, 68, 70, 71, 64, 64, 64, 65, 64, 64, 66, 67, 72, 72, 72, 73, 76, 76
Offset: 0

Views

Author

Antti Karttunen, Sep 30 2017

Keywords

Comments

Because A292263(n) = a(A243071(n)), the sequence works as a "masking function" where the 1-bits in a(n) (always a subset of the 1-bits in binary expansion of n) indicate which numbers are of the form 6k+1 or 6k+5 in binary tree A163511 (or in its mirror image tree A005940) on that trajectory which leads from the root of the tree to the node containing A163511(n).

Crossrefs

Cf. A048735, A292944, A292272 but also A292254, A292256, A292942, A292946 for similarly constructed sequences.

Programs

Formula

a(n) = n - A292944(n).
a(n) = A292263(A163511(n)).
a(n) = A292942(n) + A292946(n).
a(n) = A292254(n) + A292256(n).

A292382 Base-2 expansion of a(n) encodes the steps where numbers of the form 4k+2 are encountered when map x -> A252463(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 1, 2, 2, 4, 5, 8, 4, 4, 9, 16, 10, 32, 17, 10, 8, 64, 9, 128, 18, 18, 33, 256, 20, 8, 65, 8, 34, 512, 21, 1024, 16, 34, 129, 20, 18, 2048, 257, 66, 36, 4096, 37, 8192, 66, 20, 513, 16384, 40, 16, 17, 130, 130, 32768, 17, 36, 68, 258, 1025, 65536, 42, 131072, 2049, 36, 32, 68, 69, 262144, 258, 514, 41, 524288, 36, 1048576, 4097, 18, 514, 40
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Reverse@ NestWhileList[Function[k, Which[k == 1, 1, EvenQ@ k, k/2, True, Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ k]], n, # > 1 &] /. k_ /; IntegerQ@ k :> If[Mod[k, 4] == 2, 1, 0], 2], {n, 77}] (* Michael De Vlieger, Sep 21 2017 *)
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A252463(n) = if(!(n%2),n/2,A064989(n));
    A292382(n) = if(1==n,0,(if(2==(n%4),1,0)+(2*A292382(A252463(n)))));
    
  • PARI
    a(n) = my(m=factor(n),k=-2); sum(i=1,matsize(m)[1], 1 << (primepi(m[i,1]) + (k+=m[i,2]))); \\ Kevin Ryde, Dec 11 2020
    
  • Python
    from sympy.core.cache import cacheit
    from sympy.ntheory.factor_ import digits
    from sympy import factorint, prevprime
    from operator import mul
    from functools import reduce
    def a292372(n):
        k=digits(n, 4)[1:]
        return 0 if n==0 else int("".join(['1' if i==2 else '0' for i in k]), 2)
    def a064989(n):
        f=factorint(n)
        return 1 if n==1 else reduce(mul, [1 if i==2 else prevprime(i)**f[i] for i in f])
    def a252463(n): return 1 if n==1 else n//2 if n%2==0 else a064989(n)
    @cacheit
    def a292384(n): return 1 if n==1 else 4*a292384(a252463(n)) + n%4
    def a(n): return a292372(a292384(n))
    print([a(n) for n in range(1, 111)]) # Indranil Ghosh, Sep 21 2017
  • Scheme
    (define (A292382 n) (A292372 (A292384 n)))
    

Formula

a(n) = A292272(A156552(n)).
a(1) = 0; for n > 1, a(n) = 2*a(A252463(n)) + [n == 2 (mod 4)], where the last part of the formula is Iverson bracket, giving 1 only if n is of the form 4k+2, and 0 otherwise.
a(n) = A292372(A292384(n)).
Other identities. For n >= 1:
a(n) AND A292380(n) = 0, where AND is a bitwise-AND (A004198).
a(n) + A292380(n) = A156552(n).
A000120(a(n)) + A000120(A292380(n)) = A001222(n).

A292371 A binary encoding of 1-digits in the base-4 representation of n.

Original entry on oeis.org

0, 1, 0, 0, 2, 3, 2, 2, 0, 1, 0, 0, 0, 1, 0, 0, 4, 5, 4, 4, 6, 7, 6, 6, 4, 5, 4, 4, 4, 5, 4, 4, 0, 1, 0, 0, 2, 3, 2, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 3, 2, 2, 0, 1, 0, 0, 0, 1, 0, 0, 8, 9, 8, 8, 10, 11, 10, 10, 8, 9, 8, 8, 8, 9, 8, 8, 12, 13, 12, 12, 14, 15, 14, 14, 12, 13, 12, 12, 12, 13, 12, 12, 8, 9, 8, 8, 10, 11, 10, 10, 8, 9, 8, 8, 8, 9, 8, 8, 8
Offset: 0

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			   n      a(n)     base-4(n)  binary(a(n))
                  A007090(n)  A007088(a(n))
  --      ----    ----------  ------------
   1        1          1           1
   2        0          2           0
   3        0          3           0
   4        2         10          10
   5        3         11          11
   6        2         12          10
   7        2         13          10
   8        0         20           0
   9        1         21           1
  10        0         22           0
  11        0         23           0
  12        0         30           0
  13        1         31           1
  14        0         32           0
  15        0         33           0
  16        4        100         100
  17        5        101         101
  18        4        102         100
		

Crossrefs

Cf. A289813 (analogous sequence for base 3).

Programs

  • Mathematica
    Table[FromDigits[IntegerDigits[n, 4] /. k_ /; IntegerQ@ k :> If[k == 1, 1, 0], 2], {n, 0, 112}] (* Michael De Vlieger, Sep 21 2017 *)
  • Python
    from sympy.ntheory.factor_ import digits
    def a(n):
        k=digits(n, 4)[1:]
        return 0 if n==0 else int("".join('1' if i==1 else '0' for i in k), 2)
    print([a(n) for n in range(116)]) # Indranil Ghosh, Sep 21 2017
    
  • Python
    def A292371(n): return int(bin(n&~(n>>1))[:1:-2][::-1],2) # Chai Wah Wu, Jun 30 2022

Formula

a(n) = A059905(A292272(n)) = A059905(n AND A003188(n)), where AND is bitwise-AND (A004198).
For all n >= 0, A000120(a(n)) = A160381(n).

A364295 Numbers k such that A292943(k) = A292944(k).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 32, 36, 45, 48, 64, 72, 90, 96, 128, 144, 165, 180, 189, 192, 256, 288, 330, 360, 378, 384, 512, 576, 660, 720, 756, 768, 1024, 1152, 1320, 1440, 1512, 1536, 2048, 2304, 2640, 2880, 3024, 3072, 4096, 4608, 5280, 5760, 6048, 6144, 8192, 9216, 10560, 11520, 12096, 12288, 16384
Offset: 1

Views

Author

Antti Karttunen, Jul 26 2023

Keywords

Comments

If n is present, then 2*n is also present, and vice versa.
A007283 is included as a subsequence, because it gives the known fixed points of map n -> A163511(n).

Crossrefs

Subsequences: A000079, A007283, A029744, A364296 (odd terms).
Cf. also A364494, A364496.

Programs

A213064 Bitwise AND of 2n with the one's-complement of n.

Original entry on oeis.org

0, 2, 4, 4, 8, 10, 8, 8, 16, 18, 20, 20, 16, 18, 16, 16, 32, 34, 36, 36, 40, 42, 40, 40, 32, 34, 36, 36, 32, 34, 32, 32, 64, 66, 68, 68, 72, 74, 72, 72, 80, 82, 84, 84, 80, 82, 80, 80, 64, 66, 68, 68, 72, 74, 72, 72, 64, 66, 68, 68, 64, 66, 64, 64, 128, 130, 132
Offset: 0

Views

Author

Juli Mallett, Jun 04 2012

Keywords

Comments

In two's-complement binary arithmetic, -n is ~(n - 1). As such, this could be written instead as a(n) = 2n AND -(n + 1). Further, because the least significant bits are never matched both of the operands to the AND, the negative form of n can be used rather than the one's-complement, i.e. a(n) = 2n AND -n.
a(n) has a 1-bit immediately above each run of 1's in n, and everywhere else 0's. Or equivalently, each 01 bit pair in n becomes 10 in a(n) and everywhere else 0's. The most significant 1-bit of n has a 0 above it for this purpose, so is an 01 bit pair. - Kevin Ryde, Jun 04 2020

Examples

			For n = 31, 2n is 62, which in binary is 111110, as multiplication by two is the same as shifting the bits of 31 (11111) to the left by one. As the number is one less than a power of two, all of its least significant bits are set. Before the shift, the most significant bit has a value of 16. After the shift, the most significant bit has a value of 32.
The ~n has all bits set but the five least significant, the highest bit set being the power of two above n: .....111111111100000. When these two values are ANDed together, only the 6th bit, that with the value of 32, is common to them, and the result is 32.
From _Kevin Ryde_, Jun 04 2020: (Start)
     n = 1831 = binary  11100100111
  a(n) = 2120 = binary 100001001000   1-bit above each run
(End)
		

Crossrefs

Cf. A048724 (with XOR).

Programs

  • C
    int a(int n) { return ((n + n) & ~n); }
    
  • Mathematica
    Table[BitAnd[2n, -n], {n, 0, 66}] (* Alonso del Arte, Jun 04 2012 *)
  • PARI
    a(n) = bitnegimply(n<<1,n); \\ Kevin Ryde, Jun 04 2020
    
  • Python
    def A213064(n): return n<<1&~n # Chai Wah Wu, Jun 29 2022
  • R
    # with bitops
    bitAnd(2 * n, bitFlip(n))
    

Formula

a(n) = 2n AND ~n
a(n) = 2*A292272(n). - Kevin Ryde, Jun 04 2020

A229763 a(n) = (2*n) XOR n AND n, where AND and XOR are bitwise logical operators.

Original entry on oeis.org

0, 1, 2, 1, 4, 5, 2, 1, 8, 9, 10, 9, 4, 5, 2, 1, 16, 17, 18, 17, 20, 21, 18, 17, 8, 9, 10, 9, 4, 5, 2, 1, 32, 33, 34, 33, 36, 37, 34, 33, 40, 41, 42, 41, 36, 37, 34, 33, 16, 17, 18, 17, 20, 21, 18, 17, 8, 9, 10, 9, 4, 5, 2, 1, 64, 65, 66, 65, 68, 69, 66, 65, 72, 73, 74
Offset: 0

Views

Author

Alex Ratushnyak, Sep 28 2013

Keywords

Comments

a(n) is the least significant 1-bit of each run of consecutive 1's in n, and everywhere else 0's. Or equivalently, clear to 0 each 1-bit which has another 1 immediately below. - Kevin Ryde, Feb 27 2021

Examples

			From _Kevin Ryde_, Feb 27 2021: (Start)
     n = 1831 = binary 11100100111
  a(n) =  289 = binary   100100001   low 1-bit each run
(End)
		

Crossrefs

Cf. A003188 (n XOR floor(n/2)).
Cf. A048724 (n XOR (n*2)).
Cf. A048735 (n AND floor(n/2)).
Cf. A213370 (n AND (n*2)).
Cf. A213064 (n XOR (n*2) AND (n*2)).
Cf. A229762 (n XOR floor(n/2) AND floor(n/2), 1-bit below each run).
Cf. A292272 (high 1-bit each run).

Programs

  • Haskell
    import Data.Bits ((.&.), xor, shiftL)
    a229763 n = (shiftL n 1 `xor` n) .&. n :: Int
    -- Reinhard Zumkeller, Oct 10 2013
    
  • Mathematica
    Array[BitAnd[BitXor[2 #, #], #] &, 75, 0] (* Michael De Vlieger, Nov 03 2022 *)
  • PARI
    a(n) = bitnegimply(n,n<<1); \\ Kevin Ryde, Feb 27 2021
  • Python
    for n in range(333): print (2*n ^ n) & n,
    
  • Python
    def A229763(n): return n&~(n<<1) # Chai Wah Wu, Jun 29 2022
    

Formula

a(n) = ((2*n) XOR n) AND n = ((2*n) AND n) XOR n.
a(2n) = 2a(n), a(2n+1) = A229762(n). - Ralf Stephan, Oct 07 2013
a(n) = n AND NOT 2n. - Chai Wah Wu, Jun 29 2022
G.f.: x/(1 - x^2) + Sum_{k>=1}(2^k*x^(2^k)/((1 - x)*(1 + x^(2^k))*(1 + x^(2^(k - 1))))). - Miles Wilson, Jan 24 2025
Showing 1-8 of 8 results.