login
a(n) = n*(n-1)*(n-2)*(n-3)*...*(n-k) such that (n-k) is the largest prime smaller than n.
1

%I #23 Dec 17 2021 16:57:29

%S 1,2,6,12,60,30,210,56,504,5040,55440,132,1716,182,2730,43680,742560,

%T 306,5814,380,7980,175560,4037880,552,13800,358800,9687600,271252800,

%U 7866331200,870,26970,992,32736,1113024,38955840,1402410240,51889178880

%N a(n) = n*(n-1)*(n-2)*(n-3)*...*(n-k) such that (n-k) is the largest prime smaller than n.

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

%F a(n) = Product_{k = prevprime(n)..n} k, for n>=3 with a(1)=1, a(2)=2 and where prevprime = A151799. - _Wesley Ivan Hurt_, Dec 12 2021

%e a(10) = 10*9*8*7 = 5040 because 7 is the largest prime smaller than 10.

%t a[1] = 1; a[2] = 2; a[n_] := n!/(NextPrime[n, -1] - 1)!; Array[a, 30] (* _Amiram Eldar_, Feb 08 2021 *)

%o (PARI) a(n) = if (n<=2, n, prod(k=0, n-precprime(n-1), n-k)); \\ _Michel Marcus_, Feb 09 2021

%Y Cf. A151799 (prevprime v.2), A286900 (sum of the numbers from n to nextprime(n)).

%K nonn,look

%O 1,2

%A Luc Stevens (lms022(AT)yahoo.com), Apr 25 2006

%E Offset and a(36) corrected by _Amiram Eldar_, Feb 08 2021