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-10 of 11 results. Next

A201911 Irregular triangle of 7^k mod prime(n).

Original entry on oeis.org

1, 1, 1, 2, 4, 3, 0, 1, 7, 5, 2, 3, 10, 4, 6, 9, 8, 1, 7, 10, 5, 9, 11, 12, 6, 3, 8, 4, 2, 1, 7, 15, 3, 4, 11, 9, 12, 16, 10, 2, 14, 13, 6, 8, 5, 1, 7, 11, 1, 7, 3, 21, 9, 17, 4, 5, 12, 15, 13, 22, 16, 20, 2, 14, 6, 19, 18, 11, 8, 10, 1, 7, 20, 24, 23, 16, 25
Offset: 1

Views

Author

T. D. Noe, Dec 07 2011

Keywords

Comments

Except for the fourth row, the first term of each row is 1. Many sequences are in this one: starting at A036132 (mod 71) and A070404 (mod 11).

Examples

			The first 9 rows are:
  1
  1
  1, 2,  4,  3
  0
  1, 7,  5,  2, 3, 10,  4,  6,  9,  8
  1, 7, 10,  5, 9, 11, 12,  6,  3,  8,  4,  2
  1, 7, 15,  3, 4, 11,  9, 12, 16, 10,  2, 14, 13,  6, 8,  5
  1, 7, 11
  1, 7,  3, 21, 9, 17,  4,  5, 12, 15, 13, 22, 16, 20, 2, 14, 6, 19, 18, 11, 8, 10
		

Crossrefs

Cf. A201908 (2^k), A201909 (3^k), A201910 (5^k).
Cf. A070404 (11), A070405 (13), A070407 (17), A070409 (23), A070413 (29), A070415 (31), A070420 (37), A070422 (39), A070424 (41), A070425 (43), A070429 (47), A036132 (71).

Programs

  • GAP
    P:=Filtered([1..350],IsPrime);;
    R:=List([1..Length(P)],n->OrderMod(7,P[n]));;
    Flat(Concatenation([1,1,1,2,4,3,0],List([5..10],n->List([0..R[n]-1],k->PowerMod(7,k,P[n]))))); # Muniru A Asiru, Feb 01 2019
  • Mathematica
    nn = 10; p = 7; t = p^Range[0,Prime[nn]]; Flatten[Table[If[Mod[n, p] == 0, {0}, tm = Mod[t, n]; len = Position[tm, 1, 1, 2][[-1,1]]; Take[tm, len-1]], {n, Prime[Range[nn]]}]]

A201909 Irregular triangle of 3^k mod prime(n).

Original entry on oeis.org

1, 0, 1, 3, 4, 2, 1, 3, 2, 6, 4, 5, 1, 3, 9, 5, 4, 1, 3, 9, 1, 3, 9, 10, 13, 5, 15, 11, 16, 14, 8, 7, 4, 12, 2, 6, 1, 3, 9, 8, 5, 15, 7, 2, 6, 18, 16, 10, 11, 14, 4, 12, 17, 13, 1, 3, 9, 4, 12, 13, 16, 2, 6, 18, 8, 1, 3, 9, 27, 23, 11, 4, 12, 7, 21, 5, 15
Offset: 1

Views

Author

T. D. Noe, Dec 07 2011

Keywords

Comments

The row lengths are in A062117. Except for the second row, the first term of each row is 1. Many sequences are in this one: starting at A036119 (mod 17) and A070341 (mod 11).

Examples

			The first 9 rows are:
  1
  0
  1, 3, 4,  2
  1, 3, 2,  6,  4,  5
  1, 3, 9,  5,  4
  1, 3, 9
  1, 3, 9, 10, 13,  5, 15, 11, 16, 14,  8,  7,  4, 12, 2,  6
  1, 3, 9,  8,  5, 15,  7,  2,  6, 18, 16, 10, 11, 14, 4, 12, 17, 13
  1, 3, 9,  4, 12, 13, 16,  2,  6, 18,  8
		

Crossrefs

Cf. A062117, A201908 (2^k), A201910 (5^k), A201911 (7^k).
Cf. A070352 (5), A033940 (7), A070341 (11), A168399 (13), A036119 (17), A070342 (19), A070356 (23), A070344 (29), A036123 (31), A070346 (37), A070361 (41), A036126 (43), A070364 (47), A036134 (79), A036136 (89), A036142 (113), A036143 (127), A036145 (137), A036158 (199), A036160 (223).

