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.

A105726 Involution of nonnegative integers. A deeply recursive variant of A056539.

This page as a plain text file.
%I A105726 #30 Jan 28 2025 12:51:08
%S A105726 0,1,2,3,6,5,4,7,14,9,10,13,12,11,8,63,126,17,22,25,26,21,18,29,28,19,
%T A105726 20,27,24,23,64,31,62,129,46,49,54,41,38,57,58,37,42,53,50,45,34,253,
%U A105726 252,35,44,51,52,43,36,59,56,39,40,55,192,191,32,15,30,65,382,385,110
%N A105726 Involution of nonnegative integers. A deeply recursive variant of A056539.
%C A105726 Keyword "look" refers especially to the scatterplot image by _Rémy Sigrist_, which has a strong resemblance to an FPGA architecture diagram. - _Antti Karttunen_, Dec 25 2024
%H A105726 Paul Tek, <a href="/A105726/b105726.txt">Table of n, a(n) for n = 0..10000</a>
%H A105726 Rémy Sigrist, <a href="/A105726/a105726.png">Scatterplot of (n, a(n)) such that n, a(n) < 2^20</a>
%H A105726 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%H A105726 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e A105726 By definition a(0)=0 and a(1)=1.
%e A105726 a(2)=2, as 2 = 10 in binary, thus its run counts are (1 1), which reversed yields the same (1 1), from which we collect a binary number 10, i.e. 2 in decimal.
%e A105726 a(4)=6, as 4 = 100 in binary, thus its run counts are (1 2), which reversed and each element mapped through a itself yields (2 1), which are run counts of binary number 110, i.e. 6 in decimal.
%e A105726 a(16)=126, as 16 = 10000 in binary, thus its run counts are (1 4), which reversed yields (4 1) and a(4)=6 and a(1)=1, thus we find that the run counts (6 1) form a binary 1111110 i.e. 126 in decimal.
%o A105726 (Scheme) (define (A105726 n) (cond ((< n 2) n) (else (runcount1list->binexp (map A105726 (reverse! (binexp->runcount1list n))))))) (define (binexp->runcount1list n) (if (zero? n) (list) (let loop ((n n) (rc (list)) (count 0) (prev-bit (modulo n 2))) (if (zero? n) (cons count rc) (if (eq? (modulo n 2) prev-bit) (loop (floor->exact (/ n 2)) rc (1+ count) (modulo n 2)) (loop (floor->exact (/ n 2)) (cons count rc) 1 (modulo n 2))))))) (define (runcount1list->binexp lista) (let loop ((lista lista) (s 0) (state 1)) (cond ((null? lista) s) (else (loop (cdr lista) (+ (* s (expt 2 (car lista))) (* state (- (expt 2 (car lista)) 1))) (- 1 state))))))
%Y A105726 Differs from its "shallow" version A056539 first time at n=15, where A056539(15)=15, but here a(15)=63.
%K A105726 nonn,look,base
%O A105726 0,3
%A A105726 _Antti Karttunen_, Apr 18 2005