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.

A332966 a(n) is the largest value in the sequence s defined by s(1) = 0 and for any k > 0, s(k+1) = (s(k)^2+1) mod n.

This page as a plain text file.
%I A332966 #13 Nov 10 2020 15:40:34
%S A332966 0,1,2,2,2,5,5,5,8,7,6,5,5,12,11,10,16,17,12,17,5,17,13,5,5,5,26,26,
%T A332966 26,26,26,26,26,33,26,29,26,31,26,37,32,26,36,26,26,33,43,26,47,30,50,
%U A332966 26,41,53,50,26,50,50,30,50,53,57,47,37,57,26,56,65,59
%N A332966 a(n) is the largest value in the sequence s defined by s(1) = 0 and for any k > 0, s(k+1) = (s(k)^2+1) mod n.
%C A332966 For any n > 0, the sequence s is eventually periodic, so this sequence is well defined.
%C A332966 a(n) tends to infinity as n tends to infinity.
%H A332966 Rémy Sigrist, <a href="/A332966/b332966.txt">Table of n, a(n) for n = 1..10000</a>
%H A332966 Rémy Sigrist, <a href="/A332966/a332966.png">Scatterplot of the first 750000 terms</a>
%F A332966 a(n) >= A003095(k) for any k >=0 and n > A003095(k).
%e A332966 For n = 42:
%e A332966 - we have:
%e A332966   k  s(k)
%e A332966   -  ----
%e A332966   1     1
%e A332966   2     2
%e A332966   3     5
%e A332966   4    26
%e A332966   5     5
%e A332966   6    26
%e A332966   ...
%e A332966 - the sequence s has largest value 26, so a(42) = 26.
%o A332966 (PARI) a(n) = { my (s=0, v=s, w=0); while (!bittest(w,s), w+=2^s; v=max(v,s); s=(s^2+1)%n); v }
%Y A332966 Cf. A003095, A248218, A330405, A332965.
%K A332966 nonn
%O A332966 1,3
%A A332966 _Rémy Sigrist_, Mar 04 2020