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

A271500 Positions of terms greater than 1 in A271498.

Original entry on oeis.org

7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 31, 32, 33, 35, 37, 38, 39, 41, 42, 43, 44, 46, 47, 49, 50, 52, 53, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 70, 73, 74, 75, 76, 78, 79, 80, 82, 84, 88, 91, 93, 94, 95, 96, 97, 98, 99, 100, 103, 104, 105, 107, 109, 110, 111, 112, 114, 115, 117, 118, 119
Offset: 1

Views

Author

N. J. A. Sloane, Apr 16 2016

Keywords

Comments

There are several similar sequences in the OEIS, but no exact match. It would be nice to have an independent characterization of these numbers (independent of A271498, that is).

Crossrefs

A271497 If n is a multiple of 3 then a(n) = n/3, otherwise a(n) = n'+n'', where n' (resp. n'') is obtained by sorting the bits of the binary expansion of n into increasing (resp. decreasing) order.

Original entry on oeis.org

0, 2, 3, 1, 5, 9, 2, 14, 9, 3, 15, 21, 4, 21, 21, 5, 17, 27, 6, 35, 27, 7, 35, 45, 8, 35, 35, 9, 35, 45, 10, 62, 33, 11, 51, 63, 12, 63, 63, 13, 51, 63, 14, 75, 63, 15, 75, 93, 16, 63, 63, 17, 63, 75, 18, 93, 63, 19, 75, 93, 20, 93, 93, 21, 65, 99, 22, 119, 99, 23, 119, 135, 24, 119, 119, 25, 119, 135
Offset: 0

Views

Author

N. J. A. Sloane, Apr 16 2016

Keywords

Examples

			11 = 1011_2, so n' = 0111_2 = 7, n'' = 1110_2 = 14, and therefore a(11) = 7+14 = 21.
		

Crossrefs

Programs

  • Maple
    A271497:=proc(n) local t1,t2,len; global b;
    if n mod (b+1) = 0 then return(n/(b+1)); fi;
    t1:=convert(n,base,b); len:=nops(t1);
    t2:=sort(t1);
    add(t2[i]*(b^(i-1)+b^(len-i)),i=1..len);
    end;
    b:=2; [seq(A271497(n),n=0..100)];
  • Python
    from _future_ import division
    def A271497(n):
        return int(''.join(sorted(bin(n)[2:])),2) + int(''.join(sorted(bin(n)[2:],reverse=True)),2) if n % 3 else n//3 # Chai Wah Wu, Apr 16 2016
Showing 1-2 of 2 results.