login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A271669
Smallest k > n such that n divides k and n^k == n (mod k).
1
2, 161038, 6, 12, 10, 30, 14, 56, 18, 30, 22, 132, 26, 182, 30, 48, 34, 306, 38, 380, 42, 66, 46, 552, 50, 130, 54, 84, 58, 870, 62, 992, 66, 102, 70, 180, 74, 1406, 78, 120, 82, 1722, 86, 1892, 90, 138, 94, 2256, 98, 350, 102, 156, 106, 2862, 110, 280, 114, 174, 118, 3540
OFFSET
1,1
LINKS
FORMULA
a(n) = 2n for odd n. - Robert Israel, Apr 12 2016
a(n) = n * A102457(n) for n > 1. - Thomas Ordowski, Apr 13 2016
EXAMPLE
Because of the definition of (pseudo)primes to base 2, a(2) is the least element of A006935 greater than 2. - Altug Alkan, Apr 12 2016
MATHEMATICA
Table[SelectFirst[Range[n + 1, 10^6], Function[k, Divisible[k, n] && PowerMod[n, k, k] == Mod[n, k]]], {n, 60}] (* Michael De Vlieger, Apr 12 2016, Version 10 *)
PROG
(PARI) a(n) = {k = n+1; while( !(((k % n)==0) && (Mod(n, k)^k == Mod(n, k))), k++); k; } \\ Michel Marcus, Apr 12 2016
CROSSREFS
Sequence in context: A324438 A167518 A178168 * A006935 A070833 A176584
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Apr 12 2016
EXTENSIONS
More terms from Michel Marcus, Apr 12 2016
STATUS
approved