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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A171884 Lexicographically earliest injective and unbounded sequence a(n) satisfying |a(n+1)-a(n)|=n for all n 2
0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 64, 40, 65, 39, 66, 38, 67, 37, 68, 36, 69, 35, 70, 34, 71, 33, 72, 32, 73, 31, 74, 30, 75, 29, 76, 28, 77, 27, 78, 26, 79, 133, 188, 132, 189, 131, 190, 130, 191, 129, 192, 128, 193, 127, 194 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

The map n -> a(n) is an injective map onto the nonnegative integers, i.e. no two terms are identical.

Appears to not contain numbers from the following sets (grouped intentionally): {4, 5}, {14, 15, 16, 17, 18, 19}, {44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61}, etc. The number of terms in these groups appears to be A008776. - Paul Raff, Mar 15 2010

The first 14 terms appear in the logo OEIS. - Philippe Deléham, Mar 01 2013

It appears that the starting points of the gaps (4, 14, 44, 134, 404, 1214...) are given by A181655(2n) = A198643(n-1), and thus the ending points (5, 19, 61, ...) by A181655(2n)+ A048473(n-1). The first differences have signs (grouped intentionally): +++, -, +++, -+-+-+-+- (5 times "-"), +++, -+...+- (17 times "-"), +++, ... where the number of minus signs is again given by A048473 = A008776-1. - M. F. Hasler, May 09 2013

First differs from A005132 at a(24). - Omar E. Pol, Jul 01 2013

LINKS

Table of n, a(n) for n=1..68.

R. Munafo, Lexicographically earliest injective and unbounded sequence A(n) satisfying |A(n+1)-A(n)|=n for all n

R. Munafo, main-A171884.c(C source code to generate the sequence)

EXAMPLE

We begin with 0, 0+1=1, 1+2=3. 3-3=0 cannot be the next term because 0 is already in the sequence so we go to 3+3=6. The next could be 6-4=2 or 6+4=10 but we choose 2 because it is smaller.

MATHEMATICA

Contribution from Paul Raff, Mar 15 2010: (Start)

A171884[{}, _, _] := {}

A171884[L_List, max_Integer, True] :=

If[Length[L] == max, L,

With[{n = Length[L]},

If[Last[L] - n < 1 || MemberQ[L, Last[L] - n],

If[MemberQ[L, Last[L] + n],

A171884[Drop[L, -1], max, False],

A171884[Append[L, Last[L] + n], max, True]],

A171884[Append[L, Last[L] - n], max, True]]]]

A171884[L_List, max_Integer, False] :=

With[{n = Length[L]},

If[MemberQ[L, Last[L] + n],

A171884[Drop[L, -1], max, False],

A171884[Append[L, Last[L] + n], max, True]]]

A171884[{0}, 200, True]

(End)

CROSSREFS

Cf. A005646, which allows occasional duplicate values. Cf. A118201, in which every value of a(n) and of |a(n+1)-a(n)| occurs exactly once, but does not ensure that the latter is strictly increasing.

Sequence in context: A118201 A274647 A113880 * A226940 A098141 A175458

Adjacent sequences:  A171881 A171882 A171883 * A171885 A171886 A171887

KEYWORD

nonn

AUTHOR

Robert Munafo, Mar 11 2010

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified March 22 20:04 EDT 2017. Contains 283897 sequences.