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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 21 2014

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.)
		

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.

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)))))

Formula

If A246260(n) = 1, a(n) = 0, otherwise 1 + a(A003961(n)).

A246280 a(n) = the smallest starting value for k such that n will be the exact number of additional iterations of A003961 needed when we start from A003961(k) before we first reach a number of the form 4k+1; the least k such that A246271(k) = n.

Original entry on oeis.org

1, 2, 5, 66, 91, 55, 21, 46, 1362, 1654, 1419, 574, 6463, 5263, 4607, 3497, 589843, 430261, 574823, 567583, 554111, 545869, 20490043, 14635735, 8781429
Offset: 0

Views

Author

Antti Karttunen, Aug 22 2014

Keywords

Comments

The sequence is infinite (well-defined for all n), provided that A246271 is not bounded.
All the terms are squarefree (see the comment in A246259).
From 2 onward their prime factorizations are: 2, 5, 2*3*11, 7*13, 5*11, 3*7, 2*23, 2*3*227, 2*827, 3*11*43, 2*7*41, 23*281, 19*277, 17*271, 13*269, 571*1033, 13*23*1439, 563*1021, 557*1019, 547*1013, 541*1009, 7*2927149, 5*2927147, 3*2927143. (Note that 2927149 = A000040(211943)).
Note how A003961(21) = 55 and A003961(55) = 91. Also A003961(545869) = 554111, A003961(554111) = 567583, A003961(567583) = 574823.
Similarly: A003961(8781429) = 14635735 and A003961(14635735) = 20490043.
Apart from those descending subsections, the growth rate of the sequence should be roughly a(n) ~ 2^n, assuming that the distribution of 4k+1 (A002144) and 4k+3 primes (A002145) among the primes is even and essentially random.

Examples

			a(0) = 1, because 1 is the first such number >= 1 that no iterations are needed before A003961(1) (= 1) is of the form 4k+1.
a(1) = 2, because 2 is the first such number >= 1 that exactly one additional iteration of A003961 is needed before A003961(2) = 3 is of the form 4k+1; as A003961(3) = 5.
a(2) = 5, because 5 is the first such number that 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.
		

Crossrefs

Leftmost column of array A246259.
A246167 gives the same sequence sorted into ascending order.

Programs

Showing 1-2 of 2 results.