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.

Previous Showing 101-110 of 127 results. Next

A337903 a(0) = 0, a(1) = 1; for n>1, if a(n-1) is composite then a(n) = a(n-1)/A107286(n-1), where A107286(n) = the smallest prime factor of n, otherwise a(n) = a(n-1) + n.

Original entry on oeis.org

0, 1, 3, 6, 3, 8, 4, 2, 10, 5, 15, 5, 17, 30, 15, 5, 21, 7, 25, 5, 25, 5, 27, 9, 3, 28, 14, 7, 35, 7, 37, 68, 34, 17, 51, 17, 53, 90, 45, 15, 5, 46, 23, 66, 33, 11, 57, 19, 67, 116, 58, 29, 81, 27, 9, 3, 59, 116, 58, 29, 89, 150, 75, 25, 5, 70, 35, 7, 75, 25, 5, 76, 38, 19, 93, 31, 107, 184, 92
Offset: 0

Views

Author

Scott R. Shannon, Sep 29 2020

Keywords

Comments

The sequence can only increase for two consecutive terms at most as if a(n) is even then a(n+1) will be a(n)/2, while if a(n) is odd and a(n+1) is prime then a(n+2) will be even and thus a(n+3) = a(n+2)/2.
For the first 100 million terms the lowest number not to have appeared is 888. It is likely all numbers eventually appear although this is unknown.

Examples

			a(3) = 6 as a(2) = 3 which is prime thus a(3) = 3 + 3 = 6.
a(4) = 3 as a(3) = 6 which has the smallest divisor 2 thus a(4) = 6/2 = 3.
a(11) = 5 as a(10) = 15 which has the smallest divisor 3 thus a(11) = 15/3 = 5.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 0;  a[1] = 1; a[n_] := a[n] = If[CompositeQ[a[n - 1]], a[n - 1]/FactorInteger[a[n - 1]][[1, 1]], a[n - 1] + n]; Array[a, 100, 0] (* Amiram Eldar, Sep 30 2020 *)

A338061 Trajectory of 3 under repeated application of the map x -> A338059(x).

Original entry on oeis.org

3, 4, 6, 9, 25, 22, 21, 18, 55, 36, 32, 63, 93, 215, 266, 210, 249, 351, 438, 364, 314, 405, 537, 458, 400, 346, 426, 362, 447, 386, 370, 525, 669, 588, 956, 938, 1263, 1617, 1528, 1398, 1795, 2301, 2230, 2118, 2737, 2660, 3385, 3328, 4235, 5295
Offset: 1

Views

Author

N. J. A. Sloane, Oct 18 2020

Keywords

Comments

It is not known if this sequence cycles (that is, if it returns to 3).

Crossrefs

A339192 a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) - n if a(n) is nonnegative, not already in the sequence, and gcd(a(n-1),n) > 1 or gcd(a(n-2),n) > 1. Otherwise a(n) = a(n-1) + n.

Original entry on oeis.org

0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 64, 40, 15, 41, 14, 42, 71, 101, 132, 100, 67, 33, 68, 32, 69, 31, 70, 30, 71, 29, 72, 28, 73, 27, 74, 26, 75, 125, 176, 124, 177, 123, 178, 122, 179, 121, 180, 120, 181, 119, 56, 120, 55, 121, 188, 256, 325, 255
Offset: 0

Views

Author

Scott R. Shannon, Dec 07 2020

Keywords

Comments

This sequence is a variation of the Recamán sequence A005132 where the same rules apply except an additional restriction is added whereby a(n) = a(n-1) - n can occur only if gcd(a(n-1),n) > 1 or gcd(a(n-2),n) > 1, where gcd is the greatest common divisor. This additional restriction is inspired by the selection rules of A336957 and A098550.
Initially the sequence terms show a similar pattern to the Recamán sequence. However after about 1.5 million terms they begin to predominantly oscillate between two or a small number of values and the pattern of arching lines is no longer present. See the linked images.
It is unclear if all values are eventually visited; numerous small values like 4 and 5 have not occurred after 50 million terms.

