login
a(n) = n - gcd(n, A003961(A356164(n))), where A356164(n) is the smallest positive k such that n divides k*A003961(k), and A003961 is fully multiplicative with a(p) = nextprime(p).
5

%I #10 Jul 28 2022 21:16:18

%S 0,1,0,3,0,3,0,7,0,5,0,9,0,7,10,15,0,9,0,15,0,11,0,21,0,13,0,21,0,15,

%T 0,31,0,17,28,27,0,19,0,35,0,21,0,33,30,23,0,45,0,25,0,39,0,27,0,49,0,

%U 29,0,45,0,31,0,63,0,33,0,51,0,63,0,63,0,37,50,57,66,39,0,75,0,41,0,63,0,43,0,77,0,75,0,69

%N a(n) = n - gcd(n, A003961(A356164(n))), where A356164(n) is the smallest positive k such that n divides k*A003961(k), and A003961 is fully multiplicative with a(p) = nextprime(p).

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

%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>

%F a(n) = n - A356168(n) = n - gcd(n, A003961(A356164(n))).

%o (PARI)

%o A003961(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };

%o A356169(n) = for(k=1, oo, if((k*A003961(k))%n==0, return(n-gcd(n,A003961(k)))));

%Y Cf. A003961, A356164, A356166, A356168, A356171 (positions of 0's), A356172.

%K nonn

%O 1,4

%A _Antti Karttunen_, Jul 28 2022