The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A080096 a(1)=a(2)=1; a(3)=2; a(n)=abs(a(n-1)-a(n-2)-a(n-3)). 7
1, 1, 2, 0, 3, 1, 2, 2, 1, 3, 0, 4, 1, 3, 2, 2, 3, 1, 4, 0, 5, 1, 4, 2, 3, 3, 2, 4, 1, 5, 0, 6, 1, 5, 2, 4, 3, 3, 4, 2, 5, 1, 6, 0, 7, 1, 6, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 7, 0, 8, 1, 7, 2, 6, 3, 5, 4, 4, 5, 3, 6, 2, 7, 1, 8, 0, 9, 1, 8, 2, 7, 3, 6, 4, 5, 5, 4, 6, 3, 7, 2, 8, 1, 9, 0, 10, 1, 9, 2, 8, 3, 7, 4, 6, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
For n>=3 Max( a(k) : 1<=k<=n ) = floor ( sqrt(n+4)).
Special cases: a(n^2+4*n-1)=0; a(n^2-4)=n
Also a( A028557(n))= a(A028557(n+1)); sum(k=(n-1)^2, n^2, a(k)) = n^2
MATHEMATICA
nxt[{a_, b_, c_}]:={b, c, Abs[c-b-a]}; NestList[nxt, {1, 1, 2}, 110][[All, 1]] (* Harvey P. Dale, Nov 14 2021 *)
PROG
(PARI) a(n)=local(k, m); if(n<1, 0, k=sqrtint(n+4); m=n+4-k^2; if(m%2, m\2+1, k-m\2))
(Haskell)
a080096 n = a080096_list !! (n-1)
a080096_list = 1 : 1 : 2 : zipWith3 (\u v w -> abs (w - v - u))
a080096_list (tail a080096_list) (drop 2 a080096_list)
-- Reinhard Zumkeller, Oct 11 2014
CROSSREFS
Cf. A028347.
Sequence in context: A218585 A279507 A054656 * A322978 A294142 A068915
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Jan 28 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 22 15:18 EDT 2024. Contains 372758 sequences. (Running on oeis4.)