A101135 a(1)=1. a(n) = a(n-1) + sum of the squares which are among the first (n-1) terms of the sequence.
1, 2, 3, 4, 9, 23, 37, 51, 65, 79, 93, 107, 121, 256, 647, 1038, 1429, 1820, 2211, 2602, 2993, 3384, 3775, 4166, 4557, 4948, 5339, 5730, 6121, 6512, 6903, 7294, 7685, 8076, 8467, 8858, 9249, 9640, 10031, 10422, 10813, 11204, 11595, 11986, 12377, 12768
Offset: 1
Keywords
Links
Programs
-
Mathematica
Block[{a = {1}}, Do[AppendTo[a, a[[n - 1]] + Total@ Select[a, IntegerQ@ Sqrt@ # &]], {n, 2, 46}]; a] (* Michael De Vlieger, Aug 16 2017 *)
-
PARI
vector(100, n, if(n==1, a_n_1=sum_=1, a_n_1+=sum_; if(ispolygonal(a_n_1, 4), sum_+=a_n_1)); a_n_1) \\ Colin Barker, Feb 20 2015
Extensions
More terms from Reinhard Zumkeller, Jun 14 2007