cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

This page as a plain text file.
%I A251756 #30 Oct 18 2024 17:58:19
%S A251756 0,4,8,12,6,18,9,27,36,16,20,10,30,15,45,54,24,28,14,42,21,63,72,32,
%T A251756 40,44,22,66,33,99,81,90,48,52,26,78,39,117,108,56,60,50,25,75,100,64,
%U A251756 68,34,102,51,153,126,70,35,105,84,76,38,114,57,171,135,120,80
%N 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).
%C A251756 It appears that this sequence includes every composite number.
%C A251756 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
%H A251756 Reinhard Zumkeller, <a href="/A251756/b251756.txt">Table of n, a(n) for n = 0..10000</a>
%H A251756 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 and <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Sloane/sloane9.html">J. Int. Seq. 18 (2015) 15.6.7</a>.
%t A251756 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_) *)
%o A251756 (PARI) invecn(v, k, x)=for(i=1, k, if(v[i]==x, return(i))); 0
%o A251756 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
%o A251756 (Haskell)
%o A251756 import Data.List (delete)
%o A251756 a251756 n = a251756_list !! (n-1)
%o A251756 a251756_list = 0 : f 0 a002808_list where
%o A251756    f x zs = g zs where
%o A251756      g (y:ys) | d == 1 || a010051' d == 1 = g ys
%o A251756               | otherwise = y : f y (delete y zs)
%o A251756               where d = gcd x y
%o A251756 -- _Reinhard Zumkeller_, Dec 08 2014
%o A251756 (Python)
%o A251756 from gmpy2 import gcd, is_prime
%o A251756 A251756_list, l, s, b = [0], 0, 1, {}
%o A251756 for _ in range(10**3):
%o A251756     i = s
%o A251756     while True:
%o A251756         if not i in b:
%o A251756             m = gcd(i, l)
%o A251756             if not (m == 1 or is_prime(m)):
%o A251756                 A251756_list.append(i)
%o A251756                 l, b[i] = i, True
%o A251756                 while s in b:
%o A251756                     b.pop(s)
%o A251756                     s += 1
%o A251756                 break
%o A251756         i += 1 # _Chai Wah Wu_, Dec 08 2014
%Y A251756 Cf. A064413, A002808, A010051, A098550.
%K A251756 nonn
%O A251756 0,2
%A A251756 _Franklin T. Adams-Watters_, Dec 08 2014