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-5 of 5 results.

A359401 Nonnegative integers whose sum of positions of 1's in their binary expansion is greater than the sum of positions of 1's in their reversed binary expansion, where positions in a sequence are read starting with 1 from the left.

Original entry on oeis.org

11, 19, 23, 35, 37, 39, 43, 47, 55, 67, 69, 71, 75, 77, 79, 83, 87, 91, 95, 103, 111, 131, 133, 134, 135, 137, 139, 141, 142, 143, 147, 149, 151, 155, 157, 158, 159, 163, 167, 171, 173, 175, 179, 183, 187, 191, 199, 203, 207, 215, 223, 239, 259, 261, 262, 263
Offset: 1

Views

Author

Gus Wiseman, Jan 05 2023

Keywords

Comments

First differs from A161601 in having 134, with binary expansion (1,0,0,0,0,1,1,0), positions of 1's 1 + 6 + 7 = 14, reversed 2 + 3 + 8 = 13.

Crossrefs

Indices of positive terms in A359495; indices of 0's are A359402.
A030190 gives binary expansion, reverse A030308.
A070939 counts binary digits.
A230877 adds up positions of 1's in binary expansion, reverse A029931.
A326669 lists numbers with integer mean position of a 1 in binary expansion.

Programs

  • Mathematica
    sap[q_]:=Sum[q[[i]]*(2i-Length[q]-1),{i,Length[q]}];
    Select[Range[0,100],sap[IntegerDigits[#,2]]>0&]

Formula

A230877(a(n)) > A029931(a(n)).

A161602 Positive integers k that are greater than the value of the reversal of k's binary representation.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 13, 14, 16, 18, 20, 22, 24, 25, 26, 28, 29, 30, 32, 34, 36, 38, 40, 41, 42, 44, 46, 48, 49, 50, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 81, 82, 84, 86, 88, 89, 90, 92, 94, 96, 97, 98, 100, 101, 102, 104, 105, 106, 108, 109
Offset: 1

Views

Author

Leroy Quet, Jun 14 2009

Keywords

Comments

By "reversal" of k's binary representation, it is meant: write k in binary, reverse the order of its digits, and read the result as a binary value.
This sequence contains all the positive even integers.

Examples

			29 in binary is 11101. Its digital reversal is 10111, which is 23 in decimal. Since 29 > 23, 29 is in this sequence.
		

Crossrefs

Cf. A030101, A006995, A161601, A161603 (odd terms).
Cf. A071590 (using decimal reversal).

Programs

  • Mathematica
    Select[Range[109], # > IntegerReverse[#, 2] &] (* Michael De Vlieger, Apr 07 2021 *)
  • PARI
    isok(k) = k > fromdigits(Vecrev(binary(k)), 2); \\ Michel Marcus, Apr 06 2021
    
  • Python
    from itertools import count, islice
    def A161602_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:n>int(bin(n)[-1:1:-1],2),count(max(startvalue,1)))
    A161602_list = list(islice(A161602_gen(),20)) # Chai Wah Wu, Jan 19 2023

Extensions

More terms from Max Alekseyev, Sep 11 2009

A071589 Numbers n such that Reversal(n) > n.

Original entry on oeis.org

12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89, 102, 103, 104, 105, 106, 107, 108, 109, 112, 113, 114, 115, 116, 117, 118, 119, 122, 123, 124, 125, 126, 127, 128, 129
Offset: 1

Views

Author

Benoit Cloitre, Jun 01 2002

Keywords

Crossrefs

Cf. A004086 (digit reversal), A071590 (reversal < n), A002113 (reversal = n).
Cf. A161601 (binary reversal > n).

Programs

  • Mathematica
    Select[Range[200], # < FromDigits[Reverse[IntegerDigits[#]]] &] (* T. D. Noe, Mar 14 2012 *)
  • PARI
    for(i=2,300,n=(i); s=ceil(log(n)/log(10)); if((sum(i=0,s,10^(s-i-1)*(floor(n/10^i*1.)-10*floor(n/10^(i+1)*1.))))>i,print1((i),",")))

A342123 a(n) is the remainder when n is divided by its binary reverse.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 2, 0, 0, 0, 0, 0, 19, 0, 0, 9, 23, 0, 6, 4, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 37, 13, 39, 0, 4, 0, 43, 5, 0, 17, 47, 0, 14, 12, 0, 8, 10, 0, 55, 0, 18, 12, 4, 0, 14, 0, 0, 0, 0, 0, 67, 0, 69, 21, 71, 0, 0, 33, 75, 1, 77, 21
Offset: 1

Views

Author

Rémy Sigrist, Feb 28 2021

Keywords

Comments

The binary reverse of a number is given by A030101.
This sequence is the analog of A071955 for the binary base.

Examples

			For n = 43,
- the binary reverse of 43 ("101011" in binary) is 53 ("110101" in binary),
- so a(43) = 43 mod 53 = 43.
		

Crossrefs

Programs

  • PARI
    a(n, base=2) = { my (r=fromdigits(Vecrev(digits(n, base)), base)); n%r }
    
  • Python
    def A342123(n): return n % int(bin(n)[:1:-1],2) if n > 0 else 0 # Chai Wah Wu, Mar 01 2021

Formula

a(n) = n mod A030101(n).
a(n) <= n with equality iff n belongs to A161601.
a(n) = 0 iff n belongs to A057890.

A161603 Odd terms of sequence A161602.

Original entry on oeis.org

13, 25, 29, 41, 49, 53, 57, 59, 61, 81, 89, 97, 101, 105, 109, 113, 115, 117, 121, 123, 125, 145, 161, 169, 177, 181, 185, 193, 197, 201, 205, 209, 211, 213, 217, 221, 225, 227, 229, 233, 235, 237, 241, 243, 245, 247, 249, 251, 253, 289, 305
Offset: 1

Views

Author

Leroy Quet, Jun 14 2009

Keywords

Examples

			29 in binary is 11101. Its digital reversal is 10111, which is 23 in decimal. Since 29 > 23, and since 29 is odd, 29 is in this sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1,311,2],#>FromDigits[Reverse[IntegerDigits[#,2]],2]&] (* Harvey P. Dale, Feb 20 2013 *)
  • Python
    from itertools import count, islice
    def A161603_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:n>int(bin(n)[-1:1:-1],2),count(max(startvalue|1,1),2))
    A161603_list = list(islice(A161603_gen(),20)) # Chai Wah Wu, Jan 19 2023

Extensions

More terms from Max Alekseyev, Dec 10 2011
Showing 1-5 of 5 results.