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

A336760 a(0) = 0; for n > 0, a(n) = a(n-1) - tau(n) if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + tau(n), where tau(n) is the number of divisors of n.

Original entry on oeis.org

0, 1, 3, 5, 2, 4, 8, 6, 10, 7, 11, 9, 15, 13, 17, 21, 16, 14, 20, 18, 12, 16, 20, 22, 30, 27, 23, 19, 25, 27, 35, 33, 39, 43, 47, 51, 42, 40, 36, 32, 24, 26, 34, 36, 42, 48, 44, 46, 56, 53, 59, 55, 49, 51, 59, 63, 71, 67, 71, 69, 57, 59, 63, 69, 62, 58, 50, 52, 58, 54, 62, 60, 72, 70, 66, 72
Offset: 0

Views

Author

Scott R. Shannon, Aug 03 2020

Keywords

Comments

This sequences uses the same rules as Recamán's sequence A005132 except that, instead of adding or subtracting n each term, the number of divisors of n is used. See A000005.
For the first 10 million terms the smallest value not appearing is 28. The data indicate that a(n)/n approaches 1 as n goes to infinity. As tau(n) <= 2*sqrt(n) (see A046522), it implies that 28 and other small unvisited values will never be visited.
In the same range the maximum value is a(9998226) = 10987569, and 2202001 terms repeat a previously visited value, the first time this occurs is a(21) = a(16) = 16. The longest run of consecutive increasing terms is 30, starting at a(1115610) = 1217112, while the longest run of consecutive decreasing terms is 534, starting at a(9960335) = 10946233.

Examples

			a(2) = 3. As 2 has two divisors, a(2) = a(1) + 2 = 1 + 2 = 3.
a(4) = 2. As 4 has three divisors, and as 2 has not been previously visited and is nonnegative, a(4) = a(3) - 3 = 5 - 3 = 2.
		

Crossrefs

A340612 a(0) = 0; for n > 0, if n appears in the sequence then a(n) = lastindex(n), where lastindex(n) is the index of the last appearance of n. Otherwise a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n.

Original entry on oeis.org

0, 1, 3, 2, 6, 11, 4, 11, 19, 10, 9, 7, 19, 32, 18, 33, 17, 16, 14, 12, 32, 53, 31, 8, 32, 57, 83, 56, 28, 57, 27, 22, 24, 15, 49, 84, 48, 85, 47, 86, 46, 5, 47, 90, 134, 89, 40, 42, 36, 34, 84, 135, 187, 21, 75, 20, 27, 29, 87, 146, 206, 145, 207, 144, 80, 145, 79, 146, 78, 147, 77, 148, 76, 149
Offset: 0

Views

Author

Scott R. Shannon, Jan 13 2021

Keywords

Comments

This sequences uses the same rules as Recamán's sequence A005132 if the value of n itself has not previously appeared in the sequence. However if n has previously appeared then a(n) = lastindex(n), where lastindex(n) is the sequence index of the last appearance of n.
The terms appear to be clustered in bands which are themselves composed of thinner bands. No values appear outside these groupings. See the linked image.
The smallest value not to have appeared after 1 million terms is 13. It is unknown if all terms eventually appear.

Examples

			a(3) = 2, as a(2) = 3 = n, thus a(3) = 2.
a(5) = 11, as 5 has not previously appeared in the sequence, but 1 has, a(5) = a(4) + 5 = 6 + 5 = 11.
a(11) = 7, as a(7) = 11 = n, thus a(11) = 7.
		

Crossrefs

Programs

  • Python
    def aupton(nn):
      alst, index = [0], {0: 0} # data list, map of last occurrence
      for n in range(1, nn+1):
        if n in index:
          an = index[n]
        else:
          an = alst[-1] - n
          if an < 0 or an in index:
            an = alst[-1] + n
        alst.append(an)
        index[an] = n
      return alst
    print(aupton(65)) # Michael S. Branicky, Jan 13 2021

A340593 a(0) = 0; for n > 0, if n appears in the sequence then a(n) = a(n-1) - lastindex(n) if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + lastindex(n), where lastindex(n) is the index of the last appearance of n. Otherwise a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n.

Original entry on oeis.org

0, 1, 3, 5, 9, 6, 11, 4, 12, 8, 18, 24, 16, 29, 15, 29, 17, 33, 23, 42, 22, 43, 63, 45, 34, 59, 85, 58, 30, 45, 73, 104, 72, 55, 31, 66, 102, 65, 27, 66, 26, 67, 48, 69, 25, 54, 100, 53, 95, 46, 96, 147, 199, 152, 107, 74, 130, 187, 160, 135, 75, 14, 76, 98, 162, 125, 86, 127, 195, 238, 168, 97
Offset: 0

