login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A257171 Sum of numbers on n-th segment of Ulam's spiral. 1

%I #21 Jun 13 2015 00:55:36

%S 1,5,9,13,27,36,62,78,120,145,207,243,329,378,492,556,702,783,965,

%T 1065,1287,1408,1674,1818,2132,2301,2667,2863,3285,3510,3992,4248,

%U 4794,5083,5697,6021,6707,7068,7830,8230,9072,9513,10439,10923,11937,12466,13572,14148,15350

%N Sum of numbers on n-th segment of Ulam's spiral.

%C From Ulam's spiral, consider successive segments s(0) = [1]; s(1) = [2, 3]; s(2) = [4, 5]; s(3) = [6, 7]; s(4) = [8, 9, 10] and so on. a(n) is sum of numbers of the segment s(n). The first differences are A002601 interleaved with A000290. See illustration in the links.

%H Michael De Vlieger, <a href="/A257171/b257171.txt">Table of n, a(n) for n = 0..10000</a>

%H Kival Ngaokrajang, <a href="/A257171/a257171.pdf">Illustration of initial terms</a>

%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,3,-3,-3,3,1,-1).

%F a(0) = 1; a(1) = 5; a(2) = 9; for n >= 3, a(n) = a(n-1)+((n-1)/2+1)^2, if n = even; otherwise a(n) = a(n-1)+2*((n-1)^2/4+(n-1)+7/4).

%F From _Colin Barker_, Apr 17 2015: (Start)

%F a(n) = (n^3+5*n^2+14*n+16)/8 for n even and n>1.

%F a(n) = (n^3+4*n^2+11*n+8)/8 for n odd and n>1.

%F G.f.: (2*x^8-3*x^7-5*x^6+9*x^5+5*x^4-8*x^3+x^2+4*x+1) / ((x-1)^4*(x+1)^3).

%F (End)

%t f[n_] := Block[{t = {5, 9}}, For[i = 3, i <= n, i++, If[OddQ@ i, AppendTo[t, t[[i - 1]] + ((i - 1)/2 + 1)^2], AppendTo[t, t[[i - 1]] + 2 ((i - 1)^2/4 + (i - 1) + 7/4)]]]; {1}~Join~t]; f@ 48(* _Michael De Vlieger_, Apr 17 2015 *)

%o (PARI) a(n) = if(n<=0, 1, if(n<=1, 5, if(n<=2, 9, if(Mod(n,2)==0, a(n-1)+2*((n-1)^2/4+(n-1)+7/4), a(n-1)+((n-1)/2+1)^2))))

%o for (n=0, 100, print1(a(n),", "))

%o (PARI) Vec((2*x^8-3*x^7-5*x^6+9*x^5+5*x^4-8*x^3+x^2+4*x+1)/((x-1)^4*(x+1)^3) + O(x^100)) \\ _Colin Barker_, Apr 18 2015

%Y Cf. A054552, A002061, A000290.

%K nonn,easy

%O 0,2

%A _Kival Ngaokrajang_, Apr 17 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 23:15 EDT 2024. Contains 371798 sequences. (Running on oeis4.)