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

A006093 a(n) = prime(n) - 1.

Original entry on oeis.org

1, 2, 4, 6, 10, 12, 16, 18, 22, 28, 30, 36, 40, 42, 46, 52, 58, 60, 66, 70, 72, 78, 82, 88, 96, 100, 102, 106, 108, 112, 126, 130, 136, 138, 148, 150, 156, 162, 166, 172, 178, 180, 190, 192, 196, 198, 210, 222, 226, 228, 232, 238, 240, 250, 256, 262, 268, 270
Offset: 1

Views

Author

Keywords

Comments

These are also the numbers that cannot be written as i*j + i + j (i,j >= 1). - Rainer Rosenthal, Jun 24 2001; Henry Bottomley, Jul 06 2002
The values of k for which Sum_{j=0..n} (-1)^j*binomial(k, j)*binomial(k-1-j, n-j)/(j+1) produces an integer for all n such that n < k. Setting k=10 yields [0, 1, 4, 11, 19, 23, 19, 11, 4, 1, 0] for n = [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], so 10 is in the sequence. Setting k=3 yields [0, 1, 1/2, 1/2] for n = [-1, 0, 1, 2], so 3 is not in the sequence. - Dug Eichelberger (dug(AT)mit.edu), May 14 2001
n such that x^n + x^(n-1) + x^(n-2) + ... + x + 1 is irreducible. - Robert G. Wilson v, Jun 22 2002
Records for Euler totient function phi.
Together with 0, n such that (n+1) divides (n!+1). - Benoit Cloitre, Aug 20 2002; corrected by Charles R Greathouse IV, Apr 20 2010
n such that phi(n^2) = phi(n^2 + n). - Jon Perry, Feb 19 2004
Numbers having only the trivial perfect partition consisting of a(n) 1's. - Lekraj Beedassy, Jul 23 2006
Numbers n such that the sequence {binomial coefficient C(k,n), k >= n } contains exactly one prime. - Artur Jasinski, Dec 02 2007
Record values of A143201: a(n) = A143201(A001747(n+1)) for n > 1. - Reinhard Zumkeller, Aug 12 2008
From Reinhard Zumkeller, Jul 10 2009: (Start)
The first N terms can be generated by the following sieving process:
start with {1, 2, 3, 4, ..., N - 1, N};
for i := 1 until SQRT(N) do
(if (i is not striked out) then
(for j := 2 * i + 1 step i + 1 until N do
(strike j from the list)));
remaining numbers = {a(n): a(n) <= N}. (End)
a(n) = partial sums of A075526(n-1) = Sum_{1..n} A075526(n-1) = Sum_{1..n} (A008578(n+1) - A008578(n)) = Sum_{1..n} (A158611(n+2) - A158611(n+1)) for n >= 1. - Jaroslav Krizek, Aug 04 2009
A171400(a(n)) = 1 for n <> 2: subsequence of A171401, except for a(2) = 2. - Reinhard Zumkeller, Dec 08 2009
Numerator of (1 - 1/prime(n)). - Juri-Stepan Gerasimov, Jun 05 2010
Numbers n such that A002322(n+1) = n. This statement is stronger than repeating the property of the entries in A002322, because it also says in reciprocity that this sequence here contains no numbers beyond the Carmichael numbers with that property. - Michel Lagneau, Dec 12 2010
a(n) = A192134(A095874(A000040(n))); subsequence of A192133. - Reinhard Zumkeller, Jun 26 2011
prime(a(n)) + prime(k) < prime(a(k) + k) for at least one k <= a(n): A212210(a(n),k) < 0. - Reinhard Zumkeller, May 05 2012
Except for the first term, numbers n such that the sum of first n natural numbers does not divide the product of first n natural numbers; that is, n*(n + 1)/2 does not divide n!. - Jayanta Basu, Apr 24 2013
BigOmega(a(n)) equals BigOmega(a(n)*(a(n) + 1)/2), where BigOmega = A001222. Rationale: BigOmega of the product on the right hand side factorizes as BigOmega(a/2) + Bigomega(a+1) = BigOmega(a/2) + 1 because a/2 and a + 1 are coprime, because BigOmega is additive, and because a + 1 is prime. Furthermore Bigomega(a/2) = Bigomega(a) - 1 because essentially all 'a' are even. - Irina Gerasimova, Jun 06 2013
Record values of A060681. - Omar E. Pol, Oct 26 2013
Deficiency of n-th prime. - Omar E. Pol, Jan 30 2014
Conjecture: All the sums Sum_{k=s..t} 1/a(k) with 1 <= s <= t are pairwise distinct. In general, for any integers d >= -1 and m > 0, if Sum_{k=i..j} 1/(prime(k)+d)^m = Sum_{k=s..t} 1/(prime(k)+d)^m with 0 < i <= j and 0 < s <= t then we must have (i,j) = (s,t), unless d = m = 1 and {(i,j),(s,t)} = {(4,4),(8,10)} or {(4,7),(5,10)}. (Note that 1/(prime(8)+1)+1/(prime(9)+1)+1/(prime(10)+1) = 1/(prime(4)+1) and Sum_{k=5..10} 1/(prime(k)+1) = 1/(prime(4)+1) + Sum_{k=5..7} 1/(prime(k)+1).) - Zhi-Wei Sun, Sep 09 2015
Numbers n such that (prime(i)^n + n) is divisible by (n+1), for all i >= 1, except when prime(i) = n+1. - Richard R. Forberg, Aug 11 2016
a(n) is the period of Fubini numbers (A000670) over the n-th prime. - Federico Provvedi, Nov 28 2020