Examples

			a(4) = 2. As gcd(a(3),4) = gcd(6,4) = 2 > 1, and as 6 - 4 = 2 has not occurred previously, a(4) = 2.
a(23) = 64. a(22) = 41, and 41 - 23 = 18 has not occurred previously. However as gcd(41,23) = 1 and gcd(a(21),23) = gcd(63,23) = 1, both additional criteria for subtraction fail, thus a(23) = a(22) + 23 = 41 + 23 = 64. This is the first term that differs from the standard Recamán sequence A005132.
a(57) = 179. a(56) = 122, and 122 - 57 = 65 has not occurred previously. However as gcd(122,57) = 1 and gcd(a(55),57) = gcd(178,57) = 1, both additional criteria for subtraction fail, thus a(57) = a(56) + 57 = 122 + 57 = 179. This is the first term where n is a composite, less than the last term, and a(n-1) - n is available, but due to the gcd requirements the next term is forced to be a(n-1) + n.
		

Crossrefs

A339316 a(1) = 2; for n > 1, a(n) = smallest composite number not occurring earlier which does not share a factor with a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Nov 30 2020

Keywords

Comments

The sequence excludes primes as otherwise the terms would simply be all the ordered integers >= 2. The terms appear to cluster around two lines; the lower line is a(n) ~ n while the upper lines starts with a gradient of approximately 2 and then slowly flattens. It is possible this gradient approaches 1 as n->infinity.

Examples

			a(2) = 9, as a(1) = 2 thus a(2) cannot contain 2 as a factor and cannot be a prime. The lowest unused composite matching these criteria is 9.
a(3) = 4, as a(2) = 9 and thus a(3) cannot contain 3 as a factor and cannot be a prime. The lowest unused composite matching these criteria is 4.
a(4) = 15, as a(3) = 4 and thus a(4) cannot contain 2 as a factor and cannot be a prime. The lowest unused composite matching these criteria is 15.
		

Crossrefs

