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.
%I A279047 #21 Jun 11 2024 15:45:57 %S A279047 1,2,2,4,2,2,2,4,4,2,2,2,2,4,5,6,2,2,4,2,2,4,4,2,2,2,4,2,2,2,4,4,2,5, %T A279047 2,2,2,4,5,6,2,2,2,2,2,3,4,4,2,2,6,2,2,4,5,4,2,2,2,2,4,5,4,2,2,5,2,6, %U A279047 2,2,6,4,2,2,4,4,4,2,2,7,2,2,2,2,4,4,2,2,2,4,8,5,4,3,4,4,3,2,2,2,4,5,4,2,2,6,5,6 %N A279047 Number k of modular reductions at which the recurrence relation x(i+1) = x(0) mod x(i) terminates with x(k) = 1, where x(0) = prime(n+1), x(1) = prime(n). %C A279047 x(i) is a strictly decreasing sequence of nonnegative integers by definition of modular reduction. So at some point x(t) = 0. Let j be the previous positive value, i.e., x(t-1) = j. Then as x(0) mod j = prime(n+1) mod j = x(t) = 0, j|prime(n+1). Since j < prime(n+1), j = 1. %e A279047 For n=4, x(0) = p(5) = 11, x(1) = p(4) = 7. 11 mod 7 = 4 ==> 11 mod 4 = 3 ==> 11 mod 3 = 2 ==> 11 mod 2 = 1. Since there are four modular reductions, a(4) = 4. %o A279047 (SageMath) %o A279047 A = [] %o A279047 q = 1 %o A279047 for i in range(100): %o A279047 q = next_prime(q) %o A279047 p = next_prime(q) %o A279047 r = p%q %o A279047 ctr = 1 %o A279047 while r!=1: %o A279047 r = p%r %o A279047 ctr += 1 %o A279047 A.append(ctr) %o A279047 print(A) %Y A279047 Cf. A051010, A072030, A278744. %K A279047 nonn %O A279047 1,2 %A A279047 _Adnan Baysal_, Dec 04 2016