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.

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

This page as a plain text file.
%I A271669 #29 Jan 20 2025 17:54:18
%S A271669 2,161038,6,12,10,30,14,56,18,30,22,132,26,182,30,48,34,306,38,380,42,
%T A271669 66,46,552,50,130,54,84,58,870,62,992,66,102,70,180,74,1406,78,120,82,
%U A271669 1722,86,1892,90,138,94,2256,98,350,102,156,106,2862,110,280,114,174,118,3540
%N A271669 Smallest k > n such that n divides k and n^k == n (mod k).
%H A271669 Amiram Eldar, <a href="/A271669/b271669.txt">Table of n, a(n) for n = 1..10000</a>
%F A271669 a(n) = 2n for odd n. - _Robert Israel_, Apr 12 2016
%F A271669 a(n) = n * A102457(n) for n > 1. - _Thomas Ordowski_, Apr 13 2016
%e A271669 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 A271669 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 *)
%t A271669 skn[n_]:=Module[{k=2n},While[PowerMod[n,k,k]!=n,k=k+n];k]; Array[skn,60] (* _Harvey P. Dale_, Jan 20 2025 *)
%o A271669 (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 A271669 Cf. A006935, A102457.
%K A271669 nonn
%O A271669 1,1
%A A271669 _Thomas Ordowski_, Apr 12 2016
%E A271669 More terms from _Michel Marcus_, Apr 12 2016