Programs

  • GAP
    P:=Filtered([1..350],IsPrime);;
    R:=List([1..Length(P)],n->OrderMod(7,P[n]));;
    Flat(Concatenation([1,1,1,2,4,3,0],List([5..10],n->List([0..R[n]-1],k->PowerMod(7,k,P[n]))))); # Muniru A Asiru, Feb 01 2019
  • Mathematica
    nn = 10; p = 3; t = p^Range[0,Prime[nn]]; Flatten[Table[If[Mod[n, p] == 0, {0}, tm = Mod[t, n]; len = Position[tm, 1, 1, 2][[-1,1]]; Take[tm, len-1]], {n, Prime[Range[nn]]}]]

A201910 Irregular triangle of 5^k mod prime(n).

Original entry on oeis.org

1, 1, 2, 0, 1, 5, 4, 6, 2, 3, 1, 5, 3, 4, 9, 1, 5, 12, 8, 1, 5, 8, 6, 13, 14, 2, 10, 16, 12, 9, 11, 4, 3, 15, 7, 1, 5, 6, 11, 17, 9, 7, 16, 4, 1, 5, 2, 10, 4, 20, 8, 17, 16, 11, 9, 22, 18, 21, 13, 19, 3, 15, 6, 7, 12, 14, 1, 5, 25, 9, 16, 22, 23, 28, 24, 4
Offset: 1

Views

Author

T. D. Noe, Dec 07 2011

Keywords

Comments

Except for the third row, the first term of each row is 1. Many sequences are in this one: starting at A036121 (mod 23) and A070365 (mod 7).

Examples

			The first 9 rows are:
1
1, 2
0
1, 5, 4, 6, 2, 3
1, 5, 3, 4, 9
1, 5, 12, 8
1, 5, 8, 6, 13, 14, 2, 10, 16, 12, 9, 11, 4, 3, 15, 7
1, 5, 6, 11, 17, 9, 7, 16, 4
1, 5, 2, 10, 4, 20, 8, 17, 16, 11, 9, 22, 18, 21, 13, 19, 3, 15, 6, 7, 12, 14
		

Crossrefs

Cf. A201908 (2^k), A201909 (3^k), A201911 (7^k).
Cf. A070365 (7), A070367 (11), A070368 (13), A070371 (17), A070373 (19), A036121 (23), A070379 (29), A070384 (37), A070387 (41), A070389 (43), A036127 (47), A036133 (73), A036137 (97), A036139 (103), A036149 (157), A036151 (167), A036156 (193).

Programs

  • GAP
    P:=Filtered([1..350],IsPrime);;
    R:=List([1..Length(P)],n->OrderMod(5,P[n]));;
    Flat(Concatenation([1,1,2,0],List([3..10],n->List([0..R[n]-1],k->PowerMod(5,k,P[n]))))); # Muniru A Asiru, Feb 02 2019
  • Mathematica
    nn = 10; p = 5; t = p^Range[0,Prime[nn]]; Flatten[Table[If[Mod[n, p] == 0, {0}, tm = Mod[t, n]; len = Position[tm, 1, 1, 2][[-1,1]]; Take[tm, len-1]], {n, Prime[Range[nn]]}]]

A014659 Odd numbers that do not divide 2^k + 1 for any k >= 1.

Original entry on oeis.org

7, 15, 21, 23, 31, 35, 39, 45, 47, 49, 51, 55, 63, 69, 71, 73, 75, 77, 79, 85, 87, 89, 91, 93, 95, 103, 105, 111, 115, 117, 119, 123, 127, 133, 135, 141, 143, 147, 151, 153, 155, 159, 161, 165, 167, 175, 183, 187, 189, 191, 195, 199, 203, 207, 213, 215, 217, 219
Offset: 1

Views

Author

Keywords

Comments

