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

A053985 Replace 2^k with (-2)^k in binary expansion of n.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Apr 03 2000

Keywords

Comments

Base 2 representation for n (in lexicographic order) converted from base -2 to base 10.
Maps natural numbers uniquely onto integers; within each group of positive values, maximum is in A002450; a(n)=n iff n can be written only with 1's and 0's in base 4 (A000695).
a(n) = A004514(n) - n. - Reinhard Zumkeller, Dec 27 2003
Schroeppel gives formula n = (a(n) + b) XOR b where b = binary ...101010, and notes this formula is reversible. The reverse a(n) = (n XOR b) - b is a bit twiddle to transform 1 bits to -1. Odd position 0 or 1 in n is flipped by "XOR b" to 1 or 0, then "- b" gives 0 or -1. Only odd position 1's are changed, so b can be any length sure to cover those. - Kevin Ryde, Jun 26 2020

Examples

			a(9)=-7 because 9 is written 1001 base 2 and (-2)^3 + (-2)^0 = -8 + 1 = -7.
Or by Schroeppel's formula, b = binary 1010 then a(9) = (1001 XOR 1010) - 1010 = decimal -7. - _Kevin Ryde_, Jun 26 2020
		

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 2]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 2]], {n, 1, 80}]; b
    (* Second program: *)
    Array[FromDigits[IntegerDigits[#, 2], -2] &, 62, 0] (* Michael De Vlieger, Jun 27 2020 *)
  • PARI
    a(n) = fromdigits(binary(n), -2) \\ Rémy Sigrist, Sep 01 2018
    
  • Python
    def A053985(n): return  -(b:=int('10'*(n.bit_length()+1>>1),2)) + (n^b) if n else 0 # Chai Wah Wu, Nov 18 2022

Formula

From Ralf Stephan, Jun 13 2003: (Start)
G.f.: (1/(1-x)) * Sum_{k>=0} (-2)^k*x^2^k/(1+x^2^k).
a(0) = 0, a(2*n) = -2*a(n), a(2*n+1) = -2*a(n)+1. (End)
a(n) = Sum_{k>=0} A030308(n,k)*A122803(k). - Philippe Deléham, Oct 15 2011
a(n) = (n XOR b) - b where b = binary ..101010 [Schroeppel]. Any b of this form (A020988) with bitlength(b) >= bitlength(n) suits. - Kevin Ryde, Jun 26 2020

A065369 Replace 3^k with (-3)^k in ternary expansion of n.

Original entry on oeis.org

0, 1, 2, -3, -2, -1, -6, -5, -4, 9, 10, 11, 6, 7, 8, 3, 4, 5, 18, 19, 20, 15, 16, 17, 12, 13, 14, -27, -26, -25, -30, -29, -28, -33, -32, -31, -18, -17, -16, -21, -20, -19, -24, -23, -22, -9, -8, -7, -12, -11, -10, -15, -14, -13, -54, -53, -52, -57, -56, -55, -60, -59, -58, -45, -44, -43, -48, -47, -46
Offset: 0

Views

Author

Marc LeBrun, Oct 31 2001

Keywords

Comments

Base 3 representation for n (in lexicographic order) converted from base -3 to base 10.
Notation: (3)[n](-3)
Fixed point of the morphism 0-> 0,1,2 ; 1-> -3,-2,-1 ; 2-> -6,-5,-4 ; ...; n-> -3n,-3n+1,-3n+2. - Philippe Deléham, Oct 22 2011

Examples

			15 = +1(9)+2(3)+0(1) -> +1(+9)+2(-3)+0(+1) = +3 = a(15)
		

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 3]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 3]], {n, 1, 80}]; b
  • PARI
    a(n) = fromdigits(digits(n, 3), -3) \\ Rémy Sigrist, Feb 06 2020

Formula

a(n) = Sum_{k>=0} A030341(n,k)*(-3)^k. - Philippe Deléham, Oct 22 2011
a(3*k+m) = -3*a(k)+m for 0 <= m < 3. - Chai Wah Wu, Jan 16 2020

A073835 Replace 10^k with (-10)^k in decimal expansion of n.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Aug 12 2002

Keywords

Comments

