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.

A129771 Evil odd numbers.

Original entry on oeis.org

3, 5, 9, 15, 17, 23, 27, 29, 33, 39, 43, 45, 51, 53, 57, 63, 65, 71, 75, 77, 83, 85, 89, 95, 99, 101, 105, 111, 113, 119, 123, 125, 129, 135, 139, 141, 147, 149, 153, 159, 163, 165, 169, 175, 177, 183, 187, 189, 195, 197, 201, 207, 209, 215, 219, 221, 225, 231, 235
Offset: 1

Views

Author

Tanya Khovanova, May 16 2007

Keywords

Comments

A heuristic argument suggests that, as n tends to infinity, a(n)/n converges to 4. - Stefan Steinerberger, May 17 2007
These numbers may be called primitive evil numbers because every evil number is a power of 2 multiplied by one of these numbers. Note that the difference between consecutive terms is either 2, 4, or 6. - T. D. Noe, Jun 06 2007
If m is in the sequence, then so is 2m-1 because in binary, m is x1 and 2m-1 is x01. Presumably the numbers that generate the whole sequence by application of n -> 2n-1 are the evil numbers times 4 plus 3. - Ralf Stephan, May 25 2013

Crossrefs

Intersection of A001969 and A005408.
Supersequence of A093688.
Cf. A092246 (odd odious numbers).
Column 2 of A277880, positions of 1's in A277808 (2's in A277822).

