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

a(n) = least k such that the remainder when 7^k is divided by k is n.
40

%I #23 Jan 30 2023 15:01:07

%S 2,5,46,339,22,387497,11,535,10,111,38,8399,15,497,34,327,365,515,30,

%T 7219931,28,321,26,223793,44,10718597,242,35,2330,209,39,305,136,309,

%U 4382,10596486211,45,24751,7327,121,236,78821,55,4117,76,1751,30514339,83795,50,1333

%N a(n) = least k such that the remainder when 7^k is divided by k is n.

%H Robert G. Wilson v, <a href="/A119715/a119715.txt">Table of n, a(n) for n = 1..10000 with -1 for those entries where a(n) has not yet been found</a>

%t t = Table[0, {10000}]; k = 1; lst = {}; While[k < 4100000000, a = PowerMod[7, k, k]; If[ a<10001 && t[[a]]==0, t[[a]]=k; Print[{a,k}]]; k++ ]; t (* changed (to reflect the new limits) by _Robert G. Wilson v_, Jul 17 2009 *)

%t lk[n_]:=Module[{k=1},While[PowerMod[7,k,k]!=n,k++];k]; Array[lk,50] (* The program will take a long time to run. *) (* _Harvey P. Dale_, Jan 29 2023 *)

%Y Cf. A036236, A078457, A119678, A119679, A127816, A119714, A127817, A127818, A127819, A127820, A127821.

%K nonn

%O 1,1

%A _Ryan Propper_, Jun 12 2006

%E a(36) = 10596486211 and later terms from _Ryan Propper_, Feb 02 2007