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.

A128218 First differences of A128217.

Original entry on oeis.org

1, 3, 1, 3, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

John W. Layman, Feb 19 2007

Keywords

Comments

a(A130883(n-1)) = 2*n-1 and a(m) != 2*n-1 for m < A130883(n-1). - Reinhard Zumkeller, Jun 20 2015

Crossrefs

Cf. A128127.
Cf. A130883, A152271 (run lengths after initial term).

Programs

  • Haskell
    a128218 n = a128218_list !! (n-1)
    a128218_list = zipWith (-) (tail a128217_list) a128217_list
    -- Reinhard Zumkeller, Jun 20 2015
    
  • Mathematica
    nsrQ[n_]:=Module[{sr=Sqrt[n]},Abs[First[sr-Nearest[{Floor[sr], Ceiling[ sr]}, sr]]]<1/4];Differences[Select[Range[0,250],nsrQ]] (* Harvey P. Dale, May 02 2012 *)
  • PARI
    default(realprecision, 10000);
    is_A128217(n) = ((abs(sqrt(n)-sqrtint(n))<(1/4)) || (abs(sqrt(n)-(1+sqrtint(n)))<(1/4)));
    k=0; n=0; prevm=0; while(k<20000, n++; if(is_A128217(n), k++; write("b128218.txt", k, " ", (n-prevm)); prevm = n)); \\ Antti Karttunen, Jan 16 2025

Formula

Let A(1)={1}. Then, for k=2,3,4,..., form A(k) by appending to A(k-1) the term k-1 followed by k-1 1's, if k is even, or by appending to A(k-1) the term k followed by k-1 1's, if k is odd. {a(n)} appears to be the limit of {A(k)} as k->infinity.

Extensions

Offset changed by Reinhard Zumkeller, Jun 20 2015