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.

A353171 Irregular triangle read by rows; T(n,k) = 2^k (mod prime(n)), terminating when T(n,k) = 1.

Original entry on oeis.org

-1, 1, 2, -1, -2, 1, 2, -3, 1, 2, 4, -3, 5, -1, -2, -4, 3, -5, 1, 2, 4, -5, 3, 6, -1, -2, -4, 5, -3, -6, 1, 2, 4, 8, -1, -2, -4, -8, 1, 2, 4, 8, -3, -6, 7, -5, 9, -1, -2, -4, -8, 3, 6, -7, 5, -9, 1, 2, 4, 8, -7, 9, -5, -10, 3, 6, -11, 1, 2, 4, 8, -13, 3, 6, 12, -5, -10, 9, -11, 7, 14, -1, -2, -4, -8, 13, -3, -6, -12, 5, 10, -9, 11, -7, -14, 1, 2, 4, 8, -15, 1
Offset: 2

Views

Author

Davis Smith, Apr 28 2022

Keywords

Comments

Although the most significant digits of powers of 2 in base n are generally not periodic (the exception being when n is a power of 2), the least significant digits are. For example, 2 to an even power is congruent to 1 (mod 3) and 2 to an odd power is congruent to -1 (mod 3). This means that one can determine one of the prime factors of a Mersenne number, A000225, using the exponent. If n == 0 (mod 2), then A000225(n) == 0 (mod 3) (is a multiple of 3); if n == 0 (mod 4), then A000225(n) == 0 (mod 5); if n == 0 (mod 3), then A000225(n) == 0 (mod 7), and so on.
This general fact gives a reason for why certain Mersenne numbers are not prime (even with prime exponents). If p is congruent to 0 mod A014664(n) (the length of an n-th row) and prime(n) is less than the A000225(p), then prime(n) is a nontrivial factor of A000225(p).

Examples

			Irregular triangle begins
n/k||  1,  2,  3,  4,  5,  6,  7,  8,  9, 10,  11, 12 ... || Length ||
----------------------------------------------------------------------
2  || -1   1                                              ||      2 ||
3  ||  2, -1, -2,  1                                      ||      4 ||
4  ||  2, -3,  1                                          ||      3 ||
5  ||  2,  4, -3,  5, -1, -2, -4,  3, -5,   1             ||     10 ||
6  ||  2,  4, -5,  3,  6, -1, -2, -4,  5,  -3, -6,  1     ||     12 ||
7  ||  2,  4,  8, -1, -2, -4, -8,  1                      ||      8 ||
		

Crossrefs

Cf. similar sequences: A201908, A201912.

Programs

  • PARI
    A353171_row(n)->my(N=centerlift(Mod(2,prime(n))^1),L=List(N),k=1);while(N!=1,k++;listput(L,N=centerlift(Mod(2,prime(n))^k)));Vec(L)