login
A246271
Starting from A003961(n), the number of additional iterations of A003961 required for the result to be of the form 4k+1.
15
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, 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, 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
OFFSET
1,5
LINKS
FORMULA
If A246260(n) = 1, a(n) = 0, otherwise 1 + a(A003961(n)).
EXAMPLE
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.)
PROG
(PARI)
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
A246271(n) = {my(i); i=0; n = A003961(n); while(((n%4)!=1), i++; n = A003961(n)); i};
for(n=1, 10001, write("b246271.txt", n, " ", A246271(n)));
(Scheme, two different variants, the second one employing memoizing definec-macro)
(define (A246271 n) (let loop ((i 0) (n n)) (let ((next (A003961 n))) (if (= 1 (modulo next 4)) i (loop (+ i 1) next)))))
(definec (A246271 n) (if (= 1 (A246260 n)) 0 (+ 1 (A246271 (A003961 n)))))
CROSSREFS
A246261 gives the positions of zeros, A246263 the positions of nonzeros.
A246280 the positions where n occurs for the first time, A246167 the positions of new distinct values.
Sequence in context: A265863 A083747 A326787 * A049334 A054924 A370167
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 21 2014
STATUS
approved