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.

A035214 2 followed by a run of n 1's.

This page as a plain text file.
%I A035214 #27 Jun 07 2025 14:29:08
%S A035214 2,2,1,2,1,1,2,1,1,1,2,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,
%T A035214 1,1,2,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,
%U A035214 1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1
%N A035214 2 followed by a run of n 1's.
%H A035214 G. C. Greubel, <a href="/A035214/b035214.txt">Table of n, a(n) for n = 0..10000</a>
%H A035214 Mohammad K. Azarian, <a href="https://doi.org/10.12988/imf.2022.912321">Remarks and Conjectures Regarding Combinatorics of Discrete Partial Functions</a>, Int'l Math. Forum (2022) Vol. 17, No. 3, 129-141.  See Conjecture 4.5, p. 137.
%F A035214 a(n) = 2 if n is a triangular number, otherwise 1.
%F A035214 Equals A010054(n) + 1.
%F A035214 a(n) = floor((3-cos(Pi*sqrt(8*n+1)))/2). - _Carl R. White_, Mar 18 2006
%t A035214 Table[(SquaresR[1, 8*n + 1] + 2)/2, {n, 0, 100}] (* or *) Table[Floor[(3 - Cos[Pi*Sqrt[8*n + 1]])/2], {n,0,100}] (* _G. C. Greubel_, May 14 2017 *)
%o A035214 (PARI) for(n=0,100, print1(floor((3-cos(Pi*sqrt(8*n+1)))/2), ", ")) \\ _G. C. Greubel_, May 14 2017
%o A035214 (PARI) a(n) = issquare(n<<3 + 1) + 1; \\ _Kevin Ryde_, Aug 03 2022
%o A035214 (Python)
%o A035214 from sympy.ntheory.primetest import is_square
%o A035214 def A035214(n): return int(is_square((n<<3)|1))+1 # _Chai Wah Wu_, Jun 07 2025
%Y A035214 Cf. A010054, A035253, A035254.
%K A035214 nonn,easy
%O A035214 0,1
%A A035214 _N. J. A. Sloane_
%E A035214 Typo corrected by Neven Juric, Jan 10 2009