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
Comments from N. J. A. Sloane, Apr 14 2024: (Start)
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.
Proof: Write a(n) for A008336(n).
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*...(s-1)^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 (s-1)!/(r-1)!.
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), 194-198.
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..2732 (terms 1..1000 from T. D. Noe)
R. K. Guy and R. Nowakowski, Unsolved Problems, Amer. Math. Monthly, vol. 102 (1995), 921-926; circa page 924.
R. K. Guy and R. Nowakowski, Annotated extract from previous link
Nick Hobson, Python program for this sequence
N. J. A. Sloane, My favorite integer sequences, in Sequences and their Applications (Proceedings of SETA '98).
MAPLE
MATHEMATICA
a[n_] := a[n] = If[ Divisible[ a[n-1], n-1], a[n-1]/(n-1), a[n-1]*(n-1)]; a[1] = 1; Table[a[n], {n, 1, 28}] (* Jean-Franç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 !! (n-1)
a008336_list = 1 : zipWith (/*) a008336_list [1..] where
x /* y = if x `mod` y == 0 then x `div` y else x*y
-- Reinhard Zumkeller, Feb 22 2012, Oct 25 2010
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def A008336(n):
if n == 1: return 1
a, b = divmod(c:=A008336(n-1), n-1)
return c*(n-1) if b else a # Chai Wah Wu, Apr 11 2024
CROSSREFS
Cf. A005132 (the original Recaman sequence).
KEYWORD
AUTHOR
STATUS
approved