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.

A328702 Start with 0, a(n) is the smallest number of iterations: x -> (x^2+x+1) mod n needed to run into a cycle.

Original entry on oeis.org

0, 1, 0, 1, 2, 1, 1, 1, 2, 2, 3, 1, 0, 1, 2, 1, 3, 2, 4, 2, 1, 3, 1, 1, 2, 1, 4, 1, 1, 2, 2, 1, 3, 3, 2, 2, 2, 4, 0, 2, 4, 1, 5, 3, 2, 1, 3, 1, 3, 2, 3, 1, 9, 4, 3, 1, 4, 1, 6, 2, 0, 2, 2, 1, 2, 3, 7, 3, 1, 2, 2, 2, 3, 2, 2, 4, 3, 1, 4, 2, 4, 4, 14, 1, 3, 5, 1, 3, 8, 2, 1
Offset: 1

Views

Author

Jianing Song, Oct 26 2019

Keywords

Comments

Let f(0) = 0, f(k+1) = (f(k)^2+f(k)+1) mod n, then a(n) is the smallest i such that f(i) = f(j) for some j > i.
Obviously a(n) <= A290731(n): f(1), f(2), ..., f(A290731(n)+1) are all of the form (s^2+s+1) mod n, so there must exists 0 <= i < j <= A290731(n)+1 such that f(i) = f(j), and a(n) <= i <= A290731(n). The equality seems to hold only for n = 2.
k divides A002065(m) for some m > 0 if and only if a(k) = 0, in which case all the indices m such that k divides A002065(m) are m = t*A328701(k), t = 0, 1, 2, 3, ...

Examples

			A002065(n) mod 4: 0, (1, 3). {A002065(n) mod 4} enters into the cycle (1, 3) from the 1st term on, so a(4) = 1.
A002065(n) mod 7: 0, (1, 3, 6). {A002065(n) mod 7} enters into the cycle (1, 3, 6) from the 1st term on, so a(7) = 1.
A002065(n) mod 11: 0, 1, 3, (2, 7). {A002065(n) mod 11} enters into the cycle (2, 7) from the 3rd term on, so a(11) = 3.
A002065(n) mod 19: 0, 1, 3, 13, (12, 5). {A002065(n) mod 19} enters into the cycle (12, 5) from the 4th term on, so a(19) = 4.
A002065(n) mod 61: (0, 1, 3, 13). {A002065(n) mod 61} enters into the cycle (0, 1, 3, 13) from the very beginning, so a(61) = 0.
		

Crossrefs

Cf. A002065, A328701 (cycle length), A328703, A290731.

Programs

  • PARI
    a(n) = my(v=[0],k); for(i=2, n+1, k=(v[#v]^2+v[#v]+1)%n; v=concat(v, k); for(j=1, i-1, if(v[j]==k, return(j-1))))

A328704 Primes dividing nonzero terms in A002065.

Original entry on oeis.org

3, 13, 61, 151, 211, 223, 739, 1009, 1531, 4363, 4513, 5503, 6277, 6397, 7753, 7873, 9463, 11353, 11587, 11677, 12007, 12241, 13669, 15061, 15391, 17509, 17791, 21157, 25243, 25747, 26959, 28351, 28411, 29641, 30553, 30727, 31873, 33289, 33469, 33997, 36343, 36721, 37117, 37201
Offset: 1

Views

Author

Jianing Song, Oct 26 2019

Keywords

Comments

Primes in A328703.
Sequence is infinite: it contains all prime factors of the numbers A002065(p), where p is any prime. Note that gcd(A002065(p), A002065(q)) = 1 for primes p != q. So the set of prime factors of {A002065(p) : p prime} is infinite.

Crossrefs

Programs

  • PARI
    v(n) = my(v=[0],k,flag=1); for(i=2, n+1, k=(v[#v]^2+v[#v]+1)%n; v=concat(v, k); for(j=1, i-1, if(v[j]==k, flag=0)); if(flag==0, break())); v
    a(n) = isprime(n) && !(v(n)[#v(n)])
Showing 1-2 of 2 results.