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.

A381903 Primes prime(k) such that (prime(k) - k)^k == k (mod prime(k)).

Original entry on oeis.org

2, 5, 7, 97, 877, 12979, 203659, 364717, 1681853, 189961939, 189962137, 466446781, 1511085889
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 12 2025

Keywords

Examples

			5 is a term in the sequence because 5 = prime(3) and (prime(3) - 3)^3 == 3 (mod 5).
		

Crossrefs

Cf. A014689.

Programs

  • Magma
    [NthPrime(k): k in [1..1000] | (NthPrime(k)-k)^k mod NthPrime(k) eq k];
    
  • Mathematica
    With[{r = Range[130000]}, Select[Transpose[{Prime[r], r}], PowerMod[#[[1]] - #[[2]], #[[2]], #[[1]]] == Mod[#[[2]], #[[1]]] &][[;; , 1]]] (* Amiram Eldar, May 13 2025 *)
  • PARI
    lista(nn) = my(k=0); forprime (p=1, nn, k++; if (Mod(p-k,p)^k == k, print1(p, ", "));); \\ Michel Marcus, May 13 2025
  • Python
    import sympy; [p for k,p in enumerate(sympy.primerange(10**7), 1) if pow(p-k, k, p) == k] # David Radcliffe, May 12 2025
    

Extensions

a(10)-a(12) from David Radcliffe, May 13 2025
a(13) from Michel Marcus, May 13 2025