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.

A245612 Permutation of natural numbers: a(0) = 1, a(1) = 2, a(2n) = 3*a(n)-1, a(2n+1) = A254049(a(n)); composition of A048673 and A163511.

This page as a plain text file.
%I A245612 #22 Jul 25 2016 21:01:03
%S A245612 1,2,5,3,14,13,8,4,41,63,38,25,23,18,11,6,122,313,188,172,113,123,74,
%T A245612 61,68,88,53,39,32,28,17,7,365,1563,938,1201,563,858,515,666,338,613,
%U A245612 368,424,221,303,182,85,203,438,263,270,158,193,116,72,95,138,83,46,50,33,20,9
%N A245612 Permutation of natural numbers: a(0) = 1, a(1) = 2, a(2n) = 3*a(n)-1, a(2n+1) = A254049(a(n)); composition of A048673 and A163511.
%C A245612 Note the indexing: the domain starts from 0, while the range excludes zero.
%C A245612 From _Antti Karttunen_, Jul 25 2016: (Start)
%C A245612 This sequence can be represented as a binary tree. Each left hand child is obtained by applying A016789(n-1) when the parent contains n (i.e., multiply by 3, subtract one), and each right hand child is obtained by applying A254049 to the parent's contents:
%C A245612                                      1
%C A245612                                      |
%C A245612                   ...................2...................
%C A245612                  5                                       3
%C A245612       14......../ \........13                  8......../ \........4
%C A245612       / \                 / \                 / \                 / \
%C A245612      /   \               /   \               /   \               /   \
%C A245612     /     \             /     \             /     \             /     \
%C A245612   41       63         38       25         23       18         11       6
%C A245612 122 313 188  172   113  123  74  61     68  88   53  39     32  28   17 7
%C A245612 etc.
%C A245612 (End)
%H A245612 Antti Karttunen, <a href="/A245612/b245612.txt">Table of n, a(n) for n = 0..8191</a>
%H A245612 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A245612 a(n) = A048673(A163511(n)).
%F A245612 a(0) = 1, a(1) = 2, a(2n) = 3*a(n)-1, a(2n+1) = A254049(a(n)). - _Antti Karttunen_, Jul 25 2016
%t A245612 Table[(Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ If[n == 0, 1, Prime[#] Product[Prime[m]^(Map[Ceiling[(Length@ # - 1)/2] &, DeleteCases[Split@ Join[Riffle[IntegerDigits[n, 2], 0], {0}], {k__} /; k == 1]][[-m]]), {m, #}] &[DigitCount[n, 2, 1]]], {n, 0, 63}] (* _Michael De Vlieger_, Jul 25 2016 *)
%o A245612 (Scheme) (define (A245612 n) (A048673 (A163511 n))) ;; offset 0, a(0) = 1.
%Y A245612 Inverse: A245611.
%Y A245612 Cf. A016789, A048673, A163511, A243065-A243066, A243505-A243506, A245608, A245610, A244153, A244154, A254049.
%K A245612 nonn,tabf
%O A245612 0,2
%A A245612 _Antti Karttunen_, Jul 28 2014