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.

A318309 Restricted growth sequence transform of A083254 (2*phi(n) - n).

This page as a plain text file.
%I A318309 #6 Aug 26 2018 12:27:04
%S A318309 1,2,1,2,3,4,5,2,3,4,6,7,8,4,1,2,9,10,11,7,3,4,12,13,9,4,6,7,14,15,16,
%T A318309 2,17,4,18,19,20,4,6,13,21,22,23,7,3,4,24,25,20,26,18,7,27,22,28,13,9,
%U A318309 4,29,30,31,4,6,2,32,33,34,7,35,36,37,38,39,4,5,7,40,41,42,25,14,4,43,44,40,4,28,13,45,46,47,7,14,4,48,49,50,15,12,51
%N A318309 Restricted growth sequence transform of A083254 (2*phi(n) - n).
%H A318309 Antti Karttunen, <a href="/A318309/b318309.txt">Table of n, a(n) for n = 1..65537</a>
%o A318309 (PARI)
%o A318309 up_to = 65537;
%o A318309 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 A318309 A083254(n) = (2*eulerphi(n)-n);
%o A318309 v318309 = rgs_transform(vector(up_to,n,A083254(n)));
%o A318309 A318309(n) = v318309[n];
%Y A318309 Cf. A000010, A083254, A286449.
%K A318309 nonn
%O A318309 1,2
%A A318309 _Antti Karttunen_, Aug 26 2018