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.

Showing 1-2 of 2 results.

A035254 First differences of A035253.

Original entry on oeis.org

-3, -1, 1, 2, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 64
Offset: 0

Views

Author

Robet Bronson (bob(AT)bronsons.com)

Keywords

Crossrefs

Different from A030124. Cf. A002024, A014132, A014133. First differences are in A035214.

Programs

  • Python
    from math import isqrt
    def A035254(n): return n+(isqrt(n<<3)-5>>1) # Chai Wah Wu, Jun 07 2025

Formula

a(n) = A002024(n)+n-3. - Chai Wah Wu, Jun 07 2025

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

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • 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 *)
  • 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
    
  • Python
    from sympy.ntheory.primetest import is_square
    def A035214(n): return int(is_square((n<<3)|1))+1 # Chai Wah Wu, Jun 07 2025

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

Extensions

Typo corrected by Neven Juric, Jan 10 2009
Showing 1-2 of 2 results.