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-10 of 13 results. Next

A112988 Position of n-th prime in A089088.

Original entry on oeis.org

2, 5, 9, 12, 19, 23, 30, 34, 41, 52, 55, 65, 73, 77, 85, 95, 105, 110, 121, 128, 133, 143, 151, 162, 175, 182, 187, 195, 200, 208, 231, 239, 249, 253, 271, 276, 286, 298, 306, 318, 328, 332, 350, 354, 362, 366, 387, 408, 416, 420, 427, 439, 443, 461, 472, 483
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 08 2005

Keywords

Comments

A089088(a(n)) = A000040(n).

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a112988 = (+ 1) . fromJust . (`elemIndex` a089088_list) . a000040
    -- Reinhard Zumkeller, Feb 27 2013

A112990 Inverse of A089088.

Original entry on oeis.org

1, 2, 5, 3, 9, 4, 12, 6, 7, 8, 19, 10, 23, 11, 13, 14, 30, 15, 34, 16, 17, 18, 41, 20, 21, 22, 24, 25, 52, 26, 55, 27, 28, 29, 31, 32, 65, 33, 35, 36, 73, 37, 77, 38, 39, 40, 85, 42, 43, 44, 45, 46, 95, 47, 48, 49, 50, 51, 105, 53, 110, 54, 56, 57, 58, 59, 121, 60, 61, 62, 128
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 08 2005

Keywords

Crossrefs

Cf. A112978.

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a112990 = (+ 1) . fromJust . (`elemIndex` a089088_list)
    -- Reinhard Zumkeller, Feb 27 2013

A373938 Number of k in the range s(1), ..., s(n-1) such that gcd(k, s(n)) > 1, where s = A089088.

Original entry on oeis.org

0, 0, 1, 2, 1, 3, 2, 4, 1, 7, 6, 1, 6, 7, 11, 11, 8, 10, 1, 15, 4, 12, 1, 8, 15, 21, 15, 12, 16, 1, 10, 23, 18, 1, 14, 23, 29, 23, 20, 22, 1, 31, 6, 29, 18, 27, 35, 14, 31, 20, 28, 1, 43, 30, 1, 26, 31, 16, 45, 35, 24, 45, 47, 36, 1, 34, 39, 16, 53, 47, 26, 40, 1, 59, 20, 42, 1, 30, 47, 65, 18
Offset: 0

Views

Author

Scott R. Shannon, Jun 23 2024

Keywords

Comments

In the terms studied a(n) = 1 if s(n) is 4 or a prime.