This is the subset of odd integers > 1 as (2*n - 1) in A179480 such that A179480(n) is even. Example: A179480(18) = 6, even; corresponding to (2*18 - 1), 35. Then 35 is in A014659. A014657 is the subset of odd terms > 1 corresponding to odd terms in A179480. - Gary W. Adamson, Aug 20 2012
From Wolfdieter Lang, Aug 22 2020: (Start)
These odd numbers are the moduli named 2*n+1 in the definition of A003558(n), for n >= 1, for which the + sign applies. The signs in the definition of A003558 are given in A332433.
These are the odd numbers N >= 3 for which A003558((N-1)/2) = A002326((N+1)/2), the period length P(N) of the cycles {2^k (mod N)}_{k=0}^(P(N)-1). Compare the periods given in A201908((N+1)/2, k). (End)

Crossrefs

Cf. A014657, numbers that divide 2^k + 1 for some k.

Extensions

More terms from Don Reble, Nov 03 2001

A201912 Irregular triangle of 2^k mod prime(n).

Original entry on oeis.org

0, 1, 2, 1, 2, 4, 3, 1, 2, 4, 1, 2, 4, 8, 5, 10, 9, 7, 3, 6, 1, 2, 4, 8, 3, 6, 12, 11, 9, 5, 10, 7, 1, 2, 4, 8, 16, 15, 13, 9, 1, 2, 4, 8, 16, 13, 7, 14, 9, 18, 17, 15, 11, 3, 6, 12, 5, 10, 1, 2, 4, 8, 16, 9, 18, 13, 3, 6, 12, 1, 2, 4, 8, 16, 3, 6, 12, 24
Offset: 1

Views

Author

T. D. Noe, Dec 17 2011

Keywords

Comments

The row lengths are in A014664. For n > 1, the first term of each row is 1 and the last term is 2*prime(n)-1, which is A006254. Many sequences are in this one.

Examples

			The first 11 rows are:
2:  0;
3:  1, 2;
5:  1, 2, 4, 3;
7:  1, 2, 4;
11: 1, 2, 4, 8,  5, 10,  9,  7,  3,  6;
13: 1, 2, 4, 8,  3,  6, 12, 11,  9,  5, 10,  7;
17: 1, 2, 4, 8, 16, 15, 13,  9;
19: 1, 2, 4, 8, 16, 13,  7, 14,  9, 18, 17, 15, 11,  3,  6, 12,  5, 10;
23: 1, 2, 4, 8, 16,  9, 18, 13,  3,  6, 12;
29: 1, 2, 4, 8, 16,  3,  6, 12, 24, 19,  9, 18,  7, 14, 28, 27, 25, 21, 13, 26, 23, 17, 5, 10, 20, 11, 22, 15;
31: 1, 2, 4, 8, 16;
		

Crossrefs

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), A269266 (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), A036135 (p=83), A036138 (p=101), A036140 (p=107), A036144 (p=131), A036146 (p=139), A036147 (p=149), A036150 (p=163), A036152 (p=173), A036153 (p=179), A036154 (p=181), A036157 (p=197), A036159 (p=211), A036161 (p=227).

Programs

  • GAP
    P:=Filtered([1..350],IsPrime);;
    R:=List([1..Length(P)],n->OrderMod(2,P[n]));;
    Flat(Concatenation([0],List([2..10],n->List([0..R[n]-1],k->PowerMod(2,k,P[n]))))); # Muniru A Asiru, Feb 01 2019
  • Mathematica
    nn = 10; p = 2; t = p^Range[0,Prime[nn]]; Flatten[Table[If[Mod[n, p] == 0, {0}, tm = Mod[t, n]; len = Position[tm, 1, 1, 2][[-1,1]]; Take[tm, len-1]], {n, Prime[Range[nn]]}]]

A337712 Irregular triangle read by rows: row n gives the complete system of cycles of the doubling sequences modulo N = 2*n+1, for n >= 0.

Original entry on oeis.org

1, 2, 1, 2, 4, 3, 1, 2, 4, 3, 6, 5, 1, 2, 4, 8, 7, 5, 1, 2, 4, 8, 5, 10, 9, 7, 3, 6, 1, 2, 4, 8, 3, 6, 12, 11, 9, 5, 10, 7, 1, 2, 4, 8, 7, 14, 13, 11, 1, 2, 4, 8, 16, 15, 13, 9, 3, 6, 12, 7, 14, 11, 5, 10, 1, 2, 4, 8, 16, 13, 7, 14, 9, 18, 17, 15, 11, 3, 6, 12, 5, 10
Offset: 0