Views

Author

Scott R. Shannon, Jan 13 2021

Keywords

Comments

This sequences uses the same rules as Recamán's sequence A005132 if the value of n itself has not previously appeared in the sequence. However if n has previously appeared then the step size from a(n-1) is set to lastindex(n), where lastindex(n) is the sequence index of the last appearance of n.
The smallest value not to have appeared after 1 million terms is 52. It is unknown if all terms eventually appear.

Examples

			a(3) = 5 as a(2) = 3 = n, thus the step size from a(2) is 2. As 1 has previously appeared a(3) = a(2) + 2 = 3 + 2 = 5.
a(5) = 6 as a(3) = 5 = n, thus the step size from a(4) is 3. As 6 has not previously appeared a(5) = a(4) - 3 = 9 - 3 = 6.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A340593_gen(): # generator of terms
        a, ndict = 0, {0:0}
        yield 0
        for n in count(1):
            yield (a:= (a-m if a>=(m:=ndict[n]) and a-m not in ndict else a+m) if n in ndict else (a-n if a>=n and a-n not in ndict else a+n))
            ndict[a] = n
    A340593_list = list(islice(A340593_gen(),30)) # Chai Wah Wu, Jun 29 2023

A335372 a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) - A001065(n) if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + A001065(n), where A001065(n) is the sum of the proper divisors of n.

Original entry on oeis.org

0, 1, 2, 3, 6, 5, 11, 10, 17, 13, 21, 20, 4, 5, 15, 24, 9, 8, 29, 28, 50, 39, 25, 26, 62, 56, 40, 27, 55, 54, 12, 13, 44, 59, 79, 66, 121, 120, 98, 81, 31, 30, 84, 83, 43, 76, 102, 101, 177, 169, 126, 105, 151, 150, 216, 199, 135, 112, 80, 81, 189, 188, 154, 113, 176, 157, 235, 234, 292
Offset: 0

Views

Author

Scott R. Shannon, Aug 16 2020

Keywords

Comments

This sequences uses the same rules as Recamán's sequence A005132 except that, instead of adding or subtracting n each term, the sum of the proper divisors of n is used. See A001065.
For the first 10 million terms the smallest value not appearing is 46. As there are infinite abundant numbers it is likely that eventually all values are visited, although this is unknown.
In the same range the maximum value is a(9529524) = 65424507, and 633238 terms repeat a previously visited value, the first time this occurs is a(13) = a(5) = 5. The longest run of consecutive increasing terms is 8, starting at a(7069152) = 1040443, while the longest run of consecutive decreasing terms is 11, starting at a(106380) = 621777.

Examples

			a(2) = 2. As 2 is prime A001065(2) = 1, and 1 has previously appeared, a(2) = a(1) + 1 = 2.
a(4) = 6. As A001065(4) = 1+2 = 3, and 0 has previously appeared, a(4) = a(3) + 3 = 6.
a(5) = 5. As 5 is prime A001065(5) = 1, and 5 has not previously appeared, a(5) = a(4) - 1 = 5.
		

Crossrefs

A335382 a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) - sigma(n) if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + sigma(n), where sigma(n) is the sum of the divisors of n.

Original entry on oeis.org

0, 1, 4, 8, 15, 9, 21, 13, 28, 41, 23, 11, 39, 25, 49, 73, 42, 24, 63, 43, 85, 53, 17, 41, 101, 70, 112, 72, 16, 46, 118, 86, 149, 197, 143, 95, 186, 148, 88, 32, 122, 80, 176, 132, 48, 126, 54, 6, 130, 187, 94, 22, 120, 66, 186, 114, 234, 154, 64, 124, 292, 230, 134, 30, 157, 241, 97, 29, 155
Offset: 0

Views

Author

Scott R. Shannon, Aug 16 2020

Keywords

Comments

This sequences uses the same rules as Recamán's sequence A005132 except that, instead of adding or subtracting n each term, the sum of the divisors of n is used. See A000203.
For the first 10 million terms the smallest value not appearing is 76. It is likely that all values are eventually visited, although this is unknown.
In the same range the maximum value is a(9297600) = 93571073, and 402979 terms repeat a previously visited value, the first time this occurs is a(23) = a(9) = 41. The longest run of consecutive increasing terms is 5, starting at a(105187) = 25833, while the longest run of consecutive decreasing terms is 7, starting at a(6826248) = 83016261.

