%I #43 Nov 26 2015 20:29:13
%S 1,2,5,26,29,677,680,701,842,845,866,1517,458330,458333,458354,459005,
%T 459170,462401,462404,462425,463076,463241,491402,491405,491426,
%U 492077,492242,708965,708968,708989,709640,709805,714026,714029,714050,714701
%N Smallest number strictly greater than previous one which is the sum of squares of two previous distinct terms (a(1)=1, a(2)=2).
%C A003095 is a subsequence apart from the initial term. - _Reinhard Zumkeller_, Jan 17 2008
%C The subsequence of primes begins: 2, 5, 29, 677, 701, 458333, 462401, 492077, 708989, 714029, ... - _Jonathan Vos Post_, Nov 21 2012
%D F. Smarandache, Definitions solved and unsolved problems, conjectures and theorems in number theory and geometry, edited by M. Perez, Xiquan Publishing House 2000
%D F. Smarandache, Sequences of Numbers Involved in Unsolved Problems, Hexis, Phoenix, 2006.
%H T. D. Noe, <a href="/A008318/b008318.txt">Table of n, a(n) for n=1..1000</a>
%H Mihaly Bencze [Beneze], <a href="http://www.gallup.unm.edu/~smarandache/mihalyb.htm">Smarandache Recurrence Type Sequences</a>, in Bull. Pure Appl. Sciences, Vol. 16E, No. 2, 231-236, 1997.
%H F. Smarandache, <a href="http://www.gallup.unm.edu/~smarandache/Definitions-book.pdf">Definitions, Solved and Unsolved Problems, Conjectures, ...</a>
%H F. Smarandache, <a href="http://www.gallup.unm.edu/~smarandache/Sequences-book.pdf">Sequences of Numbers Involved in Unsolved Problems</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SmarandacheSequences.html">Smarandache Sequences.</a>
%t a[1]=1; a[2]=2; a[n_] := a[n] = First[ Select[ Sort[ Flatten[ Table[a[j]^2 + a[k]^2, {j, 1, n-1}, {k, j+1, n-1}]]], # > a[n-1] & , 1]]; Table[a[n], {n, 1, 36}](* _Jean-François Alcover_, Nov 10 2011 *)
%o (Haskell)
%o import Data.Set (singleton, deleteFindMin, insert)
%o a008318 n = a008318_list !! (n-1)
%o a008318_list = f [1] (singleton 1) where
%o f xs s =
%o m : f (m:xs) (foldl (flip insert) s' (map (+ m^2) (map (^ 2) xs)))
%o where (m,s') = deleteFindMin s
%o -- _Reinhard Zumkeller_, Aug 15 2011
%Y Cf. A192476.
%K nonn,easy,nice
%O 1,2
%A R. Muller
%E More terms from _David W. Wilson_