References

  • Archimedeans Problems Drive, Eureka, 40 (1979), 28.
  • Harvey Dubner, Generalized Fermat primes, J. Recreational Math., 18 (1985): 279-280.
  • M. Gardner, The Colossal Book of Mathematics, pp. 31, W. W. Norton & Co., NY, 2001.
  • M. Gardner, Mathematical Circus, pp. 251-2, Alfred A. Knopf, NY, 1979.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) = K(n, 1) and A034693(K(n, 1)) = 1 for all n. The subscript n refers to this sequence and K(n, 1) is the index in A034693. - Labos Elemer
Cf. A000040, A034694. Different from A075728.
Complement of A072668 (composite numbers minus 1), A072670(a(n))=0.
Essentially the same as A039915.
Cf. A101301 (partial sums), A005867 (partial products).
Column 1 of the following arrays/triangles: A087738, A249741, A352707, A378979, A379010.
The last diagonal of A162619, and of A174996, the first diagonal in A131424.
Row lengths of irregular triangles A086145, A124223, A212157.

Programs

Formula

a(n) = (p-1)! mod p where p is the n-th prime, by Wilson's theorem. - Jonathan Sondow, Jul 13 2010
a(n) = A000010(prime(n)) = A000010(A006005(n)). - Antti Karttunen, Dec 16 2012
a(n) = A005867(n+1)/A005867(n). - Eric Desbiaux, May 07 2013
a(n) = A000040(n) - 1. - Omar E. Pol, Oct 26 2013
a(n) = A033879(A000040(n)). - Omar E. Pol, Jan 30 2014

Extensions

Correction for change of offset in A158611 and A008578 in Aug 2009 Jaroslav Krizek, Jan 27 2010
Obfuscating comments removed by Joerg Arndt, Mar 11 2010
Edited by Charles R Greathouse IV, Apr 20 2010

A057593 Triangle T(n, k) giving period length of the periodic sequence k^i (i >= imin) mod n (n >= 2, 1 <= k <= n-1).

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 4, 4, 2, 1, 2, 1, 1, 2, 1, 3, 6, 3, 6, 2, 1, 1, 2, 1, 2, 1, 2, 1, 6, 1, 3, 6, 1, 3, 2, 1, 4, 4, 2, 1, 1, 4, 4, 2, 1, 10, 5, 5, 5, 10, 10, 10, 5, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 12, 3, 6, 4, 12, 12, 4, 3, 6, 12, 2, 1
Offset: 2

Views

Author

Gottfried Helms, Oct 05 2000

Keywords

Comments

From Wolfdieter Lang, Sep 04 2017: (Start)
i) If gcd(n, k) = 1 then imin = imin(n, k) = 0 and the length of the period P = T(n, k) = order(n, k), given in A216327 corresponding to the numbers of A038566. This is due to Euler's theorem. E.g., T(4, 3) = 2 because A216327(4, 2) = 2 corresponding to A038566(4, 2) = 3.
ii) If gcd(n, k) is not 1 then the smallest nonnegative index imin = imin(n, k) is obtained from A290601 with the corresponding length of the period given in A290602. Also in this case the sequence always becomes periodic, because one of the possible values from {0, 1, ..., n-1} has to appear a second time because the sequence has more than n entries. Example: T(4, 2) = 1 because imin is given by A290601(1, 1) = 2 (corresponding to the present n = 4, k = 2 values) with the length of the period P given by A290602(1, 1) = 1. (End)

Examples

			If n=7, k=2, (imin = 0) the sequence is 1,2,4,1,2,4,1,2,4,... of period 3, so T(7,2) = 3. The triangle T(n, k) begins:
