Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A118907
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A118907 a(0) = 1; a(n) = |a(n-1) - n| if n is has already appeared in the sequence, otherwise a(n) = a(n-1) + n. +0
2
1, 0, 2, 5, 9, 4, 10, 17, 25, 16, 6, 17, 29, 42, 56, 71, 55, 38, 56, 75, 95, 116, 138, 161, 185, 160, 186, 213, 241, 212, 242, 273, 305, 338, 372, 407, 443, 480, 442, 481, 521, 562, 520, 563, 607, 652, 698, 745, 793, 842, 892, 943, 995, 1048, 1102, 1047, 991 (list; graph; listen)
OFFSET

0,3

MAPLE

a[0]:=1: S:={1}: for n from 1 to 65 do if member(n, S)=true 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..65); - 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}, 66] (*Chandler*)

CROSSREFS

Cf. A118906, A005132.

Sequence in context: A111761 A021798 A065226 this_sequence A065225 A018878 A021389

Adjacent sequences: A118904 A118905 A118906 this_sequence A118908 A118909 A118910

KEYWORD

easy,nonn

AUTHOR

Leroy Quet (qq-quet(AT)mindspring.com), 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 18 20:14 EST 2008. Contains 147244 sequences.


AT&T Labs Research