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.

Previous Showing 11-13 of 13 results.

A096385 a(n) = smallest prime p with p^n mod n = 1.

Original entry on oeis.org

3, 7, 3, 11, 5, 29, 3, 7, 11, 23, 5, 53, 13, 31, 3, 103, 5, 191, 3, 37, 23, 47, 5, 11, 53, 7, 13, 59, 11, 311, 3, 67, 67, 71, 5, 149, 37, 61, 3, 83, 5, 173, 23, 31, 47, 283, 5, 29, 11, 103, 5, 107, 5, 31, 13, 7, 59, 709, 7, 367, 61, 37, 3, 131, 23, 269, 13, 139, 29, 569
Offset: 2

Views

Author

Reinhard Zumkeller, Aug 05 2004

Keywords

Examples

			n=5: 2^5=32=5*6+2, 3^5=243=5*48+3, 5^5 mod 5 = 0, 7^5=16807=5*3361+2, 11^5=161051=5*32210+1: a(5)=11.
		

Crossrefs

Programs

  • Mathematica
    With[{prs=Prime[Range[200]]},Table[SelectFirst[prs,PowerMod[#,n,n]==1&],{n,2,80}]] (* The program uses the SelectFirst function from Mathematica version 10 *) (* Harvey P. Dale, Aug 31 2015 *)
  • PARI
    a(n) = my(p=2); while (Mod(p,n)^n !=1, p=nextprime(p+1)); p; \\ Michel Marcus, Feb 07 2021

A114448 Array a(n,k) = n^k (mod k) read by antidiagonals (k>=1, n>=1).

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 0, 1, 2, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 1, 0, 0, 2, 0, 3, 4, 1, 0, 1, 0, 1, 4, 3, 2, 1, 0, 0, 1, 0, 0, 4, 3, 0, 1, 0, 1, 2, 1, 1, 1, 4, 1, 8, 1, 0, 0, 0, 0, 2, 0, 5, 0, 0, 4, 1, 0, 1, 1, 1, 3, 1, 6, 1, 1, 9, 2, 1, 0, 0, 2, 0, 4, 4, 0, 0, 8, 6, 3, 4, 1, 0, 1, 0, 1, 0, 3, 1, 1, 0, 5, 4, 9, 2, 1
Offset: 1

Views

Author

Leroy Quet, Feb 14 2006

Keywords

Comments

Alternate description: triangular array a(n, k) = n^k (mod k) read by rows (n > 1, 0 < k < n). This is equivalent because a(n, k) = a(n-k, k). - David Wasserman, Jan 25 2007

Examples

			2^6 = 64 and 64 (mod 6) is 4. So a(2,6) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_, k_] := Mod[n^k, k]; Table[a[n - k + 1, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Dec 12 2012 *)

Extensions

More terms from David Wasserman, Jan 25 2007

A374911 a(n) = a(2^n mod n) + a(3^n mod n), with a(0) = 1.

Original entry on oeis.org

1, 2, 3, 4, 3, 7, 7, 7, 3, 4, 7, 7, 7, 7, 7, 10, 3, 7, 11, 7, 5, 10, 7, 7, 7, 18, 7, 8, 21, 7, 7, 7, 3, 11, 7, 18, 25, 7, 7, 11, 5, 7, 17, 7, 10, 18, 7, 7, 14, 14, 21, 11, 10, 7, 29, 14, 7, 11, 7, 7, 13, 7, 7, 11, 3, 17, 7, 7, 10, 11, 21, 7, 7, 7, 7, 21, 10, 32, 11, 7, 5, 6, 7, 7, 14, 10, 7, 11, 19
Offset: 0

Views

Author

Bryle Morga, Jul 23 2024

Keywords

Comments

Conjectured to contain all positive integers. Here are the indexes where each of the first few positive integers appear:
1: 0
2: 1
3: 2, 4, 8, 16, 32, ... (2^k, k > 0)
4: 3, 9, ...
5: 20, 40, 80, 272, 320, 328, ...
6: 81, 66469, 144937, ...
7: 5, 6, 7, 10, 11, 12, 13,... (all primes appear except 2 and 3)
8: 27, 301, 729, 1099, 2107, 2187, 85085, 1594323, ...
Most solutions to a(n) = 5 seem to be divisible by 5 and all of them seem to be even. Why?
Are 3 and 9 the only solutions to a(n) = 4?

Crossrefs

Programs

  • Mathematica
    a[0]=1; a[n_]:=a[PowerMod[2,n,n]]+a[PowerMod[3,n,n]]; Array[a,89,0] (* Stefano Spezia, Jul 23 2024 *)
  • PARI
    a(n) = if (n==0, 1, a(lift(Mod(2,n)^n)) + a(lift(Mod(3,n)^n))); \\ Michel Marcus, Jul 25 2024
  • Python
    def a(n):
      return 1 if n == 0 else a(pow(2, n, n)) + a(pow(3, n, n))
    

Formula

a(p) = 7 for primes p except 2 and 3.
a(2^n) = 3 for n > 0.
Previous Showing 11-13 of 13 results.