login
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