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.

A296063 a(n) is the smallest number (in absolute value) not yet in the sequence such that the arithmetic mean of the first n terms a(1), a(2), ..., a(n) is an integer. Preference is given to positive values of a(n); a(1)=1; 0 not allowed.

This page as a plain text file.
%I A296063 #21 Mar 14 2020 15:25:31
%S A296063 1,-1,3,-3,5,-5,7,-7,9,-9,11,-11,13,-13,15,-15,17,-17,19,-19,21,-21,
%T A296063 23,-23,25,-25,27,-27,29,-29,31,-31,33,-33,35,-35,37,-37,39,-39,41,
%U A296063 -41,43,-43,45,-45,47,-47,49,-49,51,-51
%N A296063 a(n) is the smallest number (in absolute value) not yet in the sequence such that the arithmetic mean of the first n terms a(1), a(2), ..., a(n) is an integer. Preference is given to positive values of a(n); a(1)=1; 0 not allowed.
%H A296063 Colin Barker, <a href="/A296063/b296063.txt">Table of n, a(n) for n = 1..1000</a>
%H A296063 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-1,1,1).
%F A296063 a(n) = (-1)^(n+1)*A109613(n+1). - _Michel Marcus_, Dec 05 2017
%F A296063 From _Colin Barker_, Mar 14 2020: (Start)
%F A296063 G.f.: x*(1 + x^2) / ((1 - x)*(1 + x)^2).
%F A296063 a(n) = -a(n-1) + a(n-2) + a(n-3) for n>3.
%F A296063 (End)
%t A296063 Array[(2 Floor[(# + 1)/2] - 1) (2 Boole@ OddQ@ # - 1) &, 52] (* or *)
%t A296063 Nest[Append[#, Block[{k = 1, s = 1}, While[Nand[FreeQ[#, s k], IntegerQ@ Mean[Append[#, s k]]], If[s == 1, s = -1, k++; s = 1]]; s k]] &, {1}, 51] (* _Michael De Vlieger_, Dec 12 2017 *)
%o A296063 (PARI) Vec(x*(1 + x^2) / ((1 - x)*(1 + x)^2) + O(x^50)) \\ _Colin Barker_, Mar 14 2020
%Y A296063 Cf. A193356 (partial sums), A059841 (a(n)/n), A109613.
%K A296063 sign
%O A296063 1,3
%A A296063 _Enrique Navarrete_, Dec 04 2017