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.

Previous Showing 11-20 of 28 results. Next

A292272 a(n) = n - A048735(n) = n - (n AND floor(n/2)).

Original entry on oeis.org

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, 40, 41, 42, 42, 40, 41, 40, 40, 32, 33, 34, 34, 36, 37, 36, 36, 32, 33, 34, 34, 32, 33, 32, 32, 64, 65, 66, 66, 68, 69, 68, 68, 72, 73, 74, 74, 72, 73, 72, 72, 80, 81, 82, 82, 84, 85, 84, 84, 80, 81, 82, 82, 80, 81
Offset: 0

Views

Author

Antti Karttunen, Sep 16 2017

Keywords

Comments

In binary expansion of n, change those 1's to 0's that have an 1-bit next to them at their left (more significant) side. Only fibbinary numbers (A003714) occur as terms.

Examples

			From _Kevin Ryde_, Jun 02 2020: (Start)
     n = 1831 = binary 11100100111
  a(n) = 1060 = binary 10000100100   high 1 of each run
(End)
		

Crossrefs

Programs

Formula

a(n) = n - A048735(n) = n - (n AND floor(n/2)) = n XOR (n AND floor(n/2)), where AND is bitwise-AND (A004198) and XOR is bitwise-XOR (A003987).
a(n) = n AND A003188(n).
a(n) = A292382(A005940(1+n)).
A059905(a(n)) = A292371(n).
For all n >= 0, A085357(a(n)) = 1.
a(n) = A213064(n) / 2. - Kevin Ryde, Jun 02 2020
a(n) = n AND NOT floor(n/2). - Chai Wah Wu, Jun 29 2022

A072637 Inverse permutation to A072636.

Original entry on oeis.org

0, 1, 2, 3, 6, 4, 5, 14, 15, 7, 16, 8, 19, 42, 43, 51, 52, 11, 9, 39, 37, 10, 28, 38, 112, 123, 121, 151, 149, 122, 376, 150, 466, 20, 53, 17, 44, 154, 155, 126, 127, 18, 47, 54, 156, 135, 136, 480, 481, 477, 475, 387, 385, 476, 1531, 386, 1234, 415, 413, 1542, 1540
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2002

Keywords

Crossrefs

A072644 gives the size of the corresponding parenthesizations, i.e. A072644(n) = A029837(A014486(A072637(n))+1)/2 [A029837(n+1) gives the binary width of n].

A163325 Pick digits at the even distance from the least significant end of the ternary expansion of n, then convert back to decimal.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Examples

			11 in ternary base (A007089) is written as '102' (1*9 + 0*3 + 2), from which we pick the "zeroth" and 2nd digits from the right, giving '12' = 1*3 + 2 = 5, thus a(11) = 5.
		

Crossrefs

A059905 is an analogous sequence for binary.

Programs

  • PARI
    a(n) = fromdigits(digits(n,9)%3,3); \\ Kevin Ryde, May 14 2020

Formula

a(0) = 0, a(n) = (n mod 3) + 3*a(floor(n/9)).
a(n) = Sum_{k>=0} {A030341(n,k)*b(k)} where b is the sequence (1,0,3,0,9,0,27,0,81,0,243,0... = A254006): powers of 3 alternating with zeros. - Philippe Deléham, Oct 22 2011
A037314(a(n)) + 3*A037314(A163326(n)) = n for all n.

Extensions

Edited by Charles R Greathouse IV, Nov 01 2009

A083935 Inverse function of N -> N injection A083934.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Antti Karttunen, May 13 2003

Keywords

Comments

a(0)=0 because A083934(0)=0, but a(n) = 0 also for those n which do not occur as values of A083934. All positive natural numbers occur here once.

Crossrefs

a(A080934(n)) = n for all n. Cf. A083925-A083929, A014486, A080300, A059905, A059906.

A163900 Squared distance between n's location in A054238 array and A163357 array.

Original entry on oeis.org

0, 0, 1, 1, 8, 18, 5, 5, 4, 2, 9, 5, 2, 2, 9, 9, 0, 2, 1, 1, 0, 0, 1, 1, 4, 4, 9, 1, 2, 4, 5, 9, 16, 10, 25, 17, 16, 16, 25, 9, 36, 36, 49, 25, 10, 4, 5, 1, 10, 18, 5, 5, 10, 16, 17, 25, 10, 20, 25, 29, 36, 36, 25, 49, 128, 162, 113, 113, 128, 128, 113, 145, 100, 100, 89, 113, 162
Offset: 0

Views

Author

Antti Karttunen, Sep 19 2009

Keywords

Crossrefs

Positions of zeros: A163901. See also A163898, A163899.

Formula

