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

A272610 a(1)=5, a(2)=9, a(3)=4, a(4)=6; thereafter a(n) = a(n-a(n-1)) + a(n-a(n-2)).

Original entry on oeis.org

5, 9, 4, 6, 5, 5, 18, 4, 5, 10, 10, 18, 4, 10, 15, 10, 27, 4, 15, 15, 10, 36, 4, 15, 20, 15, 36, 4, 20, 25, 15, 45, 4, 25, 25, 20, 45, 4, 25, 35, 15, 54, 4, 35, 25, 20, 72, 4, 25, 40, 25, 54, 4, 40, 40, 20, 72, 4, 40, 35, 25, 81, 4, 35, 50, 25, 81, 4, 50, 40, 25, 117
Offset: 1

Views

Author

Nathan Fox, May 03 2016

Keywords

Comments

In calculating terms of this sequence, use the convention that a(n)=0 for n<=0.
Similar to Hofstadter's Q-sequence A005185 but with different starting values.
This sequence exists as long as A272611 and A272612 exist.
No other term of this sequence changes if a(4) is replaced by a number greater than 6.
If a(2) is replaced by a number N greater than 9, then every other term of the form a(5n+2) is replaced by a(5n+2)*N/9.

Crossrefs

Programs

  • Maple
    A272610:=proc(n) option remember:
        if n <= 0 then
            return 0:
        elif n = 1 then
            return 5:
        elif n = 2 then
            return 9:
        elif n = 3 then
            return 4:
        elif n = 4 then
            return 6:
        else
            return A272610(n-A272610(n-1))+A272610(n-A272610(n-2)):
        fi:
    end:
  • Mathematica
    a[n_] := a[n] = Switch[n, ?NonPositive, 0, 1, 5, 2, 9, 3, 4, 4, 6, ,
       a[n - a[n - 1]] + a[n - a[n - 2]]];
    Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Jul 24 2022 *)
  • Python
    from functools import cache
    @cache
    def a(n):
        if n < 0: return 0
        if n < 5: return [0, 5, 9, 4, 6][n]
        return a(n - a(n-1)) + a(n - a(n-2))
    print([a(n) for n in range(1, 73)]) # Michael S. Branicky, Sep 20 2021

Formula

a(1)=5, a(2)=9, a(3)=4, a(4)=6; thereafter a(5n)=5*A272611(n), a(5n+1)=5*A272612(n), a(5n+2)=9*A272613(n), a(5n+3)=4, a(5n+4)=5*A272611(n).

A272611 a(1)=1; thereafter a(n) = a(n-a(n-1)) + A272612(n-1).

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 5, 7, 5, 8, 8, 7, 10, 8, 10, 12, 9, 11, 15, 9, 14, 16, 11, 19, 13, 18, 13, 19, 19, 18, 19, 20, 20, 18, 19, 20, 20, 23, 27, 20, 26, 28, 20, 35, 20, 31, 27, 26, 26, 37, 21, 33, 24, 35, 23, 37, 24, 35, 38, 33, 34, 39, 39, 29, 39, 32, 38, 39, 37
Offset: 1

Views

Author

Nathan Fox, May 03 2016

Keywords

Comments

Much like the Hofstadter Q-sequence A005185, it is not known if this sequence is defined for all positive n.
Empirically, this sequence appears to grow approximately like n/2 with a lot of noise.
a(n) exists for n<=10^7.

Crossrefs

Programs

A272612 a(0)=1, a(1)=1; thereafter a(n) = a(n-A272611(n)) + a(n-A272611(n-1)).

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 3, 4, 3, 4, 5, 4, 5, 5, 5, 7, 5, 6, 8, 5, 7, 9, 6, 9, 8, 8, 8, 9, 11, 10, 9, 10, 10, 10, 10, 11, 11, 12, 15, 10, 12, 16, 10, 16, 12, 13, 15, 12, 15, 18, 13, 14, 15, 17, 14, 17, 15, 17, 19, 17, 15, 20, 20, 16, 19, 19, 19, 21, 19, 19, 20, 20, 20, 20
Offset: 0

