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.

A304740 Restricted growth sequence transform of A304760(n), formed from 1-digits in ternary representation of A254103(n).

This page as a plain text file.
%I A304740 #11 Jan 29 2022 20:14:39
%S A304740 1,2,1,3,3,4,1,1,5,6,6,2,3,7,6,8,9,4,1,6,10,1,1,5,5,11,11,3,10,12,12,
%T A304740 8,13,6,6,14,3,15,11,1,16,17,12,14,3,17,12,2,9,18,19,2,20,4,1,12,16,4,
%U A304740 1,11,21,12,12,2,22,4,1,23,10,19,19,14,5,24,24,2,20,7,6,25,26,23,23,3,21,19,19,25,5,23,23,10,21,1,1,10,13,27,27,21,28,1,1
%N A304740 Restricted growth sequence transform of A304760(n), formed from 1-digits in ternary representation of A254103(n).
%H A304740 Antti Karttunen, <a href="/A304740/b304740.txt">Table of n, a(n) for n = 0..65537</a>
%o A304740 (PARI)
%o A304740 A254103(n) = if(!n,n,if(!(n%2),(3*A254103(n/2))-1,(3*(1+A254103((n-1)/2)))\2));
%o A304740 A289813(n) = { my (d=digits(n, 3)); from digits(vector(#d, i, if (d[i]==1, 1, 0)), 2); } \\ From A289813
%o A304740 A304760(n) = A289813(A254103(n));
%o A304740 rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
%o A304740 v304740 = rgs_transform(vector(65538,n,A304760(n-1)));
%o A304740 A304740(n) = v304740[1+n];
%Y A304740 Cf. A254103, A289813, A304760.
%Y A304740 Cf. also A304746.
%K A304740 nonn,look
%O A304740 0,2
%A A304740 _Antti Karttunen_, May 29 2018