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) is the smallest k > 1 such that A000166(k) is divisible by n!.
0

%I #23 May 20 2019 10:09:23

%S 2,2,3,7,25,121,241,1681,13441,40321,403201,2016001,3225601,41932801,

%T 609638401

%N a(n) is the smallest k > 1 such that A000166(k) is divisible by n!.

%C a(n) is the smallest k > 1 such that round(k!/e) is divisible by n!.

%C Terms are 0! + 1, 1! + 1, 2! + 1, 3! + 1, 4! + 1, 5! + 1, 6!/3 + 1, 7!/3 + 1, ...

%e a(3) = 7 because the smallest nonzero subfactorial number that is divisible by 3! is A000166(7) = 1854.

%p f:= proc(n) local k, t, p;

%p p:= n!;

%p t:= 0;

%p for k from 2 do

%p t:= k*t + (-1)^k mod p;

%p if t = 0 then return k fi

%p od:

%p end proc:

%p seq(f(n),n=0..13); # _Robert Israel_, Oct 03 2017

%Y Cf. A000142, A000166.

%K nonn,more

%O 0,1

%A _Altug Alkan_, Oct 03 2017

%E a(8)-a(14) from _Robert Israel_, Oct 03 2017