

A008336


a(n+1) = a(n)/n if na(n) else a(n)*n, a(1) = 1.


28



1, 1, 2, 6, 24, 120, 20, 140, 1120, 10080, 1008, 11088, 924, 12012, 858, 12870, 205920, 3500640, 194480, 3695120, 184756, 3879876, 176358, 4056234, 97349616, 2433740400, 93605400, 2527345800, 90262350, 2617608150, 87253605, 2704861755, 86555576160, 2856334013280
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,3


COMMENTS

The graph of log_10(a(n)+1) seems to suggest that log(a(n)) is asymptotic to C*n where C is approximately 0.8.  Daniel Forgues, Sep 18 2011
See A370968 for the terms in increasing order with duplicates omitted.
Guy and Nowakowski give bounds on a(n).
Theorem: 1 is the only repeated term.
Suppose, seeking a contradiction, that for 1 < r < s we have a(r) = a(s).
This means that a(r)*r^e_0*(r+1)^e_1*(r+2)^e_2*...(s1)^e_t = a(s) = a(r),
where the exponents e_* are +1 or 1. The product (P1, say) of the terms with exponent +1 must equal the product (P2, say) of the terms with exponent 1. Since r>1, we need s >= r+2.
The product P1*P2 = P1^2 of all these terms is (s1)!/(r1)!.
But this contradicts Erdos's theorem (Erdos 1939) that the product of two or more consecutive integers is never a square. QED.
(End)


REFERENCES

P. Erdos, On the product of consecutive integers, J. London Math. Soc., 14 (1939), 194198.


LINKS

R. K. Guy and R. Nowakowski, Unsolved Problems, Amer. Math. Monthly, vol. 102 (1995), 921926; circa page 924.


MAPLE

A008336 := proc(n) option remember; if n = 1 then 1 elif A008336(n1) mod (n1) = 0 then A008336(n1)/(n1) else A008336(n1)*(n1); fi; end;


MATHEMATICA

a[n_] := a[n] = If[ Divisible[ a[n1], n1], a[n1]/(n1), a[n1]*(n1)]; a[1] = 1; Table[a[n], {n, 1, 28}] (* JeanFrançois Alcover, Dec 02 2011 *)
nxt[{n_, a_}]:={n+1, If[Divisible[a, n], a/n, n*a]}; Transpose[ NestList[ nxt, {1, 1}, 30]][[2]] (* Harvey P. Dale, May 09 2016 *)


PROG

(Haskell)
a008336 n = a008336_list !! (n1)
a008336_list = 1 : zipWith (/*) a008336_list [1..] where
x /* y = if x `mod` y == 0 then x `div` y else x*y
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
if n == 1: return 1
a, b = divmod(c:=A008336(n1), n1)


CROSSREFS

Cf. A005132 (the original Recaman sequence).
Cf. also A195504 = Product of numbers up to n1 used as divisors in A008336(n), n >= 2; a(1) = 1.


KEYWORD



AUTHOR



STATUS

approved



