Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Filter sequence for counting the residue classes mod 8 of divisors of n.
5

%I #6 Oct 08 2018 08:09:13

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

%T 21,5,22,7,23,20,24,13,25,5,6,13,26,15,22,3,11,27,12,7,28,29,30,20,17,

%U 5,31,13,32,20,10,3,33,5,12,34,35,36,31,3,37,13,22,7,38,15,10,39,11,13,22,7,40,41,24,3,33,36,6,13,18,15,42,13,21,13,12,13,43,15,44,45,46,5,31,7,26

%N Filter sequence for counting the residue classes mod 8 of divisors of n.

%C Restricted growth sequence transform of A320108.

%C For all i, j: a(i) = a(j) => A320115(i) = A320115(j).

%H Antti Karttunen, <a href="/A320109/b320109.txt">Table of n, a(n) for n = 1..100000</a>

%o (PARI)

%o up_to = 100000;

%o A320108(n) = { my(m=1); fordiv(n,d,if(d>1, m *= prime(1+(d%8)))); (m); };

%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 v320109 = rgs_transform(vector(up_to,n,A320108(n)));

%o A320109(n) = v320109[n];

%Y Cf. A320108, A320113, A320115, A320117.

%K nonn

%O 1,2

%A _Antti Karttunen_, Oct 06 2018