a(n) = A000290(abs(A059906(n)-A059252(n))) + A000290(abs(A059905(n)-A059253(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).

A072635 Inverse permutation to A072634.

Original entry on oeis.org

0, 1, 3, 2, 6, 8, 7, 19, 16, 5, 15, 4, 14, 52, 43, 51, 42, 20, 22, 53, 60, 21, 61, 56, 179, 155, 178, 154, 177, 164, 557, 163, 556, 11, 39, 13, 41, 151, 123, 153, 125, 12, 40, 33, 117, 152, 124, 471, 381, 477, 553, 479, 555, 505, 1797, 507, 1799, 478, 554, 1536
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2002

Keywords

Crossrefs

A072644 gives the size of the corresponding parenthesizations, i.e. A072644(n) = A029837(A014486(A072635(n))+1)/2 [A029837(n+1) gives the binary width of n].

A292373 A binary encoding of 3-digits in base-4 representation of n.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 2, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 2, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 2, 2, 3, 4, 4, 4, 5, 4, 4, 4, 5, 4, 4, 4, 5, 6, 6, 6, 7, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 2, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 2, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 2, 2, 3, 4, 4, 4, 5, 4, 4, 4, 5, 4
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        0          1           0
   2        0          2           0
   3        1          3           1
   4        0         10           0
   5        0         11           0
   6        0         12           0
   7        1         13           1
   8        0         20           0
   9        0         21           0
  10        0         22           0
  11        1         23           1
  12        2         30          10
  13        2         31          10
  14        2         32          10
  15        3         33          11
  16        0        100           0
  17        0        101           0
  18        0        102           0
  19        1        103           1
		

Crossrefs

Programs

  • Python
    def A292373(n): return int(bin(n&n>>1)[:1:-2][::-1],2) # Chai Wah Wu, Jun 30 2022

Formula

a(n) = A059905(A048735(n)) = A059906(A213370(n)).
For all n >= 0, A000120(a(n)) = A160383(n).

A082857 Inverse function of N -> N injection A082856.

Original entry on oeis.org

0, 1, 0, 2, 0, 3, 0, 6, 0, 0, 0, 4, 0, 0, 0, 14, 0, 0, 0, 0, 0, 7, 0, 16, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 5, 0, 0, 0, 15, 0, 0, 0, 11, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 8, 0, 19, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 20, 0, 53, 0, 0, 0, 0, 0, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 151, 0, 0, 0, 0, 0, 0, 0, 155
Offset: 0

Views

Author

Antti Karttunen, May 06 2003

Keywords

Comments

a(n) = 0 for those n which do not occur as the values of A082856. All positive natural numbers occur here once.

Crossrefs

Formula

a(A082856(n)) = n for all n.

A152754 "Upper positive integers": n is in the sequence iff in the representation n=A000695(k)+2*A000695(l) satisfies inequality A000695(k) < A000695(l).

Original entry on oeis.org

2, 8, 9, 10, 11, 14, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50, 56, 57, 58, 59, 62, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160
Offset: 1

Views

Author

Vladimir Shevelev, Dec 12 2008

Keywords

Comments

In the mapping: every integer m corresponds to a unique pair (k,l) with m=A000695(k)+2*A000695(l) (k=A059905(m), l=A059906(m)), the numbers a(n) are mapped into the lattice points lying upper the diagonal l=k. If the binary expansion of N is Sum b_j*2^j, then N is in the sequence iff Sum b_(2j)*2^jA139370. This explains, somewhat, why many terms of the sequence are in A139370 as well.

Crossrefs

Programs

  • Mathematica
    fh[n_,h_] := If[h==1, Mod[n,2], If[Mod[n,4]>=2,1,0]]; half[n_, h_ ] := Module[{t=1, s=0, m=n}, While[m>0, s += fh[m,h]*t; m=Quotient[m,4]; t *= 2]; s]; mb[n_] := FromDigits[Riffle[IntegerDigits[n, 2], 0], 2]; aQ[n_] := mb[half[n,1]] < mb[half[n, 2]]; Select[Range[160], aQ] (* Amiram Eldar, Dec 16 2018 from the PARI code *)
  • PARI
    a000695(n) = fromdigits(binary(n), 4);
    half1(n) = { my(t=1, s=0); while(n>0, s += (n%2)*t; n \= 4; t *= 2); (s); }; \\ A059905
    half2(n) = { my(t=1, s=0); while(n>0, s += ((n%4)>=2)*t; n \= 4; t *= 2); (s); }; \\ A059906
    isok(n) = a000695(half1(n)) < a000695(half2(n)); \\ Michel Marcus, Dec 15 2018

Extensions

Missing 9 and more terms from Michel Marcus, Dec 15 2018
Previous Showing 11-20 of 28 results. Next