cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A246271 Starting from A003961(n), the number of additional iterations of A003961 required for the result to be of the form 4k+1.

This page as a plain text file.
%I A246271 #13 Aug 26 2014 01:15:29
%S A246271 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 A246271 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 A246271 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 A246271 Starting from A003961(n), the number of additional iterations of A003961 required for the result to be of the form 4k+1.
%H A246271 Antti Karttunen, <a href="/A246271/b246271.txt">Table of n, a(n) for n = 1..10001</a>
%F A246271 If A246260(n) = 1, a(n) = 0, otherwise 1 + a(A003961(n)).
%e A246271 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 A246271 (PARI)
%o A246271 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 A246271(n) = {my(i); i=0; n = A003961(n); while(((n%4)!=1), i++; n = A003961(n)); i};
%o A246271 for(n=1, 10001, write("b246271.txt", n, " ", A246271(n)));
%o A246271 (Scheme, two different variants, the second one employing memoizing definec-macro)
%o A246271 (define (A246271 n) (let loop ((i 0) (n n)) (let ((next (A003961 n))) (if (= 1 (modulo next 4)) i (loop (+ i 1) next)))))
%o A246271 (definec (A246271 n) (if (= 1 (A246260 n)) 0 (+ 1 (A246271 (A003961 n)))))
%Y A246271 A246261 gives the positions of zeros, A246263 the positions of nonzeros.
%Y A246271 A246280 the positions where n occurs for the first time, A246167 the positions of new distinct values.
%Y A246271 Cf. A003961, A246260, A246272, A246259, A246277.
%K A246271 nonn
%O A246271 1,5
%A A246271 _Antti Karttunen_, Aug 21 2014