Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A118906
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A118906 a(0) = 1; a(n) = |a(n-1) - n| if n is not one of the earlier terms of the sequence, otherwise a(n) = a(n-1) + n. +0
2
1, 2, 4, 1, 5, 10, 4, 3, 5, 4, 14, 3, 9, 4, 18, 3, 13, 4, 22, 3, 17, 4, 26, 3, 21, 4, 30, 3, 25, 4, 34, 3, 29, 4, 38, 3, 33, 4, 42, 3, 37, 4, 46, 3, 41, 4, 50, 3, 45, 4, 54, 3, 49, 4, 58, 3, 53, 4, 62, 3, 57, 4, 66, 3, 61, 4, 70, 3, 65, 4, 74, 3, 69, 4, 78, 3, 73, 4, 82, 3, 77, 4, 86, 3, 81, 4 (list; graph; listen)
OFFSET

0,2

LINKS

Leroy Quet, Home Page (listed in lieu of email address)

MAPLE

a[0]:=1: S:={1}: for n from 1 to 100 do if member(n, S)=false then a[n]:=abs(a[n-1]-n): S:=S union {a[n]} else a[n]:=a[n-1]+n: S:=S union {a[n]} fi od: seq(a[n], n=0..100); - Emeric Deutsch (deutsch(AT)duke.poly.edu), May 07 2006

MATHEMATICA

f[s_] := Block[{n, }, n = Length[s]; Return[Append[s, Abs[Last[s] + If[MemberQ[s, n], +n, -n]]]]; ]; Nest[f, {1}, 100] (*Chandler*)

CROSSREFS

Cf. A118907, A005132.

Sequence in context: A070937 A059573 A080427 this_sequence A085059 A124037 A090285

Adjacent sequences: A118903 A118904 A118905 this_sequence A118907 A118908 A118909

KEYWORD

easy,nonn

AUTHOR

Leroy Quet May 05 2006

EXTENSIONS

Extended by Ray Chandler (rayjchandler(AT)sbcglobal.net) and Emeric Deutsch (deutsch(AT)duke.poly.edu), May 06 2006

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 24 23:16 EST 2009. Contains 167481 sequences.


AT&T Labs Research