Views

Author

Nathan Fox, May 03 2016

Keywords

Comments

Much like the Hofstadter Q-sequence A005185, it is not known if this sequence is defined for all positive n.
Empirically, this sequence appears to grow approximately like n/4 with a lot of noise.
a(n) exists for n<=10^7.

Crossrefs

Programs

A274055 Relative of Hofstadter Q-sequence: a(n) = n for 1 <= n <= 42; a(n) = a(n-a(n-1)) + a(n-a(n-2)) for n > 42.

Original entry on oeis.org

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

Views

Author

Nathan Fox, Nov 13 2016

Keywords

Comments

In calculating terms of this sequence, use the convention that a(n)=0 for n<=0.
This sequence eventually settles into a pattern resembling A272610.

Crossrefs

Formula

If the index is between 77 and 89 (inclusive), then a(5n) = 3, a(5n+1) = 5, a(5n+2) = 88n-1188, a(5n+3) = 5, a(5n+4) = 88.
If the index is between 95 and 397 (inclusive), then a(5n) = 396n-6820, a(5n+1) = 3, a(5n+2) = 396, a(5n+3) = 3, a(5n+4) = 5.
If the index is between 403 and 24860 (inclusive), then a(5n) = 24860, a(5n+1) = 3, a(5n+2) = 5, a(5n+3) = 24860n-1939476, a(5n+4) = 5.
If the index is at least 24863, then a(5n) = 24860*A272613(n-4972), a(5n+1) = 4, a(5n+2) = 5*A272611(n-4972), a(5n+3) = 5*A272611(n-4971), a(5n+4) = 5*A272612(n-4971). This pattern lasts as long as A272611 exists (which is conjectured to be forever).

A283882 Relative of Hofstadter Q-sequence: a(n) = max(0, n+67) for n <= 0; a(n) = a(n-a(n-1)) + a(n-a(n-2)) for n > 0.

Original entry on oeis.org

3, 68, 69, 5, 70, 6, 7, 71, 73, 10, 8, 73, 77, 12, 74, 14, 79, 11, 78, 82, 16, 13, 17, 15, 81, 20, 20, 142, 73, 24, 32, 138, 3, 32, 207, 5, 138, 3, 5, 345, 5, 138, 3, 5, 483, 5, 138, 3, 5, 621, 5, 138, 3, 5, 759, 5, 138, 3, 5, 897, 5, 138, 3, 5, 1035, 5, 138, 3, 5, 1173, 5, 138, 5, 8, 1311
Offset: 1

Views

Author

Nathan Fox, Mar 19 2017

Keywords

Comments

Sequences like this are more naturally considered with the first nonzero term in position 1. But this sequence would then match A000027 for its first 67 terms.

Crossrefs

Programs

Formula

If the index is between 35 and 72 (inclusive), then a(5n) = 138n-759, a(5n+1) = 5, a(5n+2) = 138, a(5n+3) = 3, a(5n+4) = 5.
If the index is between 78 and 1245 (inclusive), then a(5n) = 1311, a(5n+1) = 3, a(5n+2) = 5, a(5n+3) = 1311n-17181, a(5n+4) = 5.
If the index is between 1251 and 309192 (inclusive), then a(5n) = 5, a(5n+1) = 19047817435n-1178393232110703, a(5n+2) = 5, a(5n+3) = 19047817435, a(5n+4) = 3.
If the index is between 309336 and 19047817368 (inclusive), then a(5n) = 5, a(5n+1) = 309258n-76697295, a(5n+2) = 5, a(5n+3) = 309258, a(5n+4) = 3.
If the index is at least 19047817371, then a(5n) = 5*A272611(n-3809563474), a(5n+1) = 5*A272611(n-3809563473), a(5n+2) = 5*A272612(n-3809563473), a(5n+3) = 19047817435*A272613(n-3809563473), a(5n+4) = 4. This pattern lasts as long as A272611 exists (which is conjectured to be forever).
Showing 1-5 of 5 results.