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.

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

A342080 Numbers that cannot be expressed as the sum of one or more numbers without any repeated digits.

Original entry on oeis.org

18872, 18874, 18890, 18892, 22085, 22111, 22112, 22116, 22120, 22121, 22130, 22210, 22211, 22220, 22256, 22310, 22570, 22571, 22580, 22607, 22616, 22652, 22670, 22679, 22697, 22706, 22710, 22724, 22762, 22825, 22832, 22841, 22850, 22859, 22864
Offset: 1

Views

Author

Rodolfo Kurchan, Feb 27 2021

Keywords

Comments

Computer solutions found by Oscar Volpatti.
All numbers > 9876543210 are terms. Number of terms <= 987654210 is 9862729718. - Chai Wah Wu, Apr 01 2021

Examples

			Example of numbers with solutions:
393 = 352 + 41;
856 = 856;
1000 = 987 + 13;
1111 = 987 + 124 or 1024 + 87;
45 = 45 or 42 + 3 or 1+2+3+4+5+6+7+8+9;
10002 = 9874 + 125 + 3.
The smallest number without solution is 18872.
		

Crossrefs

Cf. A339673.
Showing 1-3 of 3 results.