login
Filter combining sum of proper divisors (A001065) and cototient (A051953) of n.
7

%I #6 Dec 04 2017 09:19:35

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

%T 20,1,21,22,23,24,25,1,26,27,28,1,29,1,30,31,32,1,33,34,35,36,37,1,38,

%U 27,39,40,41,1,42,1,43,44,45,46,47,1,48,49,50,1,51,1,52,53,54,46,55,1,56,57,58,1,59,40,60,61,62,1,63,36

%N Filter combining sum of proper divisors (A001065) and cototient (A051953) of n.

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

%F Restricted growth sequence transform of a(n) = (1/2)*(2 + ((A051953(n) + A001065(n))^2) - A051953(n) - 3*A001065(n)).

%o (PARI)

%o allocatemem(2^30);

%o up_to = 65537;

%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 A051953(n) = (n-eulerphi(n));

%o A001065(n) = (sigma(n)-n);

%o Anotsubmitted5(n) = (1/2)*(2 + ((A051953(n)+A001065(n))^2) - A051953(n) - 3*A001065(n));

%o write_to_bfile(1,rgs_transform(vector(up_to,n,Anotsubmitted5(n))),"b295885.txt");

%Y Cf. A001065, A051953, A291765.

%K nonn

%O 1,4

%A _Antti Karttunen_, Dec 03 2017