Views

Author

Gary W. Adamson and Wolfdieter Lang, Oct 14 2020

Keywords

Comments

The length of row n is A037225(n), for n >= 0.
The doubling sequence modulo N = 2*n+1, for n >= 0, has entries DS(N, s(N,i), j) = s(N,i)*2^j (mod N), with j >= 0, and certain positive odd integer seeds s(N, i), for i = 1, 2, ..., S(N) = A037226((N-1)/2), where gcd(s(N, i), N) = 1 (restricted seeds modulo N). These doubling sequences are periodic with period length P(N) = A002326((N-1)/2) (order of 2 modulo N). Only the periods (cycles) {DS(N, s(N, i), j)}_{j=0..P(N)-1}, for i = 1, 2, ..., S(N), are listed.
N = 1 (n=0) is special: one takes here the restricted residue system modulo N not as [0] but as [1]. The order of 2 modulo 1 is 1, because 2^1 == 1 (mod 1) (== 0 (mod 1)).
In order to obtain the complete system of doubling sequences one starts with seed s(N, 1) = 1, and if all numbers from the smallest positive reduced residue system modulo N (called RRS(N), given in row N of A038566) are obtained, i.e., if P(N) = #RRS(N) = phi(N) = A000010(N), then the system is complete. Otherwise the smallest missing number from RRS(N) is taken as new seed s(N, 2), etc. until the system is complete. This means that the number of seeds needed is S(N) = phi(N)/P(N) = A037226((N-1)/2)).
The irregular subtriangle where only seed s(N, 1) = 1 has been used is given in A201908. But there 0 (not 1) for N = 1 has been used.
From Gary W. Adamson and Wolfdieter Lang, Dec 15 2020: (Start)
The cycles in row n, for N = 2*n + 1, of period length P(N) = A002326((N-1)/2) give the periods of the iterated doubling function D(x) = frac(2*x) with seeds x = s(N, i)/N, for i = 1, 2, ..., S(N) = A037226((N-1)/2), after multiplication with N. This is the doubling function used in the Devaney reference, pp. 24-25, 27, 125. 132, 171,289.
Each cycle in row n can also be used to find from the base 2 version of its first entry (the seed s = s(N, i)) divided by N the other entries by repeated application of a cyclic left shift by one step (called sigma operation) to the period of the base 2 expression of s/N. E.g., n = 7, N = 15, P(N) = 4, s = 1: (1/15){10->2} = .repeat(0001), then (.repeat(0010)){2->10} = 2/10, (.repeat(0100)){2->10} = 4/10 and (.repeat(1000)){2->10} = 8/15. Similarly for s = 7: from (7/15)_{10->2} = .repeat(0111) one obtains by repeated sigma operations 14/15, 13/15 and 11/15. The proof uses the elementary formulas for the conversion from base 10 to base 2, and the reverse one, from base 2 to base 10. See also a comment on the period length P(N) given in A002326. (End)

Examples

			The irregular triangle T(n, k) begins (cycles are separated by a vertical bar)
n,  N \ k 1 2 3 4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 ...
0,  1:    1
1,  3:    1 2
2,  5:    1 2 4 3
3,  7:    1 2 4|3  6  5
4,  9:    1 2 4 8  7  5
5,  11:   1 2 4 8  5 10  9  7  3  6
6,  13:   1 2 4 8  3  6 12 11  9  5 10  7
7,  15:   1 2 4 8| 7 14 13 11
8,  17:   1 2 4 8 16 15 13  9| 7 14 11  5 10  3  6 12
9,  19:   1 2 4 8 16 13  7 14  9 18 17 15 11  3  6 12 5 10
10, 21:   1 2 4 8 16 11| 5 10 20 19 17 13
11, 23:   1 2 4 8 16  9 18 13  3  6 12| 5 10 20 17 11 22 21 19 15  7 14
12, 25:   1 2 4 8 16  7 14  3  6 12 24 23 21 17  9 18 11 22 19 13
13, 27:   1 2 4 8 16  5 10 20 13 26 25 23 19 11 22 17  7 14
...
n = 14, N = 29:  1 2 4 8 16  3  6 12 24 19  9 18  7 14 28 27 25 21 13 26 23 17  5 10 20 11 22 15,
n = 15, N = 31: 1 2 4 8 16|3 6 12 24 17|5 10 20 9 18|7 14 28 25 19|11 22 13 26 21|15 30 29 27 23.
		

