%I M0704 #40 Mar 27 2024 13:06:46
%S 2,3,5,9,14,17,26,27,33,41,44,50,51,53,65,69,77,80,81,84,87,98,99,101,
%T 105,122,125,129,131,134,137,149,152,153,158,159,161,164,167,173,194,
%U 195,197,201,204,206,209,219,230,233,237,239,242,243,249
%N A self-generating sequence: start with 2 and 3, take all products of any 2 previous elements, subtract 1 and adjoin them to the sequence.
%C a(n) = A139127(n)*a(k)-1 for some k; A139128 gives number of distinct representations a(n) = a(i)*a(j)-1. - _Reinhard Zumkeller_, Apr 09 2008
%C Complement of A171413. [_Jaroslav Krizek_, Dec 08 2009]
%D R. K. Guy, Unsolved Problems in Number Theory, E31.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Reinhard Zumkeller, <a href="/A005244/b005244.txt">Table of n, a(n) for n = 1..10000</a>
%H Thomas Bloom, <a href="https://www.erdosproblems.com/424">Problem 424</a>, Erdős Problems.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HofstadterSequences.html">Hofstadter Sequences.</a>
%e 17 is present because it equals 2*9-1.
%t f[s_,mx_] := Union[s, Select[Apply[Times, Subsets[s, {2}], {1}] - 1, # <= mx &]]; mx = 250; FixedPoint[f[#, mx] &, {2, 3}] (* _Jean-François Alcover_, Mar 29 2011 *)
%o (Haskell)
%o import Data.Set (singleton, deleteFindMin, fromList, union)
%o a005244 n = a005244_list !! (n-1)
%o a005244_list = f [2] (singleton 2) where
%o f xs s = y :
%o f (y : xs) (s' `union` fromList (map ((subtract 1) . (* y)) xs))
%o where (y,s') = deleteFindMin s
%o -- _Reinhard Zumkeller_, Feb 26 2013
%Y Cf. A139127, A139128, A171413.
%K nonn,nice,easy
%O 1,1
%A D. R. Hofstadter
%E More terms from _Jud McCranie_