A246271 Starting from A003961(n), the number of additional iterations of A003961 required for the result to be of the form 4k+1.
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
Keywords
Examples
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.)
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10001
Crossrefs
Programs
-
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)))))