n \ k 1   2   3  4   5   6   7   8  9  10  11  12  13  14 15 16 17 ...
2:    1
3:    1   2
4:    1   1   2
5:    1   4   4  2
6:    1   2   1  1   2
7:    1   3   6  3   6   2
8:    1   1   2  1   2   1   2
9:    1   6   1  3   6   1   3   2
10:   1   4   4  2   1   1   4   4  2
11:   1  10   5  5   5  10  10  10  5   2
12:   1   2   2  1   2   1   2   2  1   1   2
13:   1  12   3  6   4  12  12   4  3   6  12   2
14:   1   3   6  3   6   2   1   1  3   6   3   6   2
15:   1   4   4  2   2   1   4   4  2   1   2   4   4  2
16:   1   1   4  1   4   1   2   1  2   1   4   1   4  1  2
17:   1   8  16  4  16  16  16   8  8  16  16  16   4  16  8  2
18:   1   6   1  3   6   1   3   2  1   1   6   1   3   6  1  1  2
... Reformatted and extended. - _Wolfdieter Lang_, Sep 04 2017
From _Wolfdieter Lang_, Sep 04 2017: (Start)
The  table imin(n, k) begins:
n \ k 1   2   3   4   5   6   7   8  9  10  11  12  13  14  15  16 17 ...
2:    0
3:    0   0
4:    0   2   0
5:    0   0   0   0
6:    0   1   1   1   0
7:    0   0   0   0   0   0
8:    0   3   0   2   0   3   0
9:    0   0   2   0   0   2   0   0
10:   0   1   0   1   1   1   0   1  0
11:   0   0   0   0   0   0   0   0  0   0
12:   0   2   1   1   0   2   0   1  1   2   0
13:   0   0   0   0   0   0   0   0  0   0   0   0
14:   0   1   0   1   0   1   1   1  0   1   0   1   0
15:   0   0   1   0   1   1   0   0  1   1   0   1   0   0
16:   0   4   0   2   0   4   0   2  0   4   0   2   0   4   0
17:   0   0   0   0   0   0   0   0  0   0   0   0   0   0   0   0
18:   0   1   2   1   0   2   0   1  1   1   0   2   0   1   2   1  0
... (End)
		

Crossrefs

Cf. A086145 (prime rows), A216327 (entries with gcd(n,k) = 1), A139366.

