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-3 of 3 results.

A051884 Smallest number larger than the previous term which is not a prime but is relatively prime to the previous term.

Original entry on oeis.org

1, 4, 9, 10, 21, 22, 25, 26, 27, 28, 33, 34, 35, 36, 49, 50, 51, 52, 55, 56, 57, 58, 63, 64, 65, 66, 85, 86, 87, 88, 91, 92, 93, 94, 95, 96, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 143, 144, 145, 146, 147, 148, 153, 154, 155, 156, 161, 162, 169
Offset: 1

Views

Author

Felice Russo, Dec 15 1999

Keywords

Crossrefs

Sequences with related definitions: A072525, A085084, A126638, A131368, A163643.
Cf. A002808.

Programs

  • Haskell
    a051884 n = a051884_list !! (n-1)
    a051884_list =  1 : f 1 a002808_list where
       f x cs = y : f y (dropWhile (<= y) cs) where
         y = head [z | z <- cs, x `gcd` z == 1]
    -- Reinhard Zumkeller, Jun 03 2013
  • Maple
    with(numtheory); i:=4; k:=5; while(k < 100) do while(order(k, i) = FAIL or isprime(k)) do k:=k+1; end do; print(k); i:= k; k:=k+1; end do; # Ben Paul Thurston, Feb 08 2007
  • 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,5!}];lst (* Vladimir Joseph Stephan Orlovsky, May 15 2010 *)
    nxt[n_]:=Module[{k=n+1},While[PrimeQ[k]||!CoprimeQ[k,n],k++];k]; NestList[ nxt,1,60] (* Harvey P. Dale, Mar 12 2013 *)

Extensions

More terms from James Sellers, Dec 16 1999
Definition corrected by Franklin T. Adams-Watters, Sep 19 2006

A075570 Lexicographically earliest sequence of distinct composite numbers such that a(k) + a(k+1) is prime for all k.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Sep 25 2002

Keywords

Comments

Index of composite values: {1, 4, 3, 8, 7, 17, 5, 12, 9, 15, 2, 23, 6, 33, 10, 38, 14, 46, 20, 26, 11, 21, 16, 30, ...}. - Michael De Vlieger, Jul 18 2017

Crossrefs

Programs

  • Mathematica
    a = {4}; Do[k = 2 - Boole@ EvenQ@ n; While[Nand[! MemberQ[a, k], CompositeQ@ k, PrimeQ[a[[n - 1]] + k]], k += 2]; AppendTo[a, k], {n, 2, 69}]; a (* Michael De Vlieger, Jul 18 2017 *)

Extensions

More terms from David Wasserman, Jan 20 2005
Definition clarified by Peter Munn, Jul 20 2017

A262159 a(1) = 1, for n > 1 the least composite number k > a(n-1) such that a(n-1) + k is also a composite number.

Original entry on oeis.org

1, 8, 10, 12, 14, 16, 18, 20, 22, 24, 25, 26, 28, 30, 32, 33, 35, 39, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 63, 65, 68, 70, 72, 74, 76, 77, 78, 80, 81, 84, 85, 86, 88, 90, 92, 93, 94, 95, 99, 102, 104, 105, 108, 110, 111, 114, 116, 118, 119, 121, 122, 123, 124, 125, 128, 130, 132, 133, 134
Offset: 1

Views

Author

Gionata Neri, Sep 13 2015

Keywords

Comments

For n > 2, a(n) - a(n-1) <= 4.

Examples

			The first composite number is 4, but 1 + 4 = 5, which is prime, and also 1 + 6 = 7 also prime. Since 1 + 8 = 9 = 3^2, a(2) = 8.
After 8, 9 is also composite but 8 + 9 = 17, which is prime. But 10 works: 8 + 10 = 18 = 2 * 3^2, hence a(3) = 10.
		

Crossrefs

Cf. A072525 (similar but with prime sums).

Programs

  • Maple
    m:= 0:
    for n from 1 to 100 do
      for k from m+1 while isprime(k) or isprime(m+k) do od:
      a[n]:= k;
      m:= k;
    od:
    seq(a[i],i=1..100); # Robert Israel, Sep 20 2015
  • Mathematica
    a = {1}; Do[k = a[[n - 1]] + 1; While[Nand[CompositeQ@ k, CompositeQ[a[[n - 1]] + k]], k++]; AppendTo[a, k], {n, 2, 72}]; a (* Michael De Vlieger, Sep 17 2015 *)
  • PARI
    lista(nn) = {print1(a = 1, ", "); for(n=1, nn, forcomposite(k=a+1,, if (!isprime(a+k), print1(k, ", "); a = k; break);););} \\ Michel Marcus, Sep 20 2015

Extensions

a(51)-a(70) from Michael De Vlieger, Sep 17 2015
Showing 1-3 of 3 results.