login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A258137 Absolute first differences of the lexicographically earliest sequence of odd positive integers such that the terms and their absolute first differences are all distinct. 2
2, 4, 6, 8, 10, 12, 18, 14, 16, 28, 20, 22, 36, 24, 26, 48, 30, 32, 60, 34, 38, 68, 40, 42, 78, 44, 46, 86, 50, 52, 100, 54, 56, 108, 58, 62, 114, 66, 64, 70, 72, 140, 74, 76, 146, 80, 82, 156, 84, 88, 170, 90, 92, 180, 94, 96, 188, 98, 102, 194, 104, 106, 208 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
All terms are even.
LINKS
E. Angelini, Derangements on the SeqFan list, May 21 2015
FORMULA
a(n) = abs(A258136(n+1)-A258136(n)).
a(n) = 2*abs(A099004(n)).
MAPLE
b:= proc() false end:
g:= proc(n) option remember; local k;
if n=1 then b(1):= true; 1
else g(n-1); for k while b(k) or
b(abs(g(n-1)-k)) by 2 do od;
b(k), b(abs(g(n-1)-k)):= true$2; k
fi
end:
a:= n-> abs(g(n+1)-g(n)):
seq(a(n), n=1..101);
MATHEMATICA
b[_] = False;
g[n_] := g[n] = Module[{k},
If[n == 1, b[1] = True; 1,
g[n-1]; For[k = 1, b[k] ||
b[Abs[g[n-1] - k]], k += 2];
{b[k], b[Abs[g[n-1] - k]]} = {True, True}; k]];
a[n_] := Abs[g[n+1] - g[n]];
Table[a[n], {n, 1, 101}] (* Jean-François Alcover, Aug 01 2021, after Alois P. Heinz *)
CROSSREFS
Absolute first differences of A258136.
Sequence in context: A320674 A022483 A100180 * A101814 A034090 A146344
KEYWORD
nonn
AUTHOR
Eric Angelini and Alois P. Heinz, May 21 2015
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 15:20 EDT 2024. Contains 371916 sequences. (Running on oeis4.)