%I #13 Aug 26 2014 01:15:29
%S 0,1,0,0,2,2,1,1,0,0,0,0,0,0,1,0,2,1,1,2,6,1,0,2,0,2,0,1,1,0,0,1,0,0,
%T 0,0,0,0,0,0,2,0,1,0,2,7,0,0,0,1,1,0,1,2,5,0,2,0,0,1,2,1,1,0,1,3,1,2,
%U 0,3,0,1,2,2,0,1,1,1,1,2,0,0,0,6,0,0,6,1,0,0,4,0,0,3,0,2,0,1,0,0,2,0,1,2,0,0,0,0,0,0,0,1,2,0,1,1,0,2,0,0,0,0,1
%N Starting from A003961(n), the number of additional iterations of A003961 required for the result to be of the form 4k+1.
%H Antti Karttunen, <a href="/A246271/b246271.txt">Table of n, a(n) for n = 1..10001</a>
%F If A246260(n) = 1, a(n) = 0, otherwise 1 + a(A003961(n)).
%e a(5) = 2, because exactly two additional iterations of A003961 are needed before A003961(5) = 7 is of the form 4k+1; as A003961(7) = 11 and A003961(11) = 13. (We have 7 = 3 mod 4, 11 = 3 mod 4 and 13 = 1 mod 4.)
%o (PARI)
%o A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of _Michel Marcus_
%o A246271(n) = {my(i); i=0; n = A003961(n); while(((n%4)!=1), i++; n = A003961(n)); i};
%o for(n=1, 10001, write("b246271.txt", n, " ", A246271(n)));
%o (Scheme, two different variants, the second one employing memoizing definec-macro)
%o (define (A246271 n) (let loop ((i 0) (n n)) (let ((next (A003961 n))) (if (= 1 (modulo next 4)) i (loop (+ i 1) next)))))
%o (definec (A246271 n) (if (= 1 (A246260 n)) 0 (+ 1 (A246271 (A003961 n)))))
%Y A246261 gives the positions of zeros, A246263 the positions of nonzeros.
%Y A246280 the positions where n occurs for the first time, A246167 the positions of new distinct values.
%Y Cf. A003961, A246260, A246272, A246259, A246277.
%K nonn
%O 1,5
%A _Antti Karttunen_, Aug 21 2014