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

A256756 a(n) = bitwise XOR of n and the reverse of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 25, 18, 39, 60, 45, 86, 67, 72, 22, 25, 0, 55, 50, 45, 36, 83, 78, 65, 29, 18, 55, 0, 9, 22, 27, 108, 117, 122, 44, 39, 50, 9, 0, 27, 110, 101, 100, 111, 55, 60, 45, 22, 27, 0, 121, 114, 111, 100, 58, 45, 36, 27, 110, 121
Offset: 0

Views

Author

Alois P. Heinz, Apr 09 2015

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> Bits[Xor](n, (s-> parse(cat(s[-i]$i=1..length(s))))(""||n)):
    seq(a(n), n=0..80);
  • Mathematica
    Table[BitXor[n,FromDigits[Reverse[IntegerDigits[n]]]],{n,0,65}] (* Ivan N. Ianakiev, Apr 10 2015 *)
  • PARI
    a(n) = bitxor(n, subst(Polrev(digits(n)), x, 10)); \\ Michel Marcus, Apr 10 2015

Formula

a(n) = A003987(n, A004086(n)).

A338827 For any number with decimal representation (d(1), d(2), ..., d(k)), the decimal representation of a(n) is (abs(d(1)-d(k)), abs(d(2)-d(k-1)), ..., abs(d(k)-d(1))).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 11, 22, 33, 44, 55, 66, 77, 88, 22, 11, 0, 11, 22, 33, 44, 55, 66, 77, 33, 22, 11, 0, 11, 22, 33, 44, 55, 66, 44, 33, 22, 11, 0, 11, 22, 33, 44, 55, 55, 44, 33, 22, 11, 0, 11, 22, 33, 44, 66, 55, 44, 33, 22, 11, 0, 11, 22
Offset: 0

Views

Author

Rémy Sigrist, Nov 11 2020

Keywords

Comments

Leading zeros are ignored.
All terms belong to A061917.

Examples

			For n = 1021:
- abs(1-1) = 0,
- abs(0-2) = 2,
- abs(2-0) = 2,
- abs(1-1) = 0,
- so a(1021) = 220.
		

Crossrefs

Cf. A002113, A004086, A056965, A061917, A175919 (binary analog), A330240, A338828 (ternary analog).

Programs

  • Maple
    a:= n-> (l-> (h-> add(h[j]*10^(j-1), j=1..nops(h)))([seq(
        abs(l[i]-l[-i]), i=1..nops(l))]))(convert(n, base, 10)):
    seq(a(n), n=0..70);  # Alois P. Heinz, Nov 12 2020
  • PARI
    a(n, base=10) = my (d=digits(n, base)); fromdigits(abs(d-Vecrev(d)), base)

Formula

a(n) = 0 iff n is a palindrome (A002113).
a(n) = A330240(n, A004086(n)).

A338828 For any number with ternary representation (t(1), t(2), ..., t(k)), the ternary representation of a(n) is (abs(t(1)-t(k)), abs(t(2)-t(k-1)), ..., abs(t(k)-t(1))).

Original entry on oeis.org

0, 0, 0, 4, 0, 4, 8, 4, 0, 10, 0, 10, 10, 0, 10, 10, 0, 10, 20, 10, 0, 20, 10, 0, 20, 10, 0, 28, 0, 28, 40, 12, 40, 52, 24, 52, 40, 12, 40, 28, 0, 28, 40, 12, 40, 52, 24, 52, 40, 12, 40, 28, 0, 28, 56, 28, 0, 68, 40, 12, 80, 52, 24, 68, 40, 12, 56, 28, 0, 68
Offset: 0

Views

Author

Rémy Sigrist, Nov 11 2020

Keywords

Comments

Leading zeros are ignored.

Crossrefs

Cf. A014190, A175919 (binary analog), A338827 (decimal analog).

Programs

  • Maple
    a:= n-> (l-> (h-> add(h[j]*3^(j-1), j=1..nops(h)))([seq(
        abs(l[i]-l[-i]), i=1..nops(l))]))(convert(n, base, 3)):
    seq(a(n), n=0..70);  # Alois P. Heinz, Nov 12 2020
  • PARI
    a(n, base=3) = my (d=digits(n, base)); fromdigits(abs(d-Vecrev(d)), base)

Formula

a(n) = 0 iff n is a palindrome in base 3 (A014190).
Showing 1-3 of 3 results.