Examples

			a(5) = 5 as A089088(5) = 8 and 8 shares a factor m > 1 with three previous terms, A089088(1) = 2, A089088(2) = 4, and A089088(3) = 6.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; s[0] = 1; s[1] = p = 2; s[2] = i = 4; s[3] = j = 6;
    Do[If[PrimeQ[j/2],
        k = Prime[p++],
        k = If[PrimeQ[j], i, j] + 1; While[PrimeQ[k], k++]];
      Set[{s[n], i, j}, {k, j, k}], {n, 4, nn}];
    s = Array[s, nn];
    {0}~Join~Table[Function[{m, w}, Count[w, _?(! CoprimeQ[#, m[[1]]] &)]] @@
    TakeDrop[#, -1] &@  s[[;; n]], {n, nn}] (* Michael De Vlieger, Jun 23 2024 *)

A337136 a(1) = 1, a(2) = 2; for n > 1, a(n) = smallest positive number which has not yet appeared which has a common factor with a(n-2) + a(n-1).

Original entry on oeis.org

1, 2, 3, 5, 4, 6, 8, 7, 9, 10, 19, 29, 12, 41, 53, 14, 67, 15, 16, 31, 47, 13, 18, 62, 20, 22, 21, 43, 24, 134, 26, 25, 17, 27, 11, 28, 30, 32, 34, 33, 201, 36, 39, 35, 37, 38, 40, 42, 44, 46, 45, 49, 48, 97, 50, 51, 101, 52, 54, 56, 55, 57, 58, 23, 60, 83, 65
Offset: 1

Views

Author

Scott R. Shannon, Aug 18 2020

Keywords

Comments

Conjecture: This is a permutation of the natural numbers. Up to 1 million terms the only fixed points are 1,2,3,6,9,10, and it is likely that there are no others.

Examples

			a(5) = 4 as a(3) + a(4) = 3 + 5 = 8, and 4 is the smallest number that shares a common factor with 8 that has not yet appeared.
a(11) = 19 as a(9) + a(10) = 9 + 10 = 19, and as 19 is prime, a(11) must be the smallest multiple of 19 that has not yet appeared, being 19 in this case.
		

Crossrefs

Programs

  • Mathematica
    nn = 120;
    c[_] := False;
    Array[Set[{a[#], c[#]}, {#, True}] &, 2]; Set[{i, j, u},
     Range[3]]; s = i + j;
    Do[k = u;
     While[Or[c[k], CoprimeQ[s, k]], k++];
     Set[{a[n], c[k], i, j, s}, {k, True, j, k, j + k}];
     If[k == u, While[c[u], u++]], {n, 3, nn}];
    Array[a, nn] (* Michael De Vlieger, Oct 26 2023 *)
  • PARI
    lista(nn) = v=[1, 2]; for(n=3, nn, t=1; while(prod(X=1, n-1, v[X]-t)==0 || gcd(v[n-2]+v[n-1], t)==1, t++); v=concat(v, t); ); v; \\ Yifan Xie, May 18 2023

A251622 a(1) = 1; a(2) = 2; for n > 2, a(n) = smallest number not already used which shares a factor with a(n-1) or a(n-2).

Original entry on oeis.org

1, 2, 4, 6, 3, 8, 9, 10, 5, 12, 14, 7, 16, 18, 15, 20, 21, 22, 11, 24, 26, 13, 28, 30, 25, 27, 33, 36, 32, 34, 17, 38, 19, 40, 35, 42, 39, 44, 45, 46, 23, 48, 50, 51, 52, 54, 56, 49, 58, 29, 60, 55, 57, 63, 66, 62, 31, 64, 68, 70, 65, 72, 69, 74, 37, 76, 78, 75, 80
Offset: 1

Views

Author

Keywords

Comments

This appears certainly to be a permutation of the positive integers.
I believe the arguments we used to show that the EKG sequence (A064413) is a permutation of the natural numbers apply here with almost no change. - N. J. A. Sloane, Jan 02 2015
For n > 2: gcd(a(n),a(n-1)*a(n-2)) > 1. - Reinhard Zumkeller, Apr 05 2015

Crossrefs

Cf. A256628 (conjectured inverse).

Programs

  • Haskell
    a251622 n = a251622_list !! (n-1)
    a251622_list = 1 : 2 : f 1 2 [3..] where
       f u v xs = g xs where
         g (w:ws) = if gcd w u > 1 || gcd w v > 1
                       then w : f v w (delete w xs) else g ws
    -- Reinhard Zumkeller, Apr 05 2015
  • Mathematica
    a[1] = 1; a[2] = 2;
    a[n_] := a[n] = For[k = 1, True, k++, If[FreeQ[Array[a, n-1], k], If[!CoprimeQ[k, a[n-1]] || !CoprimeQ[k, a[n-2]], Return[k]]]];
    Array[a, 100] (* Jean-François Alcover, Sep 05 2018 *)
  • PARI
    invecn(v,k,x)=for(i=1,k,if(v[i]==x,return(i)));0
    alist(n)=local(v=vector(n),x);v[1]=1;v[2]=2;for(k=3,n,x=3;while(invecn(v,k-1,x)||(gcd(v[k-1],x)==1&&gcd(v[k-2],x)==1),x++);v[k]=x);v
    

A351001 a(0) = 0, a(1) = 1; for n > 1, a(n) is the smallest positive number which has not appeared which has a common factor with a(n-2) + a(n-1) but does not equal a(n-2) + a(n-1).

Original entry on oeis.org

0, 1, 2, 6, 4, 5, 3, 10, 26, 8, 12, 14, 13, 9, 11, 15, 16, 62, 18, 20, 19, 21, 22, 86, 24, 25, 7, 28, 30, 29, 118, 27, 35, 31, 32, 33, 39, 34, 146, 36, 38, 37, 40, 42, 41, 166, 23, 45, 17, 44, 122, 46, 48, 47, 50, 194, 52, 51, 206, 514, 54, 56, 55, 57, 49, 53, 58, 60, 59, 63, 61, 64
Offset: 0

Views

Author

Scott R. Shannon, Jan 28 2022

Keywords

Comments

This is a permutation of the natural numbers. Up to 500000 terms the fixed points are 0, 1, 2, 4, 5, 15, 16, 18, 21, 22, 24, 25, 29, and it is likely no more exist.

Examples

			a(3) = 6 as a(1)+a(2) = 3, 6 does not equal 3, and gcd(3,6) > 1.
a(4) = 4 as a(2)+a(3) = 8, 4 does not equal 8, and gcd(8,4) > 1.
		

Crossrefs

Programs

A112975 Lexicographically earliest permutation of the natural numbers such that each term has a common divisor with at least two earlier terms, a(n)=n for n<4.

Original entry on oeis.org

1, 2, 3, 6, 4, 8, 9, 10, 12, 14, 15, 5, 16, 18, 20, 21, 7, 22, 24, 25, 26, 27, 28, 30, 32, 33, 11, 34, 35, 36, 38, 39, 13, 40, 42, 44, 45, 46, 48, 49, 50, 51, 17, 52, 54, 55, 56, 57, 19, 58, 60, 62, 63, 64, 65, 66, 68, 69, 23, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 08 2005

Keywords

Comments

Inverse: A112978; A112977(n) = a(a(n));
For n>3: n is prime iff a(n) < a(n-1); a(A112976(n)) = A000040(n).
For n>8, a(n) can be described as follows: all composite numbers in natural order, with primes inserted so that every prime p immediately follows 3p. - Ivan Neretin, Apr 26 2015

Crossrefs

Cf. A089088.

A373998 a(1) = 1, a(2) = 2, a(3) = 3, a(4) = 5; for n > 4, a(n) is the smallest unused positive number that is coprime to a(n-1) and a(n-2) but has a common factor with at least one of a(1)...a(n-3).

Original entry on oeis.org

1, 2, 3, 5, 4, 9, 25, 8, 21, 55, 16, 7, 11, 6, 35, 121, 12, 49, 65, 18, 77, 13, 10, 27, 91, 20, 33, 119, 26, 15, 17, 14, 39, 85, 22, 57, 115, 28, 19, 23, 24, 95, 143, 32, 45, 133, 34, 69, 125, 38, 51, 145, 44, 63, 29, 40, 81, 161, 50, 87, 169, 46, 75, 187, 52, 93, 175, 58, 31, 99, 56, 155
Offset: 1

Views

Author

Scott R. Shannon, Jun 24 2024

Keywords

Comments

For the terms studied, and similar to A373390 and A089088, the terms are concentrated along distinct lines of different gradient, four in this sequence, and like those sequences, the lowermost line is composed only of primes.
Note that in A089088, A373390, and this sequence, a(n) is coprime to zero, one and two previous terms, and the corresponding sequence terms are concentrated along two, three and four lines respectively.
The fixed points are 1, 2, 3, 8, 45, 51, and it is likely no more exist. For the terms studied the primes appear in their natural order. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(7) = 25 as 25 is the smallest unused number that is coprime to a(5) = 4 and a(6) = 9 while sharing a factor with a(4) = 5.
		

Crossrefs

Programs

  • Python
    from math import gcd, lcm
    from itertools import count, islice
    def agen(): # generator of terms
        alst = [1, 2, 3, 5]
        yield from alst
        aset, LCM, mink = set(alst), lcm(*alst[:-2]), 4
        while True:
            an = next(k for k in count(mink) if k not in aset and 1 == gcd(k, alst[-1]) == gcd(k, alst[-2]) and gcd(k, LCM) > 1)
            LCM = lcm(LCM, alst[-2])
            alst.append(an)
            aset.add(an)
            while mink in aset: mink += 1
            yield an
    print(list(islice(agen(), 72))) # Michael S. Branicky, Jun 24 2024

A350927 a(1)=1, a(2)=2; for n > 2, a(n) is the smallest unused positive number such that gcd(a(n-1) * |a(n-1) - a(n-2)|, a(n)) > 1.

Original entry on oeis.org

1, 2, 4, 6, 3, 9, 8, 10, 5, 15, 12, 14, 7, 21, 16, 18, 20, 22, 11, 33, 24, 26, 13, 39, 27, 28, 30, 25, 35, 32, 34, 17, 51, 36, 38, 19, 57, 40, 42, 44, 46, 23, 69, 45, 48, 50, 52, 54, 56, 49, 63, 58, 29, 87, 60, 55, 65, 62, 31, 93, 64, 66, 68, 70, 72, 74, 37, 111, 75, 76, 78, 80, 82, 41, 123, 81
Offset: 1

Views

Author

Scott R. Shannon, Jan 28 2022

Keywords

Comments

This is likely a permutation of the natural numbers. The sequence shows similar behavior to the EKG sequence A064413. In the first 500000 terms the fixed points are 1, 2, 77, 221, and it is likely no more exist.

Examples

			a(4) = 6 as a(3)*|a(3)-a(2)| = 4*2 = 8, 6 has not been used and gcd(6,8) > 1.
a(8) = 10 as a(7)*|a(7)-a(6)| = 8*1 = 8, 10 has not been used and gcd(10,8) > 1.
		

Crossrefs

A373999 a(1) = 1, a(2) = 2, a(3) = 3, a(4) = 5, a(5) = 7; for n > 5, a(n) is the smallest unused positive number that is coprime to a(n-1), a(n-2) and a(n-3) but has a common factor with at least one of a(1)...a(n-4).

Original entry on oeis.org

1, 2, 3, 5, 7, 4, 9, 25, 49, 8, 27, 55, 91, 16, 51, 11, 13, 10, 17, 21, 121, 20, 169, 57, 77, 32, 65, 19, 33, 14, 85, 247, 69, 22, 35, 221, 23, 6, 95, 119, 143, 12, 115, 133, 187, 18, 125, 161, 209, 24, 145, 217, 253, 26, 15, 29, 31, 28, 39, 185, 289, 38, 63, 37, 155, 34, 81, 203, 205, 44
Offset: 1

Views

Author

Scott R. Shannon, Jun 24 2024

Keywords

Comments

Initially the terms agree with the observation noted in A373998 and are concentrated predominantly along five lines of different gradient, with the primes forming the lowermost line. However this pattern is disrupted by the second lowest line showing a repetitive discontinuous jump to lower values which also interrupts the third middle line. An examination of the terms shows this is due to the appearance of three consecutive terms which are not divisible by 2 or 3. This allows subsequent terms to be a low multiple of 2 and 3, forming numbers which are less than the most recently appearing prime values. Also of note is after approximately 85000 terms the upper two lines merge; it is assumed that the remaining four lines continue in the above pattern as n grows arbitrarily large, although this is unknown.
Other than the first three terms the fixed points in the first 100000 terms are 35, 63, 219, 231, 1407, 2967, 3003, 6555, 14007, 14031, 32103, 77343, although it is likely more exist. For the terms studied the primes appear in their natural order. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(9) = 49 as 49 is the smallest unused number that is coprime to a(6) = 4, a(7) = 9, and a(8) = 25, while sharing a factor with a(5) = 7.
		

Crossrefs

Programs

  • Python
    from math import gcd, lcm
    from itertools import count, islice
    def agen(): # generator of terms
        alst = [1, 2, 3, 5, 7]
        yield from alst
        aset, LCM, mink = set(alst), lcm(*alst[:-3]), 4
        while True:
            an = next(k for k in count(mink) if k not in aset and all(1 == gcd(k, m) for m in alst[-3:]) and gcd(k, LCM) > 1)
            LCM = lcm(LCM, alst[-3])
            alst.append(an)
            aset.add(an)
            while mink in aset: mink += 1
            yield an
    print(list(islice(agen(), 70))) # Michael S. Branicky, Jun 24 2024
Showing 1-10 of 13 results. Next