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.

A251558 a(n) = smallest odd number not in {A098550(1), A098550(2), ..., A098550(n)} which is neither a prime nor a term of A251542.

Original entry on oeis.org

9, 9, 9, 9, 15, 15, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27, 27, 33, 33, 33, 33, 33, 45, 45, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 57, 57, 57, 57, 57, 57, 57, 69, 69, 75, 75, 75, 75, 75, 75, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 105, 105, 105
Offset: 1

Views

Author

N. J. A. Sloane, Dec 23 2014

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (delete); import Data.List.Ordered (minus)
    a251558 n = a251558_list !! (n-1)
    a251558_list = 9 : 9 : 9 : f 2 3 [4..] (tail a014076_list) where
       f u v ws zs = g ws where
         g (x:xs) = if gcd x u > 1 && gcd x v == 1
                       then y : f v x (delete x ws) ys else g xs
                    where ys@(y:_) = zs `minus` [x]
    -- Reinhard Zumkeller, Mar 11 2015
  • Mathematica
    terms = 70; max = 2 terms;
    f[lst_] := Block[{k = 4}, While[GCD[lst[[-2]], k] == 1 || GCD[lst[[-1]], k] > 1 || MemberQ[lst, k], k++]; Append[lst, k]];
    A098550 = Nest[f, {1, 2, 3}, max-3];
    sel = Select[Transpose[{Range[max], A098550}], PrimeQ[#[[2]]]&][[All,1]]+2;
    A251542 = A098550[[sel]]/A098550[[sel-2]] ;
    a[n_] := For[k = 1, k <= max, k = k+2, If[CompositeQ[k] && FreeQ[A098550[[1 ;; n]], k] && FreeQ[A251542, k], Return[k]]];
    Table[a[n], {n, 1, terms}] (* Jean-François Alcover, Dec 06 2018, after Robert G. Wilson v in A098550 *)