Base 10 representation for n (in lexicographic order) converted from base -10 to base 10.
A bijection from N = [0..oo) to Z = (-oo..+oo), or enumeration of the integers. - M. F. Hasler, Oct 17 2018

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[FromDigits[ IntegerDigits[n, 10]], {n, 0, 80}]; b = {}; Do[ b = Append[b, f[a[[n]], 10]], {n, 1, 80}]; b (* Typo fixed by Harvey P. Dale, Oct 03 2013 *)
  • PARI
    a(n)=fromdigits(digits(n),-10) \\ M. F. Hasler, Oct 17 2018

Formula

a(10*k+m) = -10*a(k)+m for 0 <= m < 10. - Chai Wah Wu, Jan 16 2020

A073791 Replace 4^k with (-4)^k in base 4 expansion of n.

Original entry on oeis.org

0, 1, 2, 3, -4, -3, -2, -1, -8, -7, -6, -5, -12, -11, -10, -9, 16, 17, 18, 19, 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 32, 33, 34, 35, 28, 29, 30, 31, 24, 25, 26, 27, 20, 21, 22, 23, 48, 49, 50, 51, 44, 45, 46, 47, 40, 41, 42, 43, 36, 37, 38, 39, -64, -63, -62, -61, -68, -67, -66, -65, -72, -71, -70, -69
Offset: 0

Views

Author

Robert G. Wilson v, Aug 12 2002

Keywords

Comments

Base 4 representation for n converted from base -4 to base 10.

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 4]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 4]], {n, 1, 80}]; b
  • PARI
    a(n) = subst(Pol(digits(n,4)), x, -4); \\ Michel Marcus, Jan 30 2019

Formula

a(4*k+m) = -4*a(k)+m for 0 <= m < 4. - Chai Wah Wu, Jan 16 2020

A073792 Replace 5^k with (-5)^k in base 5 expansion of n.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Aug 12 2002

Keywords

Comments

Base 5 representation for n converted from base -5 to base 10.

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 5]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 5]], {n, 1, 80}]; b

Formula

a(5*k+m) = -5*a(k)+m for 0 <= m < 5. - Chai Wah Wu, Jan 16 2020

A073793 Replace 6^k with (-6)^k in base 6 expansion of n.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Aug 12 2002

Keywords

Comments

Base 6 representation for n converted from base -6 to base 10.

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 6]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 6]], {n, 1, 80}]; b

Formula

a(6*k+m) = -6*a(k)+m for 0 <= m < 6. - Chai Wah Wu, Jan 16 2020

A073795 Replace 8^k with (-8)^k in base 8 expansion of n.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Aug 12 2002

Keywords

Comments

Base 8 representation for n (in lexicographic order) converted from base -8 to base 10.

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 8]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 8]], {n, 1, 80}]; b

Formula

a(8*k+m) = -8*a(k)+m for 0 <= m < 8. - Chai Wah Wu, Jan 16 2020

A073796 Replace 9^k with (-9)^k in base 9 expansion of n.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Aug 12 2002

Keywords

Comments

Base 9 representation for n (in lexicographic order) converted from base -9 to base 10.

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 9]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 9]], {n, 1, 80}]; b

Formula

a(9*k+m) = -9*a(k)+m for 0 <= m < 9. - Chai Wah Wu, Jan 16 2020

A180352 A permutation of Motzkin numbers by reversal of indices in blocks of length 7.

Original entry on oeis.org

127, 51, 21, 9, 4, 2, 1, 113634, 41835, 15511, 5798, 2188, 835, 323, 142547559, 50852019, 18199284, 6536382, 2356779, 853467, 310572, 208023278209, 73007772802, 25669818476, 9043402501, 3192727797, 1129760415, 400763223
Offset: 1

Views

Author

Matt Insall (insall(AT)mst.edu), Aug 29 2010

Keywords

Comments

The sequence shows A001006(7) down to A001006(1), then A001006(14) down to A001006(8), etc., varying the index in a sawtooth pattern.
When I initially logged in to use the OEIS, it 'pre-loaded' the search box with a sequence. The seven terms 127,51,21,9,4,2,1 are obtained from that original one by reversing the terms.
"Periodic" term reversals of this sort are routinely encountered when writing out convolution sums.

Crossrefs

Programs

Formula

Let r(n) = 7, 6, 5 ,4, 3, 2, 1 (n>=1), extended with r(n+7)=7+r(n), then a(n) = A001006(r(n)).
Showing 1-9 of 9 results.