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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A251756 a(0) = 0; for n>0, a(n) is the smallest integer not already in the list with a composite common factor with a(n-1). 2
0, 4, 8, 12, 6, 18, 9, 27, 36, 16, 20, 10, 30, 15, 45, 54, 24, 28, 14, 42, 21, 63, 72, 32, 40, 44, 22, 66, 33, 99, 81, 90, 48, 52, 26, 78, 39, 117, 108, 56, 60, 50, 25, 75, 100, 64, 68, 34, 102, 51, 153, 126, 70, 35, 105, 84, 76, 38, 114, 57, 171, 135, 120, 80 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

It appears that this sequence includes every composite number.

The values are grouped close to five lines extending from the origin with respective slope of approximately { 0.608, 0.912, 1.22, 1.82, 2.74 } = {1, 1.5, 2, 3, 4.5} * 0.608. (As in A098550 these lines are not really straight.) - M. F. Hasler, Dec 14 2014

LINKS

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

David L. Applegate, Hans Havermann, Bob Selcoe, Vladimir Shevelev, N. J. A. Sloane, and Reinhard Zumkeller, The Yellowstone Permutation, arXiv preprint arXiv:1501.01669, 2015.

MATHEMATICA

g[a_List] := Block[{k = 4}, While[Not[CompositeQ[GCD[a[[-1]], k]]] || MemberQ[a, k], k++]; Append[a, k]]; Nest[g, {0}, 63] (* L. Edson Jeffery, Dec 08 2014 (after Robert G. Wilson v) *)

PROG

(PARI) invecn(v, k, x)=for(i=1, k, if(v[i]==x, return(i))); 0

alist(n)=local(v=vector(n), x, g); v[1]=4; for(k=2, n, x=4; while(invecn(v, k-1, x)||(g=gcd(v[k-1], x))==1||isprime(g), x++); v[k]=x); v

(Haskell)

import Data.List (delete)

a251756 n = a251756_list !! (n-1)

a251756_list = 0 : f 0 a002808_list where

   f x zs = g zs where

     g (y:ys) | d == 1 || a010051' d == 1 = g ys

              | otherwise = y : f y (delete y zs)

              where d = gcd x y

-- Reinhard Zumkeller, Dec 08 2014

(Python)

from gmpy2 import gcd, is_prime

A251756_list, l, s, b = [0], 0, 1, {}

for _ in range(10**3):

....i = s

....while True:

........if not i in b:

............m = gcd(i, l)

............if not (m == 1 or is_prime(m)):

................A251756_list.append(i)

................l, b[i] = i, True

................while s in b:

....................b.pop(s)

....................s += 1

................break

........i += 1 # Chai Wah Wu, Dec 08 2014

CROSSREFS

Cf. A064413, A002808, A010051, A098550.

Sequence in context: A196267 A004469 A196268 * A158457 A072905 A086481

Adjacent sequences:  A251753 A251754 A251755 * A251757 A251758 A251759

KEYWORD

nonn

AUTHOR

Franklin T. Adams-Watters, Dec 08 2014

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 April 23 18:45 EDT 2017. Contains 285329 sequences.