A077221 a(0) = 0 and then alternately even and odd numbers in increasing order such that the sum of any two successive terms is a square.
0, 1, 8, 17, 32, 49, 72, 97, 128, 161, 200, 241, 288, 337, 392, 449, 512, 577, 648, 721, 800, 881, 968, 1057, 1152, 1249, 1352, 1457, 1568, 1681, 1800, 1921, 2048, 2177, 2312, 2449, 2592, 2737, 2888, 3041, 3200, 3361, 3528, 3697, 3872, 4049, 4232
Offset: 0
Examples
From _Omar E. Pol_, Feb 16 2014: (Start) Illustration of initial terms as a cellular automaton: . . O O O O O O O . O O O O O O O . O O O O O O O O O O . O O O O O O O O O O . O O O O O O O O O O . O O O O O O O . O O O O O O O . . 1 8 17 32 . (End)
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..10000
- Bruno Berselli, An origin of A077221 (illustration) (see Pol's comment).
- N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS.
- Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
- Index entries for sequences related to cellular automata.
Crossrefs
Programs
-
Haskell
a077221 n = a077221_list !! n a077221_list = scanl (+) 0 a047522_list -- Reinhard Zumkeller, Jan 07 2012
-
Magma
[2*n^2 - (n mod 2): n in [0..50]]; // Vincenzo Librandi, Sep 22 2011
-
Maple
a := n -> 2*n^2 - (n mod 2); # Peter Luschny, Jul 12 2009
-
Mathematica
a=1;lst={a};Do[b=n^2-a;AppendTo[lst,b];a=b,{n,3,6!,2}];lst (* Vladimir Joseph Stephan Orlovsky, May 18 2009 *)
Formula
a(2n) = 8*n^2, a(2n+1) = 8*n(n+1) + 1.
From Ralf Stephan, Mar 31 2003: (Start)
a(n) = 2*n^2 + 4*n + 1 [+1 if n is odd] with a(0)=1.
G.f.: x*(x^2+6*x+1)/(1-x)^3/(1+x). (End)
Row sums of triangle A131925; binomial transform of (1, 7, 2, 4, -8, 16, -32, ...). - Gary W. Adamson, Jul 29 2007
a(n) = a(-n); a(n+1) = A195605(n) - (-1)^n. - Bruno Berselli, Sep 22 2011
a(n) = 2*n^2 + ((-1)^n-1)/2. - Omar E. Pol, Sep 28 2011
Sum_{n>=1} 1/a(n) = Pi^2/48 + tan(Pi/(2*sqrt(2)))*Pi /(4*sqrt(2)). - Amiram Eldar, Jan 16 2023
Extensions
Extended by Ralf Stephan, Mar 31 2003
Comments