Programs

  • Mathematica
    period[lst_] := Module[{n, i, j}, n=Length[lst]; For[j=2, j <= n, j++, For[i=1, iJean-François Alcover, Feb 04 2015 *)

Extensions

Constraint on k changed from 2 <= k <= n to 1 <= k < n, based on comment from Franklin T. Adams-Watters, Jan 19 2006, by David Applegate, Mar 11 2014
Name changed and table extended by Wolfdieter Lang, Sep 04 2017

A216327 Irregular triangle of multiplicative orders mod n for the elements of the smallest positive reduced residue system mod n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 4, 4, 2, 1, 2, 1, 3, 6, 3, 6, 2, 1, 2, 2, 2, 1, 6, 3, 6, 3, 2, 1, 4, 4, 2, 1, 10, 5, 5, 5, 10, 10, 10, 5, 2, 1, 2, 2, 2, 1, 12, 3, 6, 4, 12, 12, 4, 3, 6, 12, 2, 1, 6, 6, 3, 3, 2, 1, 4, 2, 4, 4, 2, 4, 2, 1, 4, 4, 2, 2, 4, 4, 2
Offset: 1

Views

Author

Wolfdieter Lang, Sep 28 2012

Keywords

Comments

The sequence of the row lengths is phi(n) = A000010 (Euler's totient).
For the notion 'reduced residue system mod n' which has, as a set, order phi(n) = A000010(n), see e.g., the Apostol reference p. 113. Here such a system with the smallest positive numbers is used. (In the Apostol reference 'order of a modulo n' is called 'exponent of a modulo n'. See the definition on p. 204.)
See A038566 where the reduced residue system mod n appears in row n.
In the chosen smallest reduced residue system mod n one can replace each element by any congruent mod n one, and the given order modulo n list will, of course, be the same. E.g., n=5, {6, -3, 13, -16} also has the orders modulo 5: 1 4 4 2, respectively.
Each order modulo n divides phi(n). See the Niven et al. reference, Corollary 2.32, p. 98.
The maximal order modulo n is given in A002322(n).
For the analog table of orders Modd n see A216320.

Examples

			This irregular triangle begins:
n\k 1  2  3  4  5  6  7  8  9  10 11 12  13 14  15 16 17 18
1:  1
2:  1
3:  1  2
4:  1  2
5:  1  4  4  2
6:  1  2
7:  1  3  6  3  6  2
8:  1  2  2  2
9:  1  6  3  6  3  2
10: 1  4  4  2
11: 1 10  5  5  5 10 10 10  5   2
12: 1  2  2  2
13: 1 12  3  6  4 12 12  4  3   6 12  2
14: 1  6  6  3  3  2
15: 1  4  2  4  4  2  4  2
16: 1  4  4  2  2  4  4  2
17: 1  8 16  4 16 16 16  8  8  16 16 16   4 16   8  2
18: 1  6  3  6  3  2
19: 1 18 18  9  9  9  3  6  9  18  3  6  18 18  18  9  9  2
20: 1  4  4  2  2  4  4  2
...
a(3,2) = 2 because A038566(3,2) = 2 and 2^1 == 2 (mod 3), 2^2 = 4 == 1 (mod 3).
a(7,3) = 6 because A038566(7,3) = 3 and 3^1 == 3 (mod 7), 3^2 = 9 == 2 (mod 7), 3^3 = 2*3 == 6 (mod 7),  3^4 == 6*3 == 4 (mod 7), 3^5 == 4*3 == 5 (mod 7) and  3^6 == 5*3 == 1 (mod 7). The notation == means 'congruent'.
The maximal order modulo 7 is 6 = A002322(7) = phi(7), and it appears twice: A111725(7) = 2.
The maximal order modulo 14 is 6 = A002322(14) = 1*6.
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976.
  • I. Niven, H. S. Zuckerman, and H. L. Montgomery, An Introduction to the Theory of Numbers, Fifth edition, Wiley, 1991.

Crossrefs

Cf. A038566, A002322 (maximal order), A111725 (multiplicity of max order), A216320 (Modd n analog).

Programs

  • Mathematica
    Table[Table[MultiplicativeOrder[k,n],{k,Select[Range[n],GCD[#,n]==1&]}],{n,1,13}]//Grid  (* Geoffrey Critzer, Jan 26 2013 *)
  • PARI
    rowa(n) = select(x->gcd(n, x)==1, [1..n]); \\ A038566
    row(n) = apply(znorder, apply(x->Mod(x, n), rowa(n))); \\ Michel Marcus, Sep 12 2023

Formula

a(n,k) = order A038566(n,k) modulo n, n >= 1, k=1, 2, ..., phi(n) = A000010(n). This is the order modulo n of the k-th element of the smallest reduced residue system mod n (when their elements are listed increasingly).

A128250 LCG periods: periods of the output sequences produced by multiplicative linear congruential generators (LCGs) with prime moduli, for all valid combinations of multiplier and modulus.

Original entry on oeis.org

1, 1, 2, 1, 4, 4, 2, 1, 3, 6, 3, 6, 2, 1, 10, 5, 5, 5, 10, 10, 10, 5, 2, 1, 12, 3, 6, 4, 12, 12, 4, 3, 6, 12, 2, 1, 8, 16, 4, 16, 16, 16, 8, 8, 16, 16, 16, 4, 16, 8, 2, 1, 18, 18, 9, 9, 9, 3, 6, 9, 18, 3, 6, 18, 18, 18, 9, 9, 2
Offset: 2

Views

Author

Ross Drewe, May 09 2007, May 11 2007, May 25 2007

Keywords

Comments

The periods of these output sequences need to be known when designing LCG-based pseudorandom number generators. The period of an LCG output is always 1 when a = 1, always 2 when a = m-1 and maximal (i.e. m-1) only if a is a totative of m. There is no fast method for finding totative values when m is large. The sample shows the terms generated by the first 8 moduli (i.e. primes from 2 to 19), as generated by: A = LCG_periods(19) (see program).
Apparently this is A086145 with a top row added. - R. J. Mathar, Jun 14 2008

Examples

			Q =
p(2,1) ..................................... [1]
p(3,1) p(3,2) .............................. [1 2]
p(5,1) p(5,2) p(5,3) p(5,4) ................ [1 4 4 2]
p(7,1) p(7,2) p(7,3) p(7,4) p(7,5) p(7,6) .. [1 3 6 3 6 2]
Therefore A = [1] [1 2] [1 4 4 2] [1 3 6 3 6 2] .....
		

Crossrefs

Cf. A086145.

Programs

  • MATLAB
    function A = LCG_periods(N); mlist = primes(N); nprimes = length(mlist); A = []; for i = 1:nprimes; m = mlist(i); for a = 1:m-1; x = 1; count = 0; while 1; count = count + 1; x = mod(a*x, m); if x == 1; break; end; end; A = [A count]; end; end

Formula

Multiplicative LCG for modulus m, multiplier a: x(n+1) == a*x(n) mod m. Additional restriction: a < m (as assumed in many applications). The output sequence for any explicit combination of m,a,x0 is always periodic and the period is independent of x0. Therefore denote the period by p(m,a). Let Q be the lower triangular matrix that is produced by tabulating all p(m,a) values, such that the rows represent m values (successive primes) and the columns represent a values (from 1 to m-1). Then A is the sequence obtained by concatenating the rows of this matrix.

A207330 Array of the orders Modd p, p a prime.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 3, 1, 5, 5, 5, 5, 1, 3, 2, 6, 3, 6, 1, 8, 8, 8, 4, 8, 2, 4, 1, 9, 9, 3, 9, 3, 9, 9, 9, 1, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 1, 14, 7, 7, 7, 14, 7, 14, 2, 14, 14, 7, 7, 14, 1, 15, 3, 15, 15, 15, 15, 5, 15, 15, 15, 5, 3, 5, 5, 1, 9, 18, 9
Offset: 1

Views

Author

Wolfdieter Lang, Mar 27 2012

Keywords

Comments

For Modd n (not to be confused with mod n) see a comment on A203571.
The row lengths sequence of this array is 1 for row n=1, and (p(n)-1)/2, with p(n):=A000040(n) (the primes), for row n>1.
A primitive root has order delta(p) = (p-1)/2 (delta is given by A055034).

Examples

			n, p(n)/m  1  2  3  4  5  6  7  8  9 10 11 12 13 14 ...
     2m-1: 1  3  5  7  9 11 13 15 17 19 21 23 25 27 ...
1,   2:    1
2,   3:    1
3,   5:    1  2
4,   7:    1  3  3
5,  11:    1  5  5  5  5
6,  13:    1  3  2  6  3  6
7,  17:    1  8  8  8  4  8  2  4
8,  19:    1  9  9  3  9  3  9  9  9
9,  23:    1 11 11 11 11 11 11 11 11 11 11
10, 29:    1 14  7  7  7 14  7 14  2 14 14  7  7 14
...
a(6,4) = 6 because 7^1 = 7, 7^2 = 49, 49 (Modd 13) := -49 (mod 13) = 3, 7^3 == 7*3 = 21,
21 (Modd 13) := -21 (mod 13) = 5, 7^4 == 7*5 = 35, 35 (Modd 13) = 35 (mod 13) = 9,
7^5 == 7*9=63, 63 (Modd 13):= 63 (mod 13) = 11, 7^6 == 7*11 = 77, 77 (Modd 13) := -77 (mod 13) = 1.
Row n=5: all 2*m-1, m>1, are primitive roots. The smallest positive one is 3.
Row n=6: only 7 and 11 are primitive roots. The smallest one is 7.
		

Crossrefs

Cf. A086145 (mod n case).

Formula

a(n,m) = (multiplicative) order Modd p(n) of 2*m-1, for m=1,...,(p(n)-1)/2, with p(n):= A000040(n) (the primes), n>1, and for a(1,1) = 1 for the prime 2.

A359210 Number of m^k == 1 (mod p) for 0 < m,k < p where p is the n-th prime.

Original entry on oeis.org

1, 3, 8, 15, 27, 40, 48, 63, 63, 104, 135, 168, 180, 195, 135, 200, 171, 360, 315, 351, 420, 375, 243, 420, 560, 520, 495, 315, 648, 624, 819, 675, 660, 675, 584, 975, 1000, 891, 495, 680, 531, 1512, 999, 1280, 1064, 1323, 1755, 1095, 675, 1480, 1140, 1287
Offset: 1

Views

Author

Seth A. Troisi, Dec 20 2022

Keywords

Comments

a(n) is the sum of (p-1) / order(m, p) for all m in Zp for the n-th prime.

Examples

			For n=3 the a(3) = 8 numbers with m^k == 1 (mod 5) (the third prime) are (1,1), (1,2), (1,3), (1,4), (2,4), (3,4), (4,2), (4,4).
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[(p - 1)/MultiplicativeOrder[m, p], {m, 1, p - 1}], {p, Prime[Range[20]]}]
  • PARI
    a(n)= my(p=prime(n)); sum(m=1,p-1,(p-1)/znorder(Mod(m,p)))
    
  • Python
    import sympy
    print([sum((p-1) // sympy.ntheory.n_order(m, p) for m in range(1, p)) for p in sympy.primerange(100)])
Showing 1-6 of 6 results.