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.

A062169 Triangle T(n, k) = k! mod n for n >= 1, 1 <= k <= n.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jun 11 2001

Keywords

Examples

			a(7,4) = 4! mod 7 = 24 mod 7 = 3. Rows are:
0;
1,0;
1,2,0;
1,2,2,0;
1,2,1,4,0;
1,2,0,0,0,0;
1,2,6,3,1,6,0;
1,2,6,0,0,0,0,0;
1,2,6,6,3,0,0,0,0;
1,2,6,4,0,0,0,0,0,0;
		

Crossrefs

First zero in each row is when k=A002034. Maximum value in each row is A062170. Number of distinct values in each row is A038203. Cf. A000142, A048158, A051127.

Programs

  • Mathematica
    Table[Mod[Range[n]!, n], {n, 1, 15}] // Flatten (* Jean-François Alcover, Oct 25 2013 *)
  • PARI
    { n=0; for (k=1, 50, for (m=1, k, write("b062169.txt", n++, " ", m!%k)) ) } \\ Harry J. Smith, Aug 02 2009

Extensions

Definition amended by Georg Fischer, Oct 27 2021

A049046 Number of k >= 1 with k! == 1 (mod n).

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 4, 1, 2, 1, 1, 1, 5, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 4, 1, 5, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 4, 1, 1, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 2, 1, 3, 1, 1
Offset: 1

Views

Author

Keywords

Comments

The first occurrences for 0..10 are 1, 2, 5, 29, 17, 23, 199, 619, 3313, 4093, 3011, ... (see A049050). - Antti Karttunen, Oct 01 2018

Examples

			From _Antti Karttunen_, Oct 01 2018: (Start)
a(1) = 0 because 1 divides all factorial numbers (A000142): 1, 2, 6, 24, ... and thus there are no cases where the remainder would be 1.
a(3) = 1 as (1! mod 3) = 1, (2! mod 3) = 2 and for 3! and larger factorials the remainder is always 0. Thus there is exactly one case where the remainder is one.
a(5) = 2 as (1! mod 5) = 1, (2! mod 5) = 2, (3! mod 5) = 1, (4! mod 5) = 5, (5! mod 5) = 0, and so on ever after for larger factorials.
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[100], Mod[#!, n] == 1 &]], {n, 1, 100}] (* G. C. Greubel, Oct 08 2018 *)
  • PARI
    A049046(n) = { my(s=0, r, k=1); while((r=(k! % n))>0, s += (1==r); k++); (s); }; \\ Antti Karttunen, Oct 01 2018

Extensions

Term a(1) corrected and the definition clarified by Antti Karttunen, Oct 01 2018
Definition further edited by Antti Karttunen, Oct 06 2018, based on feedback from David W. Wilson

A038204 Least k such that factorials have exactly n distinct residues mod k.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 22, 25, 55, 13, 26, 17, 34, 57, 76, 95, 23, 46, 29, 58, 31, 62, 93, 155, 319, 37, 74, 129, 41, 82, 47, 94, 141, 235, 53, 106, 59, 118, 71, 142, 61, 67, 134, 73, 146, 219, 365, 511, 79, 158, 237, 395, 553, 1241, 83, 166, 332, 747, 89, 178, 291, 485
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A038203.

Programs

  • Mathematica
    s = Table[Length@ Union@ Mod[Range[10^3]!, n], {n, 2000}]; Table[FirstPosition[s, n], {n, 62}] // Flatten (* Michael De Vlieger, Aug 03 2016, Version 10 *)
  • PARI
    a(n)=my(k=n,t=1); while(#Set(vector(k,i,t=(t*i)%k))!=n, k++; t=1); k \\ Charles R Greathouse IV, Aug 03 2016
Showing 1-3 of 3 results.