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!)
A295877 Restricted growth sequence transform of A173557, Product_{p|n} (p-1). 2

%I #6 Nov 29 2017 19:25:34

%S 1,1,2,1,3,2,4,1,2,3,5,2,6,4,7,1,8,2,9,3,6,5,10,2,3,6,2,4,11,7,12,1,

%T 13,8,14,2,15,9,14,3,16,6,17,5,7,10,18,2,4,3,19,6,20,2,16,4,15,11,21,

%U 7,22,12,6,1,23,13,24,8,25,14,26,2,27,15,7,9,22,14,28,3,2,16,29,6,30,17,31,5,32,7,27,10,22,18,27,2,33,4,13,3,34,19,35,6,23

%N Restricted growth sequence transform of A173557, Product_{p|n} (p-1).

%H Antti Karttunen, <a href="/A295877/b295877.txt">Table of n, a(n) for n = 1..65536</a>

%F a(2n) = a(n).

%o (PARI)

%o allocatemem(2^30);

%o up_to = 65536;

%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 A173557(n) = my(f=factor(n)[, 1]); prod(k=1, #f, f[k]-1); \\ This function from _Michel Marcus_, Oct 31 2017

%o write_to_bfile(1,rgs_transform(vector(up_to,n,A173557(n))),"b295877.txt");

%Y Cf. A173557, A295876.

%K nonn

%O 1,3

%A _Antti Karttunen_, Nov 29 2017

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 24 10:00 EDT 2024. Contains 371935 sequences. (Running on oeis4.)