References

  • Robert L. Devaney, A First Course in Chaotic Dynamical Systems, Addison-Wesley., 1992. pp. 24-25, 27, 125, 132, 171, 289. Second edition 2020.

Crossrefs

Cf. A000010, A002326, A037225, A037226, A201908, A038566, A334430 (modified doubling), A337936 (tripling), A339046 (quadrupling).

Programs

  • Mathematica
    Array[Block[{a = {}, k = 2, n = 2 # + 1, m}, m = EulerPhi[n]; While[Length@ Flatten@ a < m, AppendTo[a, Most@ NestWhileList[Mod[2 #, n] &, If[Length@ a == 0, 1, k], UnsameQ, All]]; Set[k, SelectFirst[Complement[Range[n], Union@ Flatten@ a], GCD[#, n] == 1 &] ]]; a] &, 9] // Flatten (* Michael De Vlieger, Nov 06 2020 *)

Formula

T(n, k) gives the k-th entry in the complete doubling system modulo N = 2*n+1, for n >= 0, with the S(N) = A037226((N-1)/2) cycles of length A002326((N-1)/2) written in row n. See the comment above for DS(N,s(N,i)), i = 1, 2, ..., S(N).

A323873 Irregular triangle of 11^k mod prime(n).

Original entry on oeis.org

1, 1, 2, 1, 1, 4, 2, 0, 1, 11, 4, 5, 3, 7, 12, 2, 9, 8, 10, 6, 1, 11, 2, 5, 4, 10, 8, 3, 16, 6, 15, 12, 13, 7, 9, 14, 1, 11, 7, 1, 11, 6, 20, 13, 5, 9, 7, 8, 19, 2, 22, 12, 17, 3, 10, 18, 14, 16, 15, 4, 21, 1, 11, 5, 26, 25, 14, 9, 12, 16, 2, 22, 10, 23, 21, 28
Offset: 1

Views

Author

Muniru A Asiru, Feb 04 2019

Keywords

Comments

Length of the n-th row (n != 5) is the order of 11 modulo the n-th prime.
Except for the fifth row, the first term of each row is 1.

Examples

			The first 9 rows are:
  1;
  1,  2;
  1;
  1,  4, 2;
  0;
  1, 11, 4,  5,  3,  7, 12, 2,  9,  8, 10,  6;
  1, 11, 2,  5,  4, 10,  8, 3, 16,  6, 15, 12, 13,  7, 9, 14;
  1, 11, 7;
  1, 11, 6, 20, 13,  5,  9, 7,  8, 19,  2, 22, 12, 17, 3, 10, 18, 14, 16, 15, 4, 21;
  ...
		

Crossrefs

Cf. A201908 (2^k), A201909 (3^k), A201910 (5^k), A201911 (7^k), this sequence (11^k), A323874 (13^k).
Cf. A000040.

Programs

  • GAP
    A000040:=Filtered([1..350],IsPrime);; p:=5;;
    R:=List([1..Length(A000040)],n->OrderMod(A000040[p],A000040[n]));;
    a1:=List([1..p-1],n->List([0..R[n]-1],k->PowerMod(A000040[p],k,A000040[n])));;
    a:=Flat(Concatenation(a1,[0],List([p+1..2*p],n->List([0..R[n]-1],k->PowerMod(A000040[p],k,A000040[n])))));; Print(a);
  • Maple
    T:= n-> (p-> `if`(p=11, 0, seq(11&^k mod p,
             k=0..numtheory[order](11, p)-1)))(ithprime(n)):
    seq(T(n), n=1..15);  # Alois P. Heinz, Feb 06 2019
  • Mathematica
    Table[If[p == 11, {0}, Array[PowerMod[11, #, p] &, MultiplicativeOrder[11, p], 0]], {p, Prime@ Range@ 10}] (* Michael De Vlieger, Feb 25 2019 *)

A202149 Triangle read by rows: T(n, k) = mod(2^k, n), where 1 <= k < n.

Original entry on oeis.org

0, 2, 1, 2, 0, 0, 2, 4, 3, 1, 2, 4, 2, 4, 2, 2, 4, 1, 2, 4, 1, 2, 4, 0, 0, 0, 0, 0, 2, 4, 8, 7, 5, 1, 2, 4, 2, 4, 8, 6, 2, 4, 8, 6, 2, 2, 4, 8, 5, 10, 9, 7, 3, 6, 1, 2, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 2, 4, 8, 3, 6, 12, 11, 9, 5, 10, 7, 1, 2, 4, 8, 2, 4, 8, 2, 4
Offset: 2

Views

Author

Alonso del Arte, Dec 12 2011

Keywords

Comments

Rows indexed by odd primes end in 1 (and of course so do rows indexed by base 2 pseudoprimes, A001567). Of those rows, the ones that are permutations of the integers 1 to p - 1 correspond to primes with primitive root 2 (A001122).

Examples

			Triangle starts:
0
2 1
2 0 0
2 4 3 1
2 4 2 4  2
2 4 1 2  4 1
2 4 0 0  0 0 0
2 4 8 7  5 1 2 4
2 4 8 6  2 4 8 6 2
2 4 8 5 10 9 7 3 6 1
2 4 8 4  8 4 8 4 8 4 8
		

Crossrefs

Cf. A036117, 2^n mod 11; A036118, 2^n mod 13; A201908, irregular triangle of 2^k mod (2n - 1).

Programs

  • Mathematica
    ColumnForm[Table[PowerMod[2, k, n], {n, 2, 20}, {k, n - 1}], Center]

A323874 Irregular triangle of 13^k mod prime(n).

Original entry on oeis.org

1, 1, 1, 3, 4, 2, 1, 6, 1, 2, 4, 8, 5, 10, 9, 7, 3, 6, 0, 1, 13, 16, 4, 1, 13, 17, 12, 4, 14, 11, 10, 16, 18, 6, 2, 7, 15, 5, 8, 9, 3, 1, 13, 8, 12, 18, 4, 6, 9, 2, 3, 16, 1, 13, 24, 22, 25, 6, 20, 28, 16, 5, 7, 4, 23, 9, 1, 13, 14, 27, 10, 6, 16, 22, 7, 29, 5
Offset: 1

Views

Author

Muniru A Asiru, Feb 04 2019

Keywords

Comments

Length of the n-th row (n != 6) is the order of 13 modulo the n-th prime.
Except for the sixth row, the first term of each row is 1.

Examples

			The first 10 rows are:
  1
  1
  1, 3, 4, 2
  1, 6
  1, 2, 4, 8, 5, 10, 9, 7, 3, 6
  0
  1, 13, 16, 4
  1, 13, 17, 12, 4, 14, 11, 10, 16, 18, 6, 2, 7, 15, 5, 8, 9, 3
  1, 13, 8, 12, 18, 4, 6, 9, 2, 3, 16
  1, 13, 24, 22, 25, 6, 20, 28, 16, 5, 7, 4, 23, 9
		

Crossrefs

Cf. A000040.
Cf. A201908 (2^k), A201909 (3^k), A201910 (5^k), A201911 (7^k), A323873 (11^k), this sequence (13^k).

Programs

  • GAP
    A000040:=Filtered([1..350],IsPrime);; p:=6;;
    R:=List([1..Length(A000040)],n->OrderMod(A000040[p],A000040[n]));;
    a1:=List([1..p-1],n->List([0..R[n]-1],k->PowerMod(A000040[p],k,A000040[n])));;
    a:=Flat(Concatenation(a1,[0],List([p+1..2*p],n->List([0..R[n]-1],k->PowerMod(A000040[p],k,A000040[n])))));; Print(a);
  • Maple
    T:= n-> (p-> `if`(p=13, 0, seq(13&^k mod p,
             k=0..numtheory[order](13, p)-1)))(ithprime(n)):
    seq(T(n), n=1..15);  # Alois P. Heinz, Feb 06 2019
  • Mathematica
    With[{q = 13}, Table[If[p == q, {0}, Array[PowerMod[q, #, p] &, MultiplicativeOrder[q, p], 0]], {p, Prime@ Range@ 11}]] // Flatten (* Michael De Vlieger, Feb 25 2019 *)

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)
Showing 1-10 of 11 results. Next