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.

A205546 Least positive integer k such that n divides k^k-j^j for some j in [1,k-1].

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jan 31 2012

Keywords

Comments

For a guide to related sequences, see A204892.

Examples

			1 divides 2^2-1^1 -> k=2, j=1
2 divides 3^3-1^1 -> k=3, j=1
3 divides 2^2-1^1 -> k=2, j=1
4 divides 4^4-2^2 -> k=4, j=2
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local S,k,v;
      S:= {}:
      for k from 1 do
        v:= k &^ k mod n;
        if member(v,S) then return k fi;
        S:= S union {v}
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 23 2023
  • Mathematica
    s = Table[n^n, {n, 1, 120}];
    lk = Table[NestWhile[# + 1 &, 1,
       Min[Table[Mod[s[[#]] - s[[j]], z], {j, 1, # - 1}]] =!= 0 &], {z, 1, Length[s]}]
    Table[NestWhile[# + 1 &, 1,
      Mod[s[[lk[[j]]]] - s[[#]], j] =!= 0 &],
    {j, 1, Length[lk]}]
    (* Peter J. C. Moses, Jan 27 2012 *)