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.

A215036 2 followed by "1,0" repeated.

This page as a plain text file.
%I A215036 #30 Aug 23 2024 04:02:21
%S A215036 2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
%T A215036 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
%U A215036 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1
%N A215036 2 followed by "1,0" repeated.
%C A215036 Take the first n primes and combine them with coefficients +1 and -1; then a(n) is the smallest number (in absolute value) that can be obtained.
%C A215036 For example, a(1) = 2, a(2) = 1 from 3-2 = 1; a(3) = 0 from -2-3+5 = 0; a(11) = 0 from 2-3-5-7+11-13+17+19-23-29+31 = 0.
%C A215036 Comment from _Franklin T. Adams-Watters_, Aug 05 2012: Sketch of proof that the above sum of primes results in this sequence. If S_n is the set of possible values of the signed sums for the first n primes, then S_{n+1} = S_n U (S_n + prime(n+1)) U (S_n - prime(n+1)). Beyond about n=4, this will be everything even or everything odd in an interval around zero, and then a fringe on either side; the size of the interval will be 2 * A007504(n) - k for some small k. Recursively, since prime(n) << A007504(n), this will continue to hold. Hence the sequence continues to alternate 0's and 1's.  A quite modest estimate on the distribution of primes suffices to complete the proof.
%C A215036 For number of solutions see A022894, A113040; also A083309.
%H A215036 StackExchange, <a href="http://math.stackexchange.com/questions/176394/a-prime-number-pattern">A prime number pattern</a>, Jul 29 2012.
%H A215036 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,1).
%t A215036 PadRight[{2},120,{0,1}] (* _Harvey P. Dale_, Nov 29 2018 *)
%o A215036 (PARI) if(n%2,2*(n<2),1) \\ _Charles R Greathouse IV_, Aug 06 2012
%Y A215036 Cf. A007504, A214912, A215029, A215030; A022894, A083309, A113040.
%Y A215036 Essentially the same as A135528, A059841, A000035.
%K A215036 nonn,easy
%O A215036 1,1
%A A215036 _N. J. A. Sloane_, Aug 06 2012