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

A224512 Gray code variant of A147582.

Original entry on oeis.org

1, 4, 12, 4, 12, 36, 12, 4, 12, 36, 108, 36, 12, 36, 12, 4, 12, 36, 108, 36, 108, 324, 108, 36, 12, 36, 108, 36, 12, 36, 12, 4, 12, 36, 108, 36, 108, 324, 108, 36, 108, 324, 972, 324, 108, 324, 108, 36, 12, 36, 108, 36, 108, 324, 108, 36, 12, 36, 108
Offset: 1

Views

Author

Gary W. Adamson, Apr 08 2013

Keywords

Comments

A147582 is generated by using the binary weight of n, A000120 = wt().
Here instead, A224512 uses the Gray code weight, A005811 = gt().

Examples

			A003188(5-1) = 6 = 110 (base 2), so gt(5-1) = 2. Then a(5) = 12 = 4 * 3^1 = 12.
		

Crossrefs

Programs

  • PARI
    gt(n) = sum(kk=1, n, (-1)^((kk/2^valuation(kk, 2)-1)/2)); \\ from A005811.
    a(n) = if (n==1, 1, 4 * 3^(gt(n-1)-1)); \\ Michel Marcus, Apr 22 2013

Formula

a(1) = 1. For a(n)>1, a(n) = 4 * 3^(gt(n-1)-1).
Showing 1-1 of 1 results.