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!)
A125577 a(0) = 1; for n >= 1, a(n) = n^2 - a(n-1). 3

%I #32 Feb 26 2024 01:57:12

%S 1,0,4,5,11,14,22,27,37,44,56,65,79,90,106,119,137,152,172,189,211,

%T 230,254,275,301,324,352,377,407,434,466,495,529,560,596,629,667,702,

%U 742,779,821,860,904,945,991,1034,1082,1127,1177,1224,1276,1325,1379,1430

%N a(0) = 1; for n >= 1, a(n) = n^2 - a(n-1).

%C A sequence given by a recurrence that is almost polynomial; it cannot be expressed as a polynomial, but is bounded by n^2.

%C If we let a(0) = 0, the triangular numbers result; a typo led to the new sequence.

%H Vincenzo Librandi, <a href="/A125577/b125577.txt">Table of n, a(n) for n = 0..1000</a>

%F O.g.f.: (-1+2*x-4*x^2+x^3)/((-1+x)^3*(1+x)). a(n) = -n-1+(-1)^n+A000217(n+1). - _R. J. Mathar_, Dec 05 2007

%F a(n) = n*(n+1)/2 + (-1)^n = A000217(n) + (-1)^n. - _Franklin T. Adams-Watters_, Jul 13 2014

%F E.g.f.: exp(x)*(x+x^2/2) + exp(-x). - _Franklin T. Adams-Watters_, Jul 13 2014

%e a(0)=1, so a(1) = 1^2 - 1 = 0; a(2) = 2^2 - 0 = 4; a(3) = 9 - 4 = 5; etc.

%t a[0] := 1 a[n_] := n^2 - a[n - 1]

%t CoefficientList[Series[(-1 + 2 x - 4 x^2 + x^3)/((-1 + x)^3 (1 + x)), {x, 0, 50}], x] (* _Vincenzo Librandi_, May 19 2014 *)

%o (Python)

%o a = 1

%o for n in range(1,77):

%o print(a, end=',')

%o a = n*n - a

%o (Magma) [1] cat [n le 1 select n-1 else n^2-Self(n-1): n in [1..50]]; // _Vincenzo Librandi_, May 19 2014

%Y Cf. A000217.

%K nonn,easy

%O 0,3

%A John C. George (John.George(AT)ENMU.edu), Jan 03 2007

%E Name corrected by _Alex Ratushnyak_, Aug 03 2012

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 August 5 19:08 EDT 2024. Contains 374954 sequences. (Running on oeis4.)