Programs

  • Mathematica
    Select[Range[300], OddQ[ # ] && EvenQ[DigitCount[ #, 2, 1]] &] (* Stefan Steinerberger, May 17 2007 *)
    Select[Range[300], EvenQ[Plus @@ IntegerDigits[ #, 2]] && OddQ[ # ] &]
  • PARI
    is(n)=n%2 && hammingweight(n)%2==0 \\ Charles R Greathouse IV, Mar 21 2013
    
  • PARI
    a(n)=4*n-if(hammingweight(n-1)%2,3,1) \\ Charles R Greathouse IV, Mar 21 2013
    
  • Python
    def A129771(n): return (((m:=n-1)<<1)+(m.bit_count()&1^1)<<1)+1 # Chai Wah Wu, Mar 09 2023

Formula

a(n) = 2*A000069(n) + 1. a(n) is 1 plus twice odious numbers.
a(n) = A128309(n) + 1. a(n) is 1 plus odious even numbers.
A132680(a(n)) = A132680((a(n)-1)/2) + 2. - Reinhard Zumkeller, Aug 26 2007
a(n) = 4n + O(1). - Charles R Greathouse IV, Mar 21 2013
a(n) = A001969(1+A000069(n)) = A277902(A277823(n)). - Antti Karttunen, Nov 05 2016

Extensions

More terms from Stefan Steinerberger, May 17 2007

A268718 Permutation of natural numbers: a(0) = 0, a(n) = 1 + A003188(A006068(n)-1), where A003188 is binary Gray code and A006068 is its inverse.

Original entry on oeis.org

0, 1, 4, 2, 6, 8, 3, 7, 10, 12, 15, 11, 5, 13, 16, 14, 18, 20, 23, 19, 29, 21, 24, 22, 9, 25, 28, 26, 30, 32, 27, 31, 34, 36, 39, 35, 45, 37, 40, 38, 57, 41, 44, 42, 46, 48, 43, 47, 17, 49, 52, 50, 54, 56, 51, 55, 58, 60, 63, 59, 53, 61, 64, 62, 66, 68, 71, 67, 77, 69, 72, 70, 89, 73, 76, 74, 78, 80, 75, 79, 113, 81
Offset: 0

Views

Author

Antti Karttunen, Feb 12 2016

Keywords

Crossrefs

Inverse: A268717.
Row 1 of array A268830.
Cf. A092246 (fixed points).
Cf. A268818 ("square" of this permutation).
Cf. A268822 ("shifted square"), A268824 ("shifted cube") and also A268826, A268828 and A268832 (higher "shifted powers").

Programs

  • Mathematica
    {0}~Join~Table[1 + BitXor[#, Floor[#/2]] &[BitXor @@ Table[Floor[n/2^m], {m, 0, Floor[Log[2, n]]}] - 1], {n, 81}] (* Michael De Vlieger, Feb 29 2016, after Jean-François Alcover at A006068 and Robert G. Wilson v at A003188 *)
  • PARI
    a003188(n)=bitxor(n, n>>1);
    a006068(n)= {
        my( s=1, ns );
        while ( 1,
            ns = n >> s;
            if ( 0==ns, break() );
            n = bitxor(n, ns);
            s <<= 1;
        );
        return (n);
    } \\ by Joerg Arndt
    a(n)=if(n==0, 0, 1 + a003188(a006068(n) - 1)); \\ Indranil Ghosh, Jun 07 2017
    
  • Python
    def a003188(n): return n^(n>>1)
    def a006068(n):
        s=1
        while True:
            ns=n>>s
            if ns==0: break
            n=n^ns
            s<<=1
        return n
    def a(n): return 0 if n==0 else 1 + a003188(a006068(n) - 1) # Indranil Ghosh, Jun 07 2017
  • Scheme
    (define (A268718 n) (if (zero? n) n (A105081 (A006068 n))))
    

Formula

a(0) = 0, and for n >= 1, a(n) = A105081(A006068(n)) = 1 + A003188(A006068(n)-1).
Other identities. For all n >= 1:
a(A128309(n)) = A128309(n)+2. [Maps any even odious number to that number + 2.]
From Alan Michael Gómez Calderón, May 29 2025: (Start)
a(n) - 1 = A268717(n+1) XOR (A171977(n)+1) for n >= 1;
a(2*n-1) - 1 = (2-A010060(n-1)) XOR (A166519(n-1)-1) for n >= 1;
a(2*n) - 1 = (a(2*(n+1)-1)-1) XOR 2^A277822(n) for n >= 1. (End)

A277880 Dispersion of evil numbers: Square array A(r,c) with A(r,1) = A000069(r); and for c > 1, A(r,c) = A001969(1+(A(r,c-1))), read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Original entry on oeis.org

1, 3, 2, 6, 5, 4, 12, 10, 9, 7, 24, 20, 18, 15, 8, 48, 40, 36, 30, 17, 11, 96, 80, 72, 60, 34, 23, 13, 192, 160, 144, 120, 68, 46, 27, 14, 384, 320, 288, 240, 136, 92, 54, 29, 16, 768, 640, 576, 480, 272, 184, 108, 58, 33, 19, 1536, 1280, 1152, 960, 544, 368, 216, 116, 66, 39, 21, 3072, 2560, 2304, 1920, 1088, 736, 432, 232, 132, 78, 43, 22
Offset: 1

Views

Author

Antti Karttunen, Nov 03 2016

Keywords

Examples

			The top left 12 x 12 corner of the array:
   1,  3,  6,  12,  24,  48,   96,  192,  384,   768,  1536,  3072
   2,  5, 10,  20,  40,  80,  160,  320,  640,  1280,  2560,  5120
   4,  9, 18,  36,  72, 144,  288,  576, 1152,  2304,  4608,  9216
   7, 15, 30,  60, 120, 240,  480,  960, 1920,  3840,  7680, 15360
   8, 17, 34,  68, 136, 272,  544, 1088, 2176,  4352,  8704, 17408
  11, 23, 46,  92, 184, 368,  736, 1472, 2944,  5888, 11776, 23552
  13, 27, 54, 108, 216, 432,  864, 1728, 3456,  6912, 13824, 27648
  14, 29, 58, 116, 232, 464,  928, 1856, 3712,  7424, 14848, 29696
  16, 33, 66, 132, 264, 528, 1056, 2112, 4224,  8448, 16896, 33792
  19, 39, 78, 156, 312, 624, 1248, 2496, 4992,  9984, 19968, 39936
  21, 43, 86, 172, 344, 688, 1376, 2752, 5504, 11008, 22016, 44032
  22, 45, 90, 180, 360, 720, 1440, 2880, 5760, 11520, 23040, 46080
		

Crossrefs

Inverse permutation: A277881.
Transpose: A277882.
Column 1: A000069, column 2: A129771.
Row 1: A003945.
Cf. A277813 (index of the row where n is located in this array), A277822 (index of the column).
Cf. A001969.
Other related tables or permutations: A277820, A277902, A248513.

Programs

Formula

A(r,1) = A000069(r) and for c > 1, A(r,c) = A001969(1+(A(r,c-1))).
Alternatively, if we set also the second column explicitly as:
A(r,2) = A129771(r) = 1+ 2*A000069(r),
then the rest of entries in each row are obtained just by doubling the preceding term on the same row: A(r,c) = 2*A(r,c-1), for c >= 3.
As a composition of other permutations:
a(n) = A277902(A277820(n)).

A277813 a(n) = A115384(A277812(n)) = index of the row where n is located in array A277880.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 5, 3, 2, 6, 1, 7, 8, 4, 9, 5, 3, 10, 2, 11, 12, 6, 1, 13, 14, 7, 15, 8, 4, 16, 17, 9, 5, 18, 3, 19, 20, 10, 2, 21, 22, 11, 23, 12, 6, 24, 1, 25, 26, 13, 27, 14, 7, 28, 29, 15, 8, 30, 4, 31, 32, 16, 33, 17, 9, 34, 5, 35, 36, 18, 3, 37, 38, 19, 39, 20, 10, 40, 2, 41, 42, 21, 43, 22, 11, 44, 45, 23, 12, 46, 6, 47, 48, 24, 1, 49, 50
Offset: 1

Views

Author

Antti Karttunen, Nov 03 2016

Keywords

Comments

a(n) = index of the first odious number which is encountered when we start from k = n and iterate the map k -> A003188(A006068(k)/2).
Ordinal transform of A277822.
This works as a left inverse of A000069 like also does A115384.

Crossrefs

Cf. A003945 (the positions of 1's in this sequence).

Programs

Formula

a(n) = A115384(A277812(n)).
Other identities. For all n >= 1:
a(A000069(n)) = n.
a(n) = a(floor(n/2)) when A010060(n) = 0.

A277808 a(n) = number of iterations of map k -> A003188(A006068(k)/2) that are required (when starting from k = n) until k is an odious number.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 5, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 5, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 6, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 0, 1, 2, 0, 3, 0, 0, 1, 4
Offset: 1

Views

Author

Antti Karttunen, Nov 03 2016

Keywords

Crossrefs

One less than A277822.
A left inverse of A003945.
Cf. A277812 (gives the odious number where such an iteration is finished at when starting from k=n).

Formula

a(n) = A010059(n) * A001511(n).
If A010060(n) = 1 [when n is one of the odious numbers, A000069], then a(n) = 0, otherwise a(n) = 1 + a(A003188(A006068(n)/2)).
Other identities:
For all n >= 0, a(A003945(n)) = n.

A277818 Index of the column where n is located in array A277820: a(n) = 1 + A268389(n).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 1, 1, 2, 3, 1, 2, 1, 1, 4, 1, 5, 2, 1, 3, 1, 1, 2, 2, 1, 1, 3, 1, 2, 4, 1, 1, 2, 5, 1, 2, 1, 1, 3, 3, 1, 1, 2, 1, 4, 2, 1, 2, 1, 1, 6, 1, 2, 3, 1, 1, 3, 2, 1, 4, 1, 1, 2, 1, 3, 2, 1, 5, 1, 1, 2, 2, 1, 1, 4, 1, 2, 3, 1, 3, 1, 1, 2, 1, 7, 2, 1, 1, 2, 4, 1, 2, 1, 1, 3, 2, 1, 1, 3, 1, 2, 6, 1, 1, 4, 2, 1, 3, 1, 1, 2, 1, 2, 3, 1, 2, 1, 1, 5, 4
Offset: 1

Views

Author

Antti Karttunen, Nov 02 2016

Keywords

Comments

Ordinal transform of A268671.

Crossrefs

One more than A268389.
Cf. A277820.
Cf. A268671 for the other index, also A277822.

Programs

Formula

a(n) = 1 + A268389(n).

A277881 Inverse permutation to A277880.

Original entry on oeis.org

1, 3, 2, 6, 5, 4, 10, 15, 9, 8, 21, 7, 28, 36, 14, 45, 20, 13, 55, 12, 66, 78, 27, 11, 91, 105, 35, 120, 44, 19, 136, 153, 54, 26, 171, 18, 190, 210, 65, 17, 231, 253, 77, 276, 90, 34, 300, 16, 325, 351, 104, 378, 119, 43, 406, 435, 135, 53, 465, 25, 496, 528, 152, 561, 170, 64, 595, 33, 630, 666, 189, 24, 703, 741, 209, 780, 230, 76, 820, 23
Offset: 1

Views

Author

Antti Karttunen, Nov 03 2016

Keywords

Crossrefs

Inverse: A277880.
Cf. A028401 (terms at powers of 2).

Programs

  • Scheme
    (define (A277881 n) (let ((row (A277813 n)) (col (A277822 n))) (* (/ 1 2) (- (expt (+ row col) 2) row col col col -2))))

Formula

a(n) = (1/2) * ((c+r)^2 - r - 3*c + 2), where c = A277822(n), and r = A277813(n).

A277883 Inverse permutation to A277882.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 11, 8, 9, 16, 10, 22, 29, 12, 37, 17, 13, 46, 14, 56, 67, 23, 15, 79, 92, 30, 106, 38, 18, 121, 137, 47, 24, 154, 19, 172, 191, 57, 20, 211, 232, 68, 254, 80, 31, 277, 21, 301, 326, 93, 352, 107, 39, 379, 407, 122, 48, 436, 25, 466, 497, 138, 529, 155, 58, 562, 32, 596, 631, 173, 26, 667, 704, 192, 742, 212, 69, 781, 27
Offset: 1

Views

Author

Antti Karttunen, Nov 03 2016

Keywords

Crossrefs

Inverse: A277882.

Programs

  • Scheme
    (define (A277883 n) (let ((col (A277813 n)) (row (A277822 n))) (* (/ 1 2) (- (expt (+ row col) 2) row col col col -2))))

Formula

a(n) = (1/2) * ((c+r)^2 - r - 3*c + 2), where c = A277813(n), and r = A277822(n).
Showing 1-8 of 8 results.