Examples

			a(2) = 4. As sigma(2) = 3, and a(1)<3, a(2) = a(1) + 3 = 4.
a(4) = 15. As sigma(4) = 7, and 1 has previously appeared, a(4) = a(3) + 7 = 15.
a(5) = 9. As sigma(5) = 6, and 9 has not previously appeared, a(5) = a(4) - 6 = 9.
		

Crossrefs

A340730 a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) - min(a(n-1),n) if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + min(a(n-1),n).

Original entry on oeis.org

0, 1, 2, 4, 8, 3, 6, 12, 20, 11, 21, 10, 20, 7, 14, 28, 44, 27, 9, 18, 36, 15, 30, 53, 29, 54, 80, 107, 79, 50, 80, 49, 17, 34, 68, 33, 66, 103, 65, 26, 52, 93, 51, 94, 138, 183, 137, 90, 42, 84, 134, 83, 31, 62, 116, 61, 5, 10, 20, 40, 80, 19, 38, 76, 140, 75, 141, 74, 142, 73, 143, 72, 144
Offset: 0

Views

Author

Scott R. Shannon, Jan 17 2021

Keywords

Comments

This sequence uses the same rules as Recamán's sequence A005132 except that the step size for each term n is set to the minimum of n and a(n-1).
The terms are slightly concentrated along the linear relationships a(n) = k*n, where k is an integer >= 1. Other values are distributed between these lines. See the linked image.
The smallest value not to have appeared after 5 million terms is 8697. It is unknown if all terms eventually appear.

Examples

			a(3) = 4 as min(3,a(2)) = min(3,2) = 2, and as 0 has already appeared a(3) = a(2) + 2 = 2 + 2 = 4.
a(5) = 3 as min(5,a(4)) = min(5,8) = 5, and as 3 has not already appeared a(5) = a(4) - 5 = 8 - 5 = 3.
		

Crossrefs

A340733 a(0) = 0; for n > 0, if the value of n itself appears in the sequence then a(n) = a(n-1) - (n-index(n)) if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + (n-index(n)), where index(n) is the index of the last appearance of n. If the value of n does not appear then a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n.

Original entry on oeis.org

0, 1, 3, 2, 6, 11, 9, 16, 8, 5, 15, 21, 33, 20, 34, 29, 38, 55, 37, 18, 25, 35, 13, 36, 12, 7, 33, 60, 32, 46, 76, 45, 41, 48, 28, 14, 27, 46, 24, 63, 23, 32, 74, 31, 75, 61, 52, 99, 84, 133, 83, 134, 128, 181, 127, 89, 145, 88, 30, 89, 56, 40, 102, 78, 142, 77, 143, 210, 278, 209, 139, 68
Offset: 0

Views

Author

Scott R. Shannon, Jan 17 2021

Keywords

Comments

This sequence uses the same rules as Recamán's sequence A005132 if the value of n itself has not previously appeared in the sequence. However if n has previously appeared then the step size from a(n-1) is set to be n - index(n), where index(n) is the sequence index of the last appearance of n.
The sequence values appear random up to a(45256) = 45257. As 45257 has then appeared in the sequence the step size for the next term is 45257 - index(45257) = 45257 - 452576 = 1. As a(42564) = 45256 the next term a(45257) must be a(45256) + 1 = 45257 + 1 = 45258. This pattern then repeats so all terms beyond a(45256) are just a(n-1) + 1. See the linked image.

Examples

			a(3) = 2 as a(2) = 3 = n, thus the step size from a(2) is 3 - index(3) = 3 - 2 = 1. As 2 has not previously appeared a(3) = a(2) - 1 = 3 - 1 = 2.
a(6) = 9 as a(4) = 6 = n, thus the step size from a(5) is 6 - index(6) = 6 - 4 = 2. As 9 has not previously appeared a(6) = a(5) - 2 = 11 - 2 = 9.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A340733_gen(): # generator of terms
        a, ndict = 0, {0:0}
        yield 0
        for n in count(1):
            yield (a:= (a-m if a>=(m:=n-ndict[n]) and a-m not in ndict else a+m) if n in ndict else (a-n if a>=n and a-n not in ndict else a+n))
            ndict[a] = n
    A340733_list = list(islice(A340733_gen(),30)) # Chai Wah Wu, Jun 29 2023

Formula

a(n) = n + 1 for n >= 45256.
Showing 1-7 of 7 results.