login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A035214
2 followed by a run of n 1's.
5
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, 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, 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
OFFSET
0,1
LINKS
Mohammad K. Azarian, Remarks and Conjectures Regarding Combinatorics of Discrete Partial Functions, Int'l Math. Forum (2022) Vol. 17, No. 3, 129-141. See Conjecture 4.5, p. 137.
FORMULA
a(n) = 2 if n is a triangular number, otherwise 1.
Equals A010054(n) + 1.
a(n) = floor((3-cos(Pi*sqrt(8*n+1)))/2). - Carl R. White, Mar 18 2006
MATHEMATICA
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 *)
PROG
(PARI) for(n=0, 100, print1(floor((3-cos(Pi*sqrt(8*n+1)))/2), ", ")) \\ G. C. Greubel, May 14 2017
(PARI) a(n) = issquare(n<<3 + 1) + 1; \\ Kevin Ryde, Aug 03 2022
CROSSREFS
KEYWORD
nonn,easy
EXTENSIONS
Typo corrected by Neven Juric, Jan 10 2009
STATUS
approved