A192476 Monotonic ordering of set S generated by these rules: if x and y are in S then x^2 + y^2 is in S, and 1 is in S.
1, 2, 5, 8, 26, 29, 50, 65, 68, 89, 128, 677, 680, 701, 740, 842, 845, 866, 905, 1352, 1517, 1682, 2501, 2504, 2525, 2564, 3176, 3341, 4226, 4229, 4250, 4289, 4625, 4628, 4649, 4688, 4901, 5000, 5066, 5300, 5465, 6725, 7124, 7922, 7925, 7946, 7985
Offset: 1
Keywords
Examples
1^2+1^2=2, 1^2+2^2=5, 2^2+2^2=8, 1^2+5^2=26.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..6171
Programs
-
Haskell
import Data.Set (singleton, deleteFindMin, insert) a192476 n = a192476_list !! (n-1) a192476_list = f [1] (singleton 1) where f xs s = m : f xs' (foldl (flip insert) s' (map (+ m^2) (map (^ 2) xs'))) where xs' = m : xs (m,s') = deleteFindMin s -- Reinhard Zumkeller, Aug 15 2011
-
Mathematica
start = {1}; f[x_, y_] := x^2 + y^2 (* start is a subset of t, and if x,y are in t then f(x,y) is in t. *) b[z_] := Block[{w = z}, Select[Union[Flatten[AppendTo[w, Table[f[w[[i]], w[[j]]], {i, 1, Length[w]}, {j, 1, i}]]]], # < 30000 &]]; t = FixedPoint[b, start] (* A192476 *) Differences[t] (* based on program by Robert G. Wilson v at A009293 *)
Comments