Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A064387
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A064387 Variation (2) on Recaman's sequence (A005132): to get a(n), we first try to subtract n from a(n-1): a(n) = a(n-1)-n if positive and not already in the sequence; if not then a(n) = a(n-1)+n+i, where i >= 0 is the smallest number such that a(n-1)+n+i has not already appeared. +0
4
1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 18, 44, 19, 45, 72, 100, 71, 101, 70, 38, 5, 39, 4, 40, 77, 115, 76, 36, 78, 120, 163, 119, 74, 28, 75, 27, 79, 29, 80, 132, 185, 131, 186, 130, 73, 15, 81, 141, 202 (list; graph; listen)
OFFSET

1,2

COMMENT

Variation (4) (A064389) is the nicest of these variations.

I would also like to get the following sequences: number of steps before n appears (or 0 if n never appears), list of numbers that never appear, height of n (cf. A064288, A064289, A064290), etc.

REFERENCES

Suggested by J. C. Lagarias.

LINKS

Index entries for sequences related to Recaman's sequence

Nick Hobson, Python program for this sequence

MAPLE

h := array(1..100000); maxt := 100000; a := array(1..1000); a[1] := 1; h[1] := 1; for nx from 2 to 1000 do t1 := a[nx-1]-nx; if t1>0 and h[t1] <> 1 then a[nx] := t1; if t1 < maxt then h[t1] := 1; fi; else for i from 0 to 1000 do t1 := a[nx-1]+nx+i; if h[t1] <> 1 then a[nx] := t1; if t1 < maxt then h[t1] := 1; fi; break; fi; od; fi; od; evalm(a);

CROSSREFS

Cf. A005132, A046901, A064388, A064389. Agrees with A064389 for first 187 terms, then diverges.

Sequence in context: A076543 A005132 A064388 this_sequence A064389 A118201 A113880

Adjacent sequences: A064384 A064385 A064386 this_sequence A064388 A064389 A064390

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com), Sep 28 2001

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 30 13:13 EST 2009. Contains 167758 sequences.


AT&T Labs Research