Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #20 Feb 23 2016 03:43:22
%S 0,0,0,0,0,0,0,1,0,0,0,0,0,3,2,0,0,0,0,0,0,0,0,0,0,7,6,5,4,0,0,0,0,0,
%T 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,14,13,12,11,10,0,8,0,0,0,0,0,0,9,0,
%U 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,30,29,28,27,26,0,24,23,22,21,20,0,0,25
%N a(0) = 0, for n > 0, a(n) = the least (necessarily also unique) k such that A269160(k) = n, or 0 if no such k exists.
%C If n > 0 and a(n) > 0 then a(n) is the unique finite predecessor of the configuration encoded in the binary representation of n (A007088) when Wolfram's Rule 30 cellular automaton is applied.
%H Antti Karttunen, <a href="/A269162/b269162.txt">Table of n, a(n) for n = 0..16387</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Rule30.html">Rule 30</a>
%H <a href="/index/Ce#cell">Index entries for sequences related to cellular automata</a>
%H <a href="https://oeis.org/wiki/Index_to_Elementary_Cellular_Automata">Index to Elementary Cellular Automata</a>
%F Other identities. For all n >= 0:
%F a(A269160(n)) = n. [This sequence works as a left inverse of A269160.]
%F a(A110240(n+1)) = A110240(n).
%t (* empirical *) a[n_] := Module[{k}, For[k = Floor[n/7], k <= Ceiling[n/3], k++, If[BitXor[k, BitOr[2k, 4k]] == n, Return[k]]]; 0]; Table[a[n], {n, 0, 16387}] (* _Jean-François Alcover_, Feb 23 2016 *)
%o (Scheme)
%o (define (A269162 n) (let loop ((p 0)) (cond ((= n (A269160 p)) p) ((> p n) 0) (else (loop (+ 1 p)))))) ;; Very slow implementation.
%o (define (A269162 n) (if (zero? n) n (let ((nwid-2 (- (A000523 n) 2))) (let loop ((p (if (< n 4) 0 (A000079 nwid-2)))) (let ((k (A269160 p))) (cond ((= n k) p) ((> (A000523 p) nwid-2) 0) (else (loop (+ 1 p))))))))) ;; Somewhat optimized.
%Y Cf. A110240, A269160, A269163, A269164 (indices of zeros), A269165, A269166.
%K nonn
%O 0,14
%A _Antti Karttunen_, Feb 20 2016