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.

User: Wyatt Powers

Wyatt Powers's wiki page.

Wyatt Powers has authored 2 sequences.

A343129 Numbers that are palindromes in base 3/2.

Original entry on oeis.org

0, 1, 2, 5, 8, 17, 35, 170, 278, 422, 494
Offset: 0

Author

Wyatt Powers, Apr 05 2021

Keywords

Comments

Next term >= 10^12. - Joerg Arndt, Apr 06 2021
Next term > 2^64. - David Radcliffe, Dec 10 2021

Examples

			    0:  0
    1:  1
    2:  2
    5:  22
    8:  212
   17:  21012
   35:  212212
  170:  2120220212
  278:  21221112212
  422:  2101100011012
  494:  2120010100212
		

Crossrefs

Cf. A024629.

Programs

  • Mathematica
    (* All terms <= 500: *)
    b = {};
    a[n_] := If[n < 1, 0, a[Quotient[n, 3] 2] 10 + Mod[n, 3]];
    Do[If[PalindromeQ[a[n]], AppendTo[b, n], Nothing], {n, 0, 500}];
    b

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

Original entry on oeis.org

0, 1, -3, -2, 9, 10, 6, 7, -27, -26, -30, -29, -18, -17, -21, -20, 81, 82, 78, 79, 90, 91, 87, 88, 54, 55, 51, 52, 63, 64, 60, 61, -243, -242, -246, -245, -234, -233, -237, -236, -270, -269, -273, -272, -261, -260, -264, -263, -162, -161, -165, -164, -153, -152, -156, -155, -189, -188, -192, -191, -180, -179, -183, -182
Offset: 0

Author

Wyatt Powers, Mar 21 2021

Keywords

Comments

All terms correspond to a sum of distinct powers of -3.

Examples

			For n = 0, a(0) = 0.
for n = 1, a(1) = -3^0 = 1.
for n = 2, a(2) = -3^1 = -3.
for n = 3, a(3) = -3^1 + -3^0 = -2.
for n = 4, a(4) = -3^2 = 9.
for n = 5, a(5) = -3^2 + -3^0 = 10.
		

Crossrefs

Cf. A005836 (sums of distinct powers of 3), A053985, A065369.

Programs

  • Mathematica
    (* Returns first 100 numbers in the sequence; assigned to the list, a *)
    a = Table[IntegerDigits[x, 2], {x, 0, 100}];
    For[i = 1, i <= Length[a], i++,
      For[j = 1, j <= Length[a[[i]]], j++,
       a[[i]][[j]] = ((a[[i]][[j]])*(-3)^(Length[a[[i]]] - j))
       ]
      ];
    For[i = 1, i <= Length[a], i++, a[[i]] = Total[a[[i]]]];
    a
  • PARI
    a(n) = my(b=Vecrev(binary(n))); sum(k=1, #b, b[k]*(-3)^(k-1)); \\ Michel Marcus, Mar 22 2021
    
  • PARI
    a(n) = fromdigits(binary(n),-3) \\ Kevin Ryde, Mar 22 2021
    
  • Python
    def a(n):
      return sum((-3)**k for k, b in enumerate(bin(n)[2:][::-1]) if b=='1')
    print([a(n) for n in range(64)]) # Michael S. Branicky, Mar 23 2021