login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A302780 Restricted growth sequence transform of 4-tuple [H(H(n-1)), H(n-H(n-1)), Q(n-Q(n-1)), Q(n-Q(n-2))] where H = A004001 and Q = A005185. 2

%I #10 Apr 27 2018 17:11:49

%S 1,1,2,3,4,5,6,6,7,8,9,10,11,12,13,14,15,16,17,18,18,19,20,21,22,23,

%T 24,25,25,25,26,27,28,29,30,31,32,33,34,35,36,36,37,38,38,39,39,40,41,

%U 42,43,44,45,46,47,48,49,47,50,50,50,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,70,71,72,73,74,75,76,77,78,79,79,80,80

%N Restricted growth sequence transform of 4-tuple [H(H(n-1)), H(n-H(n-1)), Q(n-Q(n-1)), Q(n-Q(n-2))] where H = A004001 and Q = A005185.

%C Restricted growth sequence transform of A286560: a filter sequence which includes both the summands of A004001 and the summands of A005185.

%C For all i, j: a(i) = a(j) => b(i) = b(j), where b is a sequence like A087740, A284019, A286569 or A302779.

%C For n > 1000 the duplicates get rare. In range [1000, 65536] there are only three cases: a(1353) = a(1354) = 1319, a(39361) = a(39362) = 39326, and a(46695) = a(46696) = 46659.

%H Antti Karttunen, <a href="/A302780/b302780.txt">Table of n, a(n) for n = 1..65537</a>

%H <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a>

%o (PARI)

%o up_to = 65537;

%o first_n_of_A004001(n) = { my(v=vector(n)); v[1]=v[2]=1; for(k=3, n, v[k]=v[v[k-1]]+v[k-v[k-1]]); (v); }; \\ Charles R Greathouse IV, Feb 26 2017

%o v004001 = first_n_of_A004001(up_to);

%o A004001(n) = v004001[n];

%o first_n_of_A005185(n) = { my(v=vector(n)); v[1]=v[2]=1; for(k=3, n, v[k]=v[k-v[k-1]]+v[k-v[k-2]]); (v); }; \\

%o v005185 = first_n_of_A005185(up_to);

%o A005185(n) = v005185[n];

%o Aux302780(n) = if(n<3,0,[A004001(A004001(n-1)), A004001(n-A004001(n-1)), A005185(n-A005185(n-1)), A005185(n-A005185(n-2))]);

%o 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 write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }

%o write_to_bfile(1,rgs_transform(vector(up_to,n,Aux302780(n))),"b302780.txt");

%Y Cf. A004001, A005185, A286560.

%Y Cf. also A087740, A284019, A286541, A286569, A302779.

%K nonn

%O 1,3

%A _Antti Karttunen_, Apr 27 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 09:23 EDT 2024. Contains 371782 sequences. (Running on oeis4.)