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!)
A113966 a(1)=1; for n>1, a(n) is the smallest positive integer not occurring earlier in the sequence such that |a(n)-a(n-1)| does not divide a(n). 5
1, 3, 5, 2, 6, 10, 4, 7, 9, 11, 8, 13, 15, 17, 12, 19, 14, 18, 22, 16, 21, 23, 20, 26, 29, 24, 31, 25, 27, 32, 35, 33, 28, 34, 30, 37, 39, 41, 36, 43, 38, 42, 46, 40, 47, 44, 49, 45, 51, 53, 48, 55, 52, 57, 50, 54, 58, 61, 56, 59, 62, 65, 63, 67, 60, 68, 71, 64, 69, 73, 66, 70 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Sequence is a permutation of the positive integers.
Proof that every number must eventually appear: Suppose not, let k be smallest number that never appears. Then for every a(n-1) > k, we have a(n-1)-k | k, i.e. i(a(n-1)-k) = k for some i with 1 <= i <= k. Therefore a(n-1) <= (k+ik)/k <= k(k+1). So once a(n-1) > k(k+1), we will have a(n) = k, a contradiction. - N. J. A. Sloane, Jan 29 2006
LINKS
EXAMPLE
Among those positive integers not among the first 4 integers of the sequence, a(5) = 6 is the smallest such that |a(5)-a(4)| = |6-2| = 4 does not divide a(5) =6. 4, for example, is not among the first 4 terms of the sequence, but |4-2| = 2 does divide 4. So a(5) is not 4, but is instead 6.
MATHEMATICA
f[l_] := Block[{k=1}, While[MemberQ[l, k] || Mod[k, Abs[k - Last[l]]] == 0, k++ ]; Return[Append[l, k]]; ]; Nest[f, {1}, 100] (* Ray Chandler, Nov 13 2005 *)
PROG
(Haskell)
import Data.List (delete)
a113966 n = a113966_list !! (n-1)
a113966_list = 1 : f [2..] [1] where
f xs ys'@(y:ys) = y' : f (delete y' xs) (y':ys') where
y' = head [z | z <- xs, y `mod` abs (z - y) > 0]
-- Reinhard Zumkeller, Feb 26 2013
CROSSREFS
Cf. A222622 (inverse), A222623 (fixed points).
Sequence in context: A333111 A139584 A064790 * A164611 A316086 A227988
KEYWORD
nonn,nice
AUTHOR
Leroy Quet, Nov 10 2005
EXTENSIONS
Extended by Jim Nastos and Ray Chandler, Nov 13 2005
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 25 10:43 EDT 2024. Contains 371967 sequences. (Running on oeis4.)