Programs

  • PARI
    isok(k, fprec, v) = {if (!isprime(k) && #select(x->(x==k), v) == 0, #setintersect(Set(factor(k)[,1]), fprec) == 0;);}
    lista(nn) = {my(va= vector(nn)); va[1] = 2; for (n=2, nn, my(k=2, fprec = Set(factor(va[n-1])[,1])); while (! isok(k, fprec, va), k++); va[n] = k;); va;} \\ Michel Marcus, Nov 30 2020
    
  • Python
    from sympy import isprime, primefactors as pf
    def aupton(terms):
      alst, aset = [2], {2}
      for n in range(2, terms+1):
        m, prevpf = 4, set(pf(alst[-1]))
        while m in aset or isprime(m) or set(pf(m)) & prevpf != set(): m += 1
        alst.append(m); aset.add(m)
      return alst
    print(aupton(72)) # Michael S. Branicky, Feb 09 2021

A343927 a(1) = 1, a(2) = 2; for n>2, a(n) is the smallest positive integer not yet in the sequence which shares a digit with a(n-1) but not with a(n-2), and where a(n) contains at least one digit not in a(n-1).

Original entry on oeis.org

1, 2, 20, 10, 13, 23, 24, 14, 15, 25, 26, 16, 17, 27, 28, 18, 19, 29, 32, 30, 40, 41, 12, 52, 35, 31, 21, 42, 34, 36, 56, 45, 43, 37, 57, 50, 60, 46, 47, 70, 80, 38, 39, 49, 48, 58, 51, 61, 62, 72, 71, 81, 68, 63, 53, 54, 64, 67, 73, 83, 82, 92, 59, 65, 76, 74, 84, 85, 75, 79, 69, 86, 78, 97, 90
Offset: 1

Views

Author

Scott R. Shannon, May 17 2021

Keywords

Comments

This is the digit sequence equivalent of the Enots Wolley sequence A336957. Like that sequence to avoid the sequence halting rapidly an additional rule is placed on a(n) - it must have as least one digit not in a(n-1). This implies a(n) cannot be a repdigit as otherwise a(n+1) would not exist. If this rule is removed then the sequence terminates after five terms: 1, 2, 20, 10, 11. The next term then does not exist as it must both contain and not contain the digit 1.
The sequence is probably infinite as any a(n) must contain at least two distinct digits, thus a(n+2) can have at most eight distinct digits. This implies that a(n+3) can always be created using a digit in a(n+2) and a digit not in a(n+2). However the behavior of the sequence as n gets very large is unknown.

Examples

			a(3) = 20 as this is the smallest unused positive integer that contains a digit in a(2) = 2 while not containing any digit in a(1) = 1.
a(4) = 10 as this is the smallest unused positive integer that contains a digit in a(3) = 20 while not containing any digit in a(2) = 2.
a(5) = 13 as this is the smallest unused positive integer that contains a digit in a(3) = 10, contains a digit not in a(3), while not containing any digit in a(3) = 20.
		

Crossrefs

A347404 a(1) = 3; for n > 2, a(n) is the smallest distinct positive integer such that gcd(a(n), a(n-k)) > 1 for each divisor k of a(n) such that k < n.

Original entry on oeis.org

3, 6, 9, 12, 15, 18, 10, 2, 14, 4, 22, 8, 24, 16, 20, 28, 26, 30, 34, 32, 36, 40, 5, 50, 60, 38, 42, 44, 46, 48, 54, 52, 58, 56, 62, 64, 66, 68, 70, 72, 74, 78, 39, 90, 57, 21, 51, 69, 84, 87, 33, 27, 96, 81, 63, 7, 126, 45, 168, 99, 93, 75, 95, 19, 114, 105, 77, 198, 153, 165, 11, 132, 55, 595
Offset: 1

Views

Author

Scott R. Shannon, Aug 30 2021

Keywords

Comments

The majority of terms are concentrated along a line whose slope is approximately 1.3. Occasionally though there are terms which correspond to the smallest unused number up to that point, and these tend to lead to a subsequent very large term. For example a(499) = 628, a(500) = 682, a(501) = 31, a(502) = 14322. Other large terms appear seemingly at random, for example a(15449) = 19880, a(15450) = 19099, a(15451) = 74962230.
It is likely all numbers > 1 eventually appear. The smallest number not seen after 20000 terms is 89.
Note that if the sequence starts with 2 then the terms are just all the increasing even numbers.

Examples

			a(2) = 6. As a(1) = 3 the next term must be a multiple of 3, and the smallest unused such number is 6. Note that as a(2-2), a(2-3) and a(2-6) are not defined these are ignored.
a(7) = 10. As a(6) = 18 the next term must have 2 and/or 3 as divisors. If it has 2 as a divisor is must also have 3 and/or 5 as a divisor as a(8-2) = a(6) = 15. The smallest unused number satisfying these is 10. Note that as 5 is a divisor of 10 it must be that a(7-5) = a(2) = 6 has 2 or 5 as a divisor, which is true.
a(8) = 2. As a(7) = 10 the next term must have 2 and/or 5 as a divisor. As a(6) = 18 also has 2 as a divisor a(8) = 2 is the next smallest unused term.
		

Crossrefs

Programs

A349491 a(1)=1, a(2)=4; for n > 2, a(n) is the smallest unused positive number such that gcd(a(n-1)*n,a(n)) > 1, where a(n) != a(n-1) and a(n) != n.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Nov 19 2021

Keywords

Comments

This sequence shows similar behavior to the EKG sequence A064413. See the linked image.

Examples

			a(3) = 2 as a(2)*3 = 6, 2!=4, 2!=3, 2 is unused and gcd(6,2) > 1.
a(4) = 6 as a(3)*4 = 8, 6!=2, 6!=4, 6 is unused and gcd(8,6) > 1.
		

Crossrefs

Programs

  • Python
    from math import gcd
    terms, appears = [1], {}
    for n in range(2, 100):
        t = 2
        while not(appears.get(t) is None and gcd(terms[-1]*n, t)>1 and t!=terms[-1] and t!=n):
            t += 1
        appears[t] = True; terms.append(t);
    print(terms) # Gleb Ivanov, Nov 20 2021

A349984 Lexicographically earliest infinite sequence of distinct positive numbers such that, for n > 2, a(n) shares a prime factor with a(n-1) that a(n-1) does not share with a(n-2).

Original entry on oeis.org

1, 2, 6, 15, 10, 12, 21, 14, 18, 33, 22, 20, 35, 28, 24, 39, 26, 30, 51, 34, 36, 45, 40, 38, 57, 42, 44, 55, 50, 46, 69, 48, 52, 65, 60, 56, 63, 54, 58, 87, 66, 62, 93, 72, 68, 85, 70, 74, 111, 75, 80, 76, 95, 90, 78, 91, 77, 88, 82, 123, 84, 86, 129, 96, 92, 115, 100, 94, 141, 99, 110, 98
Offset: 1

Views

Author

Scott R. Shannon, Jan 08 2022

Keywords

Comments

Similarly to A336957 no term a(n) can be a prime or a prime power as that would make it impossible to find a subsequent term a(n+1) that shared a prime factor with a(n) that a(n) did not share with a(n-1). Likewise each term a(n) must have at least one prime factor not in a(n-1) so that a(n+1) can share a prime factor with a(n) that is not in a(n-1).
At most two consecutive terms can be even, but the number of consecutive odd terms is likely unlimited, although this is unknown. Up to 500000 terms the longest run of consecutive odd terms is ten, the first occurring at a(106376).
For the terms studied it is found that each new prime that occurs in the prime factors that a(n) shares with a(n-1) appears in the natural order of all primes. It is likely this is true for all terms. Likewise for the terms studied the vast majority only share one prime factor with the previous term, although terms sharing multiple primes do occur. The first example is a(55) = 78 which shares prime factors 2 and 3 with a(54) = 90. The first terms to share three prime factors are a(8735) = 9630 and a(8734) = 9930, while the first to share four are a(248153) = 264810 and a(248152) = 265020.
Similar to A337181 the terms are concentrated along lines that have a slight downward curvature. See the first linked image. The lines are distinguished by containing terms with a different least prime factor (lpf) in a similar fashion to A336957. The top line contains those terms with lpf = 3, and then each lower line contains terms whose lpf is the next larger prime. These lines are interspersed with terms with lpf = 2, while the very lowest line contains the majority of terms with a large lpf. Interestingly the terms with lpf = 17 appear to form a line with a much higher concentration of terms than those with an lpf of 11, 13 or 19. See the second linked image.

Examples

			a(4) = 15 as a(3) = 6 shares the prime factor 2 with a(2) = 2, thus a(4) must share the prime factor 3 with a(3) while not having 2 as a factor. The numbers 3 and 9 are prime powers so cannot be chosen, while 12 also has 2 as a factor, thus 15 is the smallest valid number.
a(19) = 51 as a(18) = 30 shares the prime factor 2 with a(17) = 26, while 51 shares the prime factor 3 with a(18) and it does not contain 2 as a factor. Note that 45 would also satisfy this criterion and is available but 45 only has prime factors 3 and 5, both of which it shares with 30, thus choosing 45 would make it impossible to find a(20).
a(55) = 78 as a(54) = 90 shares the prime factor 5 with a(53) = 95, while 78 shares the prime factors 2 and 3 with a(54) and it does not contain 5 as a factor. This is the first time a number is chosen that shares two prime factors with the previous term.
		

Crossrefs

A351691 Lexicographically earliest infinite sequence of distinct positive numbers such that, for n>2, a(n) has a common factor with a(n-1), shares a 1-bit in its binary expansion with a(n-1), has no common factor with a(n-2), and does not share a 1-bit in its binary expansion with a(n-2).

Original entry on oeis.org

1, 2, 6, 21, 161, 736, 66, 15, 145, 464, 68, 527, 155, 80, 96, 33, 143, 26, 48, 165, 65, 338, 14, 133, 209, 88, 10, 35, 273, 24, 40, 295, 531, 144, 136, 1037, 305, 50, 74, 333, 129, 688, 20, 325, 299, 138, 132, 341, 1147, 1184, 384, 261, 551, 608, 72, 141, 517, 770, 18, 57, 589, 1798, 34, 8313
Offset: 1

Views

Author

Scott R. Shannon, May 26 2022

Keywords

Comments

The sequence is similar to A336957 but with the addition restrictions that each new term a(n) must share a 1-bit in its binary expansion with a(n-1), while sharing no 1-bits with the binary expansion of a(n-2). To ensure the sequence is infinite each a(n) must not only have a prime factor not in a(n-1), implying no prime or prime powers can occur (see A336957), it must also have a 1-bit in its binary expansion that is a 0-bit in the binary expansion of a(n-1).

Examples

			a(5) = 161 = 10100001_2 as a(4) = 21 = 10101_2, a(3) = 6 = 110_2, and 161 is the smallest unused number that shares a factor with 21, has a 1-bit in common with 21 in their binary expansions, does not share a factor with 6, has no 1-bit in common with 6 in their binary expansions, has a prime factor not in 21, and has a 1-bit in its binary expansion that is a 0-bit in the binary expansion of 21.
		

Crossrefs

A352199 a(0)=0, a(1)=1, a(2)=2; thereafter, a(n) is smallest number m not yet in the sequence such that the binary expansions of m and a(n-2) have a 1 in common, but the 1's in m are disjoint from the 1's in a(n-1) and a(n-3).

Original entry on oeis.org

0, 1, 2, 5, 10, 4, 8, 20, 9, 6, 33, 18, 32, 14, 96, 3, 48, 7, 16, 11, 80, 12, 64, 13, 66, 17, 34, 21, 40, 65, 42, 68, 24, 69, 26, 36, 130, 37, 74, 49, 72, 52, 136, 19, 128, 22, 160, 15, 192, 23, 224, 25, 288, 27, 100, 129, 260, 131, 28, 35, 76, 161, 84, 162, 88
Offset: 0

Views

Author

N. J. A. Sloane, Mar 26 2022

Keywords

Comments

A set-theory analog of A350359. This has the same relationship to A350359 as A115510 does to the EKG sequence A064413, as A252867 does to the Yellowstone permutation A098550, and as A338833 does to the Enots Wolley sequence A336957.
An equivalent definition in terms of sets: S(0) = {}, S(1) = {1}, S(2) = {1,2}; thereafter S(n) is the smallest set (different from the S(i) already defined) of positive integers such that S(n) meets S(n-2) but is disjoint from S(n-1) and S(n-3).

Examples

			After a(4) = 10 = 1010_2, a(5) = 4 = 100_2, a(6) = 8 = 1000_2, a(7) must have the form ...?010?_2, and the smallest missing number of that form is 20 = 10100_2 = 20.
		

Crossrefs

Programs

  • PARI
    { s=0; for (n=1, #a=vector(65), if (n<=3, a[n]=n-1, for (v=0, oo, if (!bittest(s,v) && bitand(v,a[n-2]) && !bitand(v,bitor(a[n-3],a[n-1])), a[n]=v; break))); s+=2^a[n]; print1(a[n]", ")) } \\ Rémy Sigrist, Mar 27 2022
Previous Showing 101-110 of 127 results. Next