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.

Showing 1-6 of 6 results.

A085084 Smallest number not yet used which is not a prime but is relatively prime to the previous term.

Original entry on oeis.org

1, 4, 9, 8, 15, 14, 25, 6, 35, 12, 49, 10, 21, 16, 27, 20, 33, 26, 45, 22, 39, 28, 51, 32, 55, 18, 65, 24, 77, 30, 91, 34, 57, 40, 63, 38, 69, 44, 75, 46, 81, 50, 87, 52, 85, 36, 95, 42, 115, 48, 119, 54, 121, 56, 93, 58, 99, 62, 105, 64, 111, 68, 117, 70, 123, 74, 125, 66
Offset: 1

Views

Author

Amarnath Murthy, Jul 02 2003

Keywords

Comments

Every composite number appears in this sequence. Eventually, every p^2 (p prime) will appear; if the smallest unused composite does not follow, it will appear no later than following the next p^2.

Crossrefs

Sequences with related definitions: A051884, A064413, A075570, A163642, A240024.
Cf. A000027.

Programs

  • Haskell
    import Data.List (find, delete)
    import Data.Maybe (fromJust)
    a085084 n = a085084_list !! (n-1)
    a085084_list = 1 : f 1 a002808_list where
       f x cs = y : f y (delete y cs) where
                y = fromJust $ find ((== 1) . (gcd x)) cs
    -- Reinhard Zumkeller, Dec 01 2012
  • Maple
    # Corrected Maple program from Chen Zekai, Mar 23 2015, added by N. J. A. Sloane, Mar 23 2015
    A085084 := proc (q) local a, b, i, n;if q = 1 then print(1); return;elif q = 2 then print(1); print(4); return;fi;a := {1, 4}; b := 4; i := 2; print(1); print(4);while i < q do for n from 6 to q^2 doif not isprime(n) and gcd(b, n) = 1 and {} = a intersect {n} thenb := n; a := a union {n}; i := i+1; print(n);break;fi; od; od; end:A085084(10000):
  • Mathematica
    A085084 = {a[1]=1, a[2]=4}; a[n_] := a[n] = Catch[For[k = 6, True, k++, If[!PrimeQ[k] && !MemberQ[A085084, k] && CoprimeQ[a[n-1], k], AppendTo[A085084, k]; Throw[k]]]]; Table[ a[n], {n, 1, 68}] (* Jean-François Alcover, Jul 17 2012 *)

Extensions

Corrected and extended by Vladeta Jovovic, Jul 05 2003
Additional comments from Franklin T. Adams-Watters, Sep 19 2006
Edited by N. J. A. Sloane, Jul 03 2008 at the suggestion of R. J. Mathar

A163643 a(0)=1. For n >= 1, a(n) is the smallest composite integer that is > a(n-1) and that is coprime to n.

Original entry on oeis.org

1, 4, 9, 10, 15, 16, 25, 26, 27, 28, 33, 34, 35, 36, 39, 44, 45, 46, 49, 50, 51, 52, 57, 58, 65, 66, 69, 70, 75, 76, 77, 78, 81, 82, 87, 88, 91, 92, 93, 94, 99, 100, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 133, 134, 135, 136, 141, 142, 143, 144, 145
Offset: 0

Views

Author

Leroy Quet, Aug 02 2009

Keywords

Crossrefs

Programs

  • Maple
    A163643 := proc(n) if n = 0 then 1; else for a from procname(n-1)+1 do if not isprime(a) then if gcd(a,n) = 1 then return a; end if; end if; end do: end if; end proc: seq(A163643(n),n=0..100) ; # R. J. Mathar, Oct 09 2010
  • Mathematica
    a = {4}; Do[k = a[[n]] + 1; While[Nand[CompositeQ@ k, ! MemberQ[a, k], CoprimeQ[k, n + 1]], k++]; AppendTo[a, k], {n, 61}]; {1}~Join~a (* Michael De Vlieger, Jul 23 2017 *)

Extensions

More terms from R. J. Mathar, Oct 09 2010

A072525 a(0) = 1; a(n+1) is smallest composite number > a(n) such that a(n) + a(n+1) is prime.

Original entry on oeis.org

1, 4, 9, 10, 21, 22, 25, 28, 33, 34, 39, 40, 49, 52, 55, 58, 69, 70, 81, 82, 85, 88, 91, 100, 111, 112, 115, 118, 121, 130, 133, 136, 141, 142, 165, 166, 171, 176, 177, 182, 185, 188, 195, 202, 207, 212, 219, 220, 237, 242, 245, 246, 253, 256, 265, 276, 287, 290
Offset: 0

Views

Author

Amarnath Murthy, Jul 31 2002

Keywords

Comments

The value of a(0) is of minor importance; starting with a(0) = 2, 3, 4, 5, ... results in sequences that differ from this sequence only in a few initial terms.
22, 25, 28 are three and 49,52,55,58 are four consecutive terms in arithmetic progression. Are there k consecutive terms in arithmetic progression for every k?

Examples

			34 is the next term after 33 since 34 is composite and 33 + 34 = 67 is prime.
		

Crossrefs

Programs

  • Mathematica
    a=4;lst={a};Do[b=a+1;While[ !PrimeQ[a+b]&&PrimeQ[b],b++ ];AppendTo[lst,b];a=b,{n,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Feb 07 2010 *)
  • PARI
    {print1(a=1,","); while(a<290,b=a+1; while(isprime(b)||!isprime(a+b),b++); print1(b,","); a=b)}

Extensions

Edited and extended by Klaus Brockhaus, Aug 01 2002

A126638 a(n) is larger than a(n-1), not prime and coprime to a(n-1) and a(n-2).

Original entry on oeis.org

4, 9, 25, 26, 27, 35, 38, 39, 49, 50, 51, 77, 80, 81, 91, 92, 93, 95, 98, 99, 115, 116, 117, 119, 121, 122, 123, 125, 128, 129, 133, 134, 135, 143, 146, 147, 155, 158, 159, 161, 164, 165, 169, 172, 175, 177, 178, 185, 187, 188, 189, 205, 206, 207, 209, 212, 213
Offset: 1

Views

Author

Ben Paul Thurston, Feb 08 2007

Keywords

Examples

			a(7) = 38 because it is the next composite number larger than 35 (a(6)) that shares no factors in common with 35 and 27 (a(5)).
		

Crossrefs

Cf. A051884.

Programs

  • Maple
    with(numtheory); i:=4; j:=9; k:=10; while(k < 100) do while(order(k, i) = FAIL or order(k,j) = FAIL or isprime(k)) do k:=k+1; end do; print(k); i:= j; j:=k; k:=k+1; end do;
  • Mathematica
    f[l_List] := Block[{k = l[[ -1]] + 1},While[PrimeQ[k] || GCD[k, l[[ -1]]*l[[ -2]]] > 1, k++ ];Append[l, k]];Nest[f, {4, 9}, 56] (* Ray Chandler, Feb 14 2007 *)
    nxt[{a_,b_}]:=Module[{k=b+1},While[PrimeQ[k]||!CoprimeQ[a,k] || !CoprimeQ[ b,k],k++];{b,k}]; NestList[nxt,{4,9},60][[All,1]] (* Harvey P. Dale, Aug 31 2021 *)

Extensions

Extended by Ray Chandler, Feb 14 2007

A131368 Coprime semiprimes: a(n-1) and a(n) are the closest coprime semiprimes.

Original entry on oeis.org

4, 9, 10, 21, 22, 25, 26, 33, 34, 35, 38, 39, 46, 49, 51, 55, 57, 58, 65, 69, 74, 77, 82, 85, 86, 87, 91, 93, 94, 95, 106, 111, 115, 118, 119, 121, 122, 123, 133, 134, 141, 142, 143, 145, 146, 155, 158, 159, 161, 166, 169, 177, 178, 183, 185, 187, 194, 201, 202, 203
Offset: 1

Views

Author

Zak Seidov, Sep 30 2007

Keywords

Comments

The slowest increasing sequence of semiprimes with coprime neighbor terms.

Crossrefs

Subsequence of A001358 (semiprimes).

Programs

  • Maple
    A[1]:= 4: t:= 4: count:= 1:
    for x from 5 while count < 100 do
      if igcd(x, t) = 1 then
        if numtheory:-bigomega(x)=2 then
          count:= count+1;
          A[count]:= x;
          t:= x;
        fi
      fi
    od:
    seq(A[i], i=1..100); # Robert Israel, Jun 11 2023
  • PARI
    lista(nn) = {my(vsp = select((x->(bigomega(x) == 2)), vector(nn, k, k)), i = 1, last); while (i <= #vsp, print1(vsp[i], ", "); last = vsp[i]; while(gcd(vsp[i], last) != 1, i++; if (i>#vsp, break)););} \\ Michel Marcus, Jun 25 2019

Formula

gcd(a(n-1), a(n)) = 1.

A177949 First string of 43 consecutive composite numbers.

Original entry on oeis.org

15684, 15685, 15686, 15687, 15688, 15689, 15690, 15691, 15692, 15693, 15694, 15695, 15696, 15697, 15698, 15699, 15700, 15701, 15702, 15703, 15704, 15705, 15706, 15707, 15708, 15709, 15710, 15711, 15712, 15713, 15714, 15715, 15716, 15717, 15718, 15719, 15720, 15721, 15722, 15723, 15724, 15725, 15726
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    P:= select(isprime, [seq(i,i=3..20000,2)]):
    G:= P[2..-1]-P[1..-2]:
    i0:= ListTools:-SelectFirst(j -> G[j]>=42, [$1..nops(G)]):
    $ P[i0]+1 .. P[i0]+43; # Robert Israel, Jul 05 2017
  • Mathematica
    rPrimeNext[n_]:=Module[{k},k=n+1;While[PrimeQ[k]||GCD[n,k]!=1,k++ ];k]; a=1;lst={a};Do[AppendTo[lst,a=rPrimeNext[a]],{n,0,2*7!}];lst1=lst; q=41;lst={};Do[If[lst1[[n+q]]-lst1[[n]]==q,AppendTo[lst,lst1[[n]]]],{n,0,Length[lst1]-q}];lst; a=FromDigits[lst];Table[n,{n,a,a+q}]

Extensions

Edited by Robert Israel, Jul 05 2017
Showing 1-6 of 6 results.