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”).

Smallest k > n such that n divides k and n^k == n (mod k).
1

%I #27 Aug 26 2019 05:05:43

%S 2,161038,6,12,10,30,14,56,18,30,22,132,26,182,30,48,34,306,38,380,42,

%T 66,46,552,50,130,54,84,58,870,62,992,66,102,70,180,74,1406,78,120,82,

%U 1722,86,1892,90,138,94,2256,98,350,102,156,106,2862,110,280,114,174,118,3540

%N Smallest k > n such that n divides k and n^k == n (mod k).

%H Amiram Eldar, <a href="/A271669/b271669.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = 2n for odd n. - _Robert Israel_, Apr 12 2016

%F a(n) = n * A102457(n) for n > 1. - _Thomas Ordowski_, Apr 13 2016

%e 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

%t 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 *)

%o (PARI) a(n) = {k = n+1; while( !(((k % n)==0) && (Mod(n,k)^k == Mod(n, k))), k++); k;} \\ _Michel Marcus_, Apr 12 2016

%Y Cf. A006935, A102457.

%K nonn

%O 1,1

%A _Thomas Ordowski_, Apr 12 2016

%E More terms from _Michel Marcus_, Apr 12 2016