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

A139558 a(1)=4. For n>=2, a(n) = smallest integer > a(n-1) that is not coprime to (n+1) but is coprime to n.

Original entry on oeis.org

4, 9, 10, 15, 16, 35, 36, 39, 40, 77, 78, 91, 92, 93, 94, 119, 120, 133, 134, 141, 142, 161, 162, 175, 176, 177, 178, 261, 262, 341, 342, 345, 346, 355, 356, 407, 408, 411, 412, 451, 452, 473, 474, 475, 476, 517, 518, 539, 540, 543, 548, 583, 584, 595, 596, 597
Offset: 1

Views

Author

Leroy Quet, Apr 27 2008

Keywords

Comments

a(10^k): 4, 77, 1717, 46871, 1027767, 34696937, 1068983293, ... and a(2^k): 4, 9, 15, 39, 119, 345, 685, 2415, 5911, 18855, 47995, 124455, 290615, 794529, 2571825, 6910425, 18153749, 50986623, 147584275, 431488203, 1146090309, ..., . - Robert G. Wilson v, May 20 2008
Least term k such that there are just n consecutive terms: 4, 9, 91, 199068, 16621, 14052655, 17301, 6156769, 66781, 330484338, 376051, ???, 273222587, ???, 83335435, ..., . - Robert G. Wilson v, May 20 2008

Crossrefs

Programs

  • Maple
    A139558 := proc(n) option remember ; local a,i; if n = 1 then RETURN(4) ; fi ; for a from A139558(n-1)+1 do if gcd(a,n) = 1 and gcd(a,n+1) <> 1 then RETURN(a) ; fi ; od: a ; end: seq(A139558(n),n=1..100) ; # R. J. Mathar, May 20 2008
  • Mathematica
    f[1] = 4; f[n_] := f[n] = Block[{k = f[n - 1] + 1}, While[ GCD[n + 1, k] == 1 || GCD[n, k] > 1, k++ ]; k]; Array[f, 56] (* Robert G. Wilson v, May 20 2008 *)
    FoldList[SelectFirst[Range[#1 + 1, #1 + 120], Function[k, And[CoprimeQ[k, #2], ! CoprimeQ[k, #2 + 1]]]] &, 4, Range[2, 56]] (* Michael De Vlieger, Oct 22 2017 *)

Extensions

More terms from R. J. Mathar and Robert G. Wilson v, May 20 2008

A163642 a(n) = the smallest composite positive integer that is not yet in the sequence and that is coprime to n.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Aug 02 2009

Keywords

Comments

This sequence is a permutation of the composite positive integers.
Indices of composites: {1, 4, 3, 8, 2, 15, 5, 12, 7, 17, 6, 23, 9, 21, 13, 26, 10, 33, 11, 35, 16, 30, 14, 38, 18, 40, 20, 46, ...}. - Michael De Vlieger, Jul 23 2017
Each composite k occurs in the sequence no later than a(k-1). Proof by induction. - Peter Munn, Sep 01 2017

Crossrefs

Programs

  • Mathematica
    a = {4}; Do[k = 6; While[Nand[CompositeQ@ k, ! MemberQ[a, k], CoprimeQ[k, n]], k++]; AppendTo[a, k], {n, 2, 69}]; a (* Michael De Vlieger, Jul 23 2017 *)

Extensions

More terms from Sean A. Irvine, Nov 11 2009
Showing 1-3 of 3 results.