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

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A064417 a(1) = 1, a(2) = 2, a(3) = 3; for n >3 a(n) = smallest number not already used such that GCD{ a(n), a(n-1) } >= 3. 5
1, 2, 3, 6, 9, 12, 4, 8, 16, 20, 5, 10, 15, 18, 21, 7, 14, 28, 24, 27, 30, 25, 35, 40, 32, 36, 33, 11, 22, 44, 48, 39, 13, 26, 52, 56, 42, 45, 50, 55, 60, 51, 17, 34, 68, 64, 72, 54, 57, 19, 38, 76, 80, 65, 70, 49, 63, 66, 69, 23, 46, 92, 84, 75, 78, 81, 87, 29, 58, 116, 88, 77, 91 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

A permutation of the natural numbers.

REFERENCES

J. C. Lagarias, E. M. Rains and N. J. A. Sloane, Problem 10927, Amer. Math. Monthly, 109 (2002), 202; 111 (No. 2, 2004), 167-168.

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

J. C. Lagarias, E. M. Rains and N. J. A. Sloane, The EKG sequence, Exper. Math. 11 (2002), 437-446.

Index entries for sequences related to EKG sequence

Index entries for sequences that are permutations of the natural numbers

MATHEMATICA

a[n_ /; n <= 3] := n; a[n_] := a[n] = For[aa = Array[a, n-1] // Sort; k = If[n == 4, 4, Complement[Range[aa // Last], aa] // First]; aa = Drop[aa, k-1], True, k++, If[FreeQ[aa, k], If[GCD[k, a[n-1]] >= 3, Return[k]]]]; Table[a[n], {n, 1, 100}] (* Jean-Fran├žois Alcover, Jan 28 2015 *)

PROG

(Haskell)

import Data.List (delete)

a064417 n = a064417_list !! (n-1)

a064417_list = 1 : 2 : 3 : f 3 [4..] where

   f x us = x' : f x' (delete x' us) where

      x' = head [u | u <- us, gcd u x > 2]

-- Reinhard Zumkeller, Nov 13 2011

CROSSREFS

Cf. A064413. A064956 gives inverse permutation.

Sequence in context: A032704 A029805 A082007 * A191981 A131975 A288754

Adjacent sequences:  A064414 A064415 A064416 * A064418 A064419 A064420

KEYWORD

nonn,nice,easy

AUTHOR

Jonathan Ayres (Jonathan.ayres(AT)btinternet.com), Sep 30 2001

EXTENSIONS

More terms from Naohiro Nomoto, Sep 30 2001

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 18 10:53 EST 2019. Contains 319271 sequences. (Running on oeis4.)