login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A081145 a(1)=1; thereafter, a(n) is the least positive integer which has not already occurred and is such that |a(n)-a(n-1)| is different from any |a(k)-a(k-1)| which has already occurred. 13
1, 2, 4, 7, 3, 8, 14, 5, 12, 20, 6, 16, 27, 9, 21, 34, 10, 25, 41, 11, 28, 47, 13, 33, 54, 15, 37, 60, 17, 42, 68, 18, 45, 73, 19, 48, 79, 22, 55, 23, 58, 94, 24, 61, 99, 26, 66, 107, 29, 71, 115, 30, 75, 121, 31, 78, 126, 32, 81, 132, 35, 87, 140, 36, 91, 147, 38, 96, 155, 39 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

COMMENTS

The sequence is a permutation of the positive integers. The inverse is A081146.

Similar to A100707, except that when we subtract we use the largest possible k.

The 1977 paper of Slater and Velez proves that this sequence is a permutation of positive integers and conjectures that its absolute difference sequence (A099004) is also a permutation. If we call this the "Slater-Velez permutation of the first kind", then they also constructed another permutation (the 2nd kind), for which they are able to prove that both the sequence (A129198) and its absolute difference (A129199) are true permutations. - Ferenc Adorjan, Apr 03 2007

LINKS

Ferenc Adorjan, Table of n,a(n) for n=1,5000

P. J. Slater and W. Y. Velez, Permutations of the Positive Integers with Restrictions on the Sequence of Differences, Pacific Journal of Mathematics, Vol. 71, No. 1, 1977

Index entries for sequences that are permutations of the natural numbers

EXAMPLE

a(4)=7 because the previous term is 4 and the differences |3-4|, |5-4| and |6-4| have already occurred.

After 7 we get 3 as the difference 4 has not occurred earlier. 5 follows 14 as the difference 9 has not occurred earlier.

MATHEMATICA

f[s_] := Block[{d = Abs[Rest@s - Most@s], k = 1}, While[ MemberQ[d, Abs[k - Last@s]] || MemberQ[s, k], k++ ]; Append[s, k]]; NestList[s, {1}, 70] (from Robert G. Wilson v (rgwv(at)rgwv.com), Jun 09 2006)

f[s_] := Block[{k = 1, d = Abs[Most@s - Rest@s], l = Last@s}, While[MemberQ[s, k] || MemberQ[d, Abs[l - k]], k++ ]; Append[s, k]]; Nest[f, {1}, 70] (from Robert G. Wilson v (rgwv(at)rgwv.com), Jun 13 2006)

PROG

(PARI){SV_p1(n)=local(x, v=6, d=2, j, k); /* Slater-Velez permutation - the first kind (by F. Adorjan)*/ x=vector(n); x[1]=1; x[2]=2; for(i=3, n, j=3; k=1; while(k, if(k=bittest(v, j)||bittest(d, abs(j-x[i-1])), j++, v+=2^j; d+=2^abs(j-x[i-1]); x[i]=j))); return(x)} - Ferenc Adorjan, Apr 03 2007

CROSSREFS

The sequence of differences is A099004.

Similar to Murthy's sequence A093903, Cald's sequence (A006509) and Recaman's sequence A005132. See also A081145, A100707 (another version).

Cf. A063733 A072007 A078783 A081146 A084331 A084335, A117622.

Sequence in context: A137282 A139696 A084332 * A100707 A078943 A063733

Adjacent sequences:  A081142 A081143 A081144 * A081146 A081147 A081148

KEYWORD

nonn

AUTHOR

Don Reble (djr(AT)nk.ca), Mar 08 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 16 16:00 EST 2012. Contains 205938 sequences.