cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A248825 a(n) = n^2 + 1 - (-1)^n.

This page as a plain text file.
%I A248825 #44 Aug 21 2022 04:18:50
%S A248825 0,3,4,11,16,27,36,51,64,83,100,123,144,171,196,227,256,291,324,363,
%T A248825 400,443,484,531,576,627,676,731,784,843,900,963,1024,1091,1156,1227,
%U A248825 1296,1371,1444,1523,1600,1683,1764,1851,1936,2027,2116
%N A248825 a(n) = n^2 + 1 - (-1)^n.
%C A248825 Also, A016742 and A164897 interleaved.
%C A248825 See the spiral in Example field of A054552: after 0, the sequence is given by the terms of the semidiagonals 4, 16, 36, 64, 100, ... and 3, 11, 27, 51, 83, ... sorted into ascending order.
%C A248825 Primes of the sequence are in A056899.
%H A248825 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1).
%F A248825 a(n) = a(-n) = 2*a(n-1) - 2*(n-3) + a(n-4).
%F A248825 a(n) = n^2 + A010673(n) = (n+1)^2 - A168277(n+1).
%F A248825 a(n+1) = A248800(n) + A042963(n+1) = a(n) + A166519(n).
%F A248825 a(n+2) = a(n) + 4*n.
%F A248825 a(n+5) = a(n-5) + A008602(n).
%F A248825 G.f.: x*(3 - 2*x + 3*x^2)/((1 + x)*(1 - x)^3). - _Bruno Berselli_, Oct 15 2014
%F A248825 Sum_{n>=1} 1/a(n) = Pi^2/24 + tanh(Pi/sqrt(2))*Pi/(4*sqrt(2)). - _Amiram Eldar_, Aug 21 2022
%t A248825 Table[n^2 + 1 - (-1)^n, {n, 0, 60}] (* _Vincenzo Librandi_, Oct 16 2014 *)
%t A248825 LinearRecurrence[{2,0,-2,1},{0,3,4,11},60] (* _Harvey P. Dale_, Jun 30 2019 *)
%o A248825 (PARI) vector(100,n,(n-1)^2+1+(-1)^n) \\ _Derek Orr_, Oct 15 2014
%o A248825 (Magma) [n^2+1-(-1)^n: n in [0..60]]; // _Vincenzo Librandi_, Oct 16 2014
%o A248825 (Sage) [n^2+1-(-1)^n for n in (0..60)] # _Bruno Berselli_, Oct 16 2014
%Y A248825 Cf. A000290, A008586, A008602, A010673, A016742, A042963, A056899, A164897, A166519, A168277, A248800.
%K A248825 nonn,easy
%O A248825 0,2
%A A248825 _Paul Curtz_, Oct 15 2014
%E A248825 Edited by _Bruno Berselli_, Oct 16 2014