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-3 of 3 results.

A269266 a(n) = 2^n mod 31.

Original entry on oeis.org

1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1
Offset: 0

Views

Author

Vincenzo Librandi, Mar 31 2016

Keywords

References

  • Continued fraction expansion of (1651+sqrt(3236405))/2386. - Bruno Berselli, Mar 31 2016

Crossrefs

Cf. A201912 (11th row of the triangle).
Cf. similar sequences of the type 2^n mod p, where p is a prime: A000034 (p=3), A070402 (p=5), A069705 (p=7), A036117 (p=11), A036118 (p=13), A062116 (p=17), A036120 (p=19), A070335 (p=23), A036122 (p=29), this sequence (p=31), A036124 (p=37), A070348 (p=41), A070349 (p=43), A070351 (p=47), A036128 (p=53), A036129 (p=59), A036130 (p=61), A036131 (p=67).

Programs

  • GAP
    List([0..70],n->PowerMod(2,n,31)); # Muniru A Asiru, Jan 30 2019
  • Magma
    [Modexp(2, n, 31): n in [0..100]];
    
  • Magma
    &cat [[1,2,4,8,16]^^20] // Bruno Berselli, Mar 31 2016
    
  • Mathematica
    PowerMod[2, Range[0, 100], 31]
  • PARI
    a(n)=2^(n%5) \\ Charles R Greathouse IV, Mar 31 2016
    
  • PARI
    x='x+O('x^99); Vec((1+2*x+4*x^2+8*x^3+16*x^4)/(1-x^5)) \\ Altug Alkan, Mar 31 2016
    
  • Python
    for n in range(0,100):print(2**n%31) # Soumil Mandal, Apr 03 2016
    
  • Python
    def A269266(n): return pow(2,n,31) # Chai Wah Wu, Jan 03 2022
    
  • Sage
    [2^mod(n,5) for n in (0..100)] # Bruno Berselli, Mar 31 2016
    

Formula

G.f.: (1 + 2*x + 4*x^2 + 8*x^3 + 16*x^4)/(1 - x^5).
a(n) = a(n-5).
a(n) = 2^(n mod 5). - Bruno Berselli, Mar 31 2016

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)

A353214 a(n) = 2^A007013(4) mod prime(n); the last term of this sequences is when a(n) = 1.

Original entry on oeis.org

0, -1, -2, 2, -4, -2, -8, 2, -5, -2, 4, -2, 5, 2, -11, -20, -22, 6, -23, -21, 2, -3, -16, -25, -31, 40, 19, -29, -2, -2, 2, -49, 19, 68, -56, -23, -59, 45, 29, -2, 62, 63, 27, 54, -2, -22, -46, 28, -85, -2, -29, 17, -113, -4, -128, -65, -46, 20, -51, -98, -64
Offset: 1

Views

Author

Davis Smith, Apr 30 2022

Keywords

Comments

This sequence uses the centered version of mod. The residue system modulo prime(n) is {-1*floor(prime(n)/2)..floor(prime(n)/2)}. This is so that this sequence will encode information about the numbers around 2^A007013(4). If a(n) = k and prime(n) < 2^A007013(4) - k, then 2^A007013(4) - k is not prime (prime(n) is a factor of 2^A007013(4) - k). For example, a(22) = -3, so prime(22) = 79 is a factor of 2^A007013(4) + 3.
The length of this sequence is the lowest value of n such that A014664(n) = A007013(4). This is because for any power of 2, 2^p, if p == 0 (mod A014664(n)), then 2^p == 1 (mod prime(n)) (prime(n) is a factor of A000225(p)). Since A007013(4) is prime, we can apply this to get: If A014664(n) = A007013(4) and prime(n) < A007013(5), then A007013(5) is not prime (prime(n) is a nontrivial factor).
For any n such that prime(n) < 5*(10^51 + 5*10^9), a(n) != 1.

Crossrefs

Cf. A000225, A007013, A014664. Powers of 2 mod primes: A201908, A201912, A353171.

Programs

  • PARI
    A353214(n)=my(CM4=shift(1,127)-1);centerlift(Mod(2,prime(n))^CM4)

Formula

a(n) = 2^(2^127 - 1) mod prime(n).
Showing 1-3 of 3 results.