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

A323752 Fixed points of A323710.

Original entry on oeis.org

1, 6, 28, 40, 240, 544, 832, 1152, 2816, 50176, 118784, 131584, 409600, 1050624, 1056768, 1081344, 2031616, 8519680, 118489088, 201588736, 352321536, 6446645248, 15300820992, 25836912640, 104152956928, 150323855360, 1099545182208, 3315714752512, 4398583382016
Offset: 1

Views

Author

Luc Rousseau, Jan 26 2019

Keywords

Comments

If f(n) denotes the binary tree representation of n defined in A323710, then this sequence lists the n such that f(n) is symmetrical.

Examples

			The recursive decomposition of 50176 with formula "parent = (2^left)*(2*right+1)" gives the following binary tree representation:
         o
        / \
       /   \
      /     \
     o       o
    / \     / \
   o   o   o   o
      /     \
     o       o
This tree is symmetrical, so 50176 is in the sequence.
		

Crossrefs

Cf. A323710.

A323665 a(n) is the number of vertices in the binary tree the root of which is assigned the value n and built recursively by the rule: write node's value as (2^c)*(2k+1); if c>0, create a left child with value c; if k>0, create a right child with value k.

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 5, 5, 6, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 6, 6, 7, 7, 7, 7, 7, 7, 6, 7, 7
Offset: 1

Views

Author

Luc Rousseau, Jan 23 2019

Keywords

Comments

Mirroring (left <--> right) the tree corresponding to n and computing back a number gives rise to sequence A323710. Swapping the left and right subtrees of the root of the tree corresponding to n and computing back a number gives rise to sequence A117303.

Examples

			100 = (2^2)*(2*12+1) and recursively, 2 = (2^1), 12 = (2^2)*(2*1+1). We then have the following binary tree representation:
     100                                         o
     / \                                        / \
    2  12                                      o   o
   /   / \              or more simply        /   / \
  1   2   1                                  o   o   o
     /                                          /
    1                                          o
7 vertices, so a(100) = 7.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0, (j->
          1+a(j)+a((n/2^j-1)/2))(padic[ordp](n, 2)))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 23 2019
  • Mathematica
    nEdges[n_] :=
    If[n == 0, 0,
      Module[{c, xx, k}, c = IntegerExponent[n, 2]; xx = n/2^c;
       k = (xx - 1)/2;
       Boole[c != 0]*(1 + nEdges[c]) + Boole[k != 0]*(1 + nEdges[k])]]
    a[n_] := nEdges[n] + 1
    Table[a[n], {n, 1, 87}]
Showing 1-2 of 2 results.