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 28 results. Next

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

Original entry on oeis.org

6, 32479, 32480, 32481, 9, 32482, 32483, 32484, 12, 32485, 32486, 32487, 15, 32488, 32489, 17, 32491, 18, 32491, 32493, 32494, 22, 21, 64967, 64961, 9, 18, 64976, 64979, 32487, 22, 32508, 32513, 32491, 27, 36, 32515, 64966, 32482, 39, 32516, 32522
Offset: 1

Views

Author

Nathan Fox, Nov 10 2016

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 32478 terms.
This sequence has exactly 37025 terms (of positive index). a(37025) = 0, so an attempt to calculate a(37026) would refer to itself.
Without the convention that a(n) = 0 for n <= -32478, this sequence would have exactly 24 terms (of positive index), since computing a(25) refers to a(-64942).
If 32478 in this sequence's definition is replaced by any larger number congruent to 5 mod 7, the behavior is essentially the same, though the quasilinear part (see Formula section) lasts longer.

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n <= 0, Max[0, n + 2^15 - 290], a[n - a[n - 1]] + a[n - a[n - 2]] + a[n - a[n - 3]]]; Array[a, 42] (* Robert G. Wilson v, Mar 19 2017 *)

Formula

If the index is between 67 and 32479 (inclusive), then a(7n) = 7n+2, a(7n+1) = 7n+32480, a(7n+2) = 7n+32482, a(7n+3) = 7, a(7n+4) = 2n+65001, a(7n+5) = n+64949, a(7n+6) = 32476.

Extensions

Formula and definition corrected by Nathan Fox, Mar 18 2017

A292351 a(1) = a(2) = 1, a(3) = 3, a(4) = a(5) = 4; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 5.

Original entry on oeis.org

1, 1, 3, 4, 4, 5, 7, 8, 6, 8, 10, 10, 10, 12, 11, 13, 13, 15, 14, 16, 16, 18, 18, 18, 21, 20, 18, 23, 21, 23, 24, 24, 20, 28, 28, 29, 20, 29, 30, 34, 27, 29, 31, 34, 35, 31, 33, 34, 39, 36, 34, 38, 38, 42, 36, 43, 39, 43, 42, 44, 42, 47, 43, 47, 48, 47, 46, 50, 50, 50, 48, 54, 53, 52, 52, 54, 60, 53, 55, 55, 63
Offset: 1

Views

Author

Altug Alkan, Dec 12 2017

Keywords

Comments

With five initial conditions, this sequence has the longest chaotic life for the recurrence a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) where 1 <= a(i) <= 5 with 1 <= i <= 5. It is not known if this sequence is defined for all positive n. See plot of this sequence in Links section.

Crossrefs

Programs

  • PARI
    q=vector(10^5); q[1]=1; q[2]=1; q[3]=3; q[4]=4; q[5]=4; for(n=6, #q, q[n] = q[n-q[n-1]]+q[n-q[n-2]]+q[n-q[n-3]]); q
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A292351 n) (cond ((<= n 2) 1) ((= 3 n) 3) ((<= n 5) 4) (else (+ (A292351 (- n (A292351 (- n 1)))) (A292351 (- n (A292351 (- n 2)))) (A292351 (- n (A292351 (- n 3)))))))) ;; Antti Karttunen, Dec 13 2017

A296518 a(1) = 3, a(2) = a(5) = 1, a(3) = a(4) = a(6) = 2; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 6.

Original entry on oeis.org

3, 1, 2, 2, 1, 2, 4, 8, 8, 4, 8, 12, 12, 4, 12, 16, 16, 4, 16, 20, 20, 4, 20, 24, 24, 4, 24, 28, 28, 4, 28, 32, 32, 4, 32, 36, 36, 4, 36, 40, 40, 4, 40, 44, 44, 4, 44, 48, 48, 4, 48, 52, 52, 4, 52, 56, 56, 4, 56, 60, 60, 4, 60, 64, 64, 4, 64, 68, 68, 4, 68, 72, 72, 4, 72, 76, 76, 4, 76, 80, 80, 4, 80, 84, 84, 4, 84, 88, 88, 4
Offset: 1

Views

Author

Altug Alkan, Dec 14 2017

Keywords

Comments

A quasi-periodic solution to the three-term Hofstadter recurrence a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)). For a quasi-quadratic solution, see also A268368 that uses the convention that evaluating at a nonpositive index gives zero (this sequence and A244477 do not use this convention). See page 119 at the Fox reference for the detailed analysis of solutions with initial conditions with 1 through N. The three-term Hofstadter recurrence also has a slow solution (A278055) and chaotic solutions such as A292351, A296413 and A296440. So the recurrence a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) has all known types of behaviors that are mentioned on page 7 of the Tanny reference in the Links section.

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; procname(n-procname(n-1))+procname(n-procname(n-2))+procname(n-procname(n-3)) end proc:
    a(1):= 3: a(2):= 1: a(3):= 2: a(4):= 2: a(5):= 1: a(6):= 2:
    map(a, [$1..100]); # after Robert Israel at A296440
  • Mathematica
    Fold[Append[#1, #1[[#2 - #1[[#2 - 1]] ]] + #1[[#2 - #1[[#2 - 2]] ]] + #1[[#2 - #1[[#2 - 3]] ]] ] &, {3, 1, 2, 2, 1, 2}, Range[7, 90]] (* or *)
    Rest@ CoefficientList[Series[x (3 + x + 2 x^2 + 2 x^3 - 5 x^4 + 4 x^7 + 9 x^8 + x^9 + 2 x^10 - 2 x^11 - 3 x^12 - 2 x^13)/((1 - x)^2*(1 + x)^2*(1 + x^2)^2), {x, 0, 90}], x] (* Michael De Vlieger, Dec 14 2017 *)
    LinearRecurrence[{0,0,0,2,0,0,0,-1},{3,1,2,2,1,2,4,8,8,4,8,12,12,4},100] (* Harvey P. Dale, May 30 2018 *)
  • PARI
    my(q=vector(100)); q[1]=3;q[2]=1;q[3]=2;q[4]=2;q[5]=1;q[6]=2;for(n=7, #q, q[n] = q[n-q[n-1]]+q[n-q[n-2]]+q[n-q[n-3]]); q
    
  • PARI
    Vec(x*(3 + x + 2*x^2 + 2*x^3 - 5*x^4 + 4*x^7 + 9*x^8 + x^9 + 2*x^10 - 2*x^11 - 3*x^12 - 2*x^13) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2) + O(x^100)) \\ Colin Barker, Dec 14 2017
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A296518 n) (cond ((= 1 n) 3) ((or (= 2 n) (= 5 n)) 1) ((<= n 6) 2) (else (+ (A296518 (- n (A296518 (- n 1)))) (A296518 (- n (A296518 (- n 2)))) (A296518 (- n (A296518 (- n 3)))))))) ;; Antti Karttunen, Dec 16 2017

Formula

a(4*k) = a(4*k+1) = a(4*k+3) = 4*k, a(4*k+2) = 4 for k > 1.
From Colin Barker, Dec 14 2017: (Start)
G.f.: x*(3 + x + 2*x^2 + 2*x^3 - 5*x^4 + 4*x^7 + 9*x^8 + x^9 + 2*x^10 - 2*x^11 - 3*x^12 - 2*x^13) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2).
a(n) = 2*a(n-4) - a(n-8) for n > 14.
(End)

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

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 6, 8, 9, 10, 9, 11, 12, 13, 12, 14, 15, 16, 15, 17, 18, 17, 20, 18, 20, 22, 21, 21, 22, 26, 25, 23, 24, 28, 26, 29, 26, 31, 30, 32, 28, 34, 30, 37, 29, 38, 35, 37, 33, 39, 40, 38, 37, 42, 43, 40, 40, 44, 42, 47, 43, 44, 46, 51, 46, 46, 50, 50, 50, 51, 53, 50
Offset: 1

Views

Author

Nathan Fox, May 28 2024

Keywords

Comments

Similar to A278055 but with different starting values.
Much like the Hofstadter Q-sequence A005185, it is not known if this sequence is defined for all positive n.
a(n) exists for n <= 3*10^7.

Crossrefs

Similar sequences based on the Q-recurrence: A278056, A278057, A278058, A278059, A278060, A278061, A278062, A278063, A278064, A278065.

Programs

  • Mathematica
    a[n_] := a[n] = If[0 < n < 8, n, a[n-a[n-1]] + a[n-a[n-2]] + a[n-a[n-3]]];
    Array[a, 100] (* Paolo Xausa, May 31 2024 *)

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

Original entry on oeis.org

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

Views

Author

Nathan Fox, May 28 2024

Keywords

Comments

Similar to A278055 but with different starting values.
Much like the Hofstadter Q-sequence A005185, it is not known if this sequence is defined for all positive n.
a(n) exists for n <= 3*10^7.

Crossrefs

Similar sequences based on the Q-recurrence: A278056, A278057, A278058, A278059, A278060, A278061, A278062, A278063, A278064, A278065.

Programs

  • Mathematica
    a[n_] := a[n] = If[0 < n < 9, n, a[n-a[n-1]] + a[n-a[n-2]] + a[n-a[n-3]]];
    Array[a, 100] (* Paolo Xausa, May 31 2024 *)

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

Original entry on oeis.org

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

Views

Author

Nathan Fox, May 28 2024

Keywords

Comments

Similar to A278055 but with different starting values.
Much like the Hofstadter Q-sequence A005185, it is not known if this sequence is defined for all positive n.
a(n) exists for n <= 3*10^7.

Crossrefs

Similar sequences based on the Q-recurrence: A278056, A278057, A278058, A278059, A278060, A278061, A278062, A278063, A278064, A278065.

Programs

  • Mathematica
    a[n_] := a[n] = If[0 < n < 10, n, a[n-a[n-1]] + a[n-a[n-2]] + a[n-a[n-3]]];
    Array[a, 100] (* Paolo Xausa, May 31 2024 *)

A373230 Relative of Hofstadter Q-sequence: a(n) = 0 for n <= 0, a(n) = n for 1 <= n <= 10; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 10.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 6, 11, 12, 13, 9, 14, 15, 16, 12, 17, 18, 19, 15, 20, 21, 17, 23, 18, 23, 25, 26, 22, 21, 31, 29, 21, 28, 34, 27, 29, 31, 27, 38, 33, 34, 31, 39, 37, 37, 30, 44, 36, 39, 35, 43, 45, 43, 30, 50, 50, 38, 42, 51, 48, 43, 40, 55, 51, 52, 37, 60, 57, 47
Offset: 1

Views

Author

Nathan Fox, May 28 2024

Keywords

Comments

Similar to A278055 but with different starting values.
a(1015) = 1036. This is the smallest index for which a(n) > n. So, without the condition that a(n) = 0 for n <= 0, this sequence would be finite and have exactly 1015 terms.
Much like the Hofstadter Q-sequence A005185, it is not known if this sequence is defined for all positive n.
a(n) exists for n <= 3*10^7.

Crossrefs

Similar sequences based on the Q-recurrence: A278056, A278057, A278058, A278059, A278060, A278061, A278062, A278063, A278064, A278065.

Programs

  • Mathematica
    a[n_] := a[n] = Which[n < 1, 0, n < 11, n, True, a[n-a[n-1]] + a[n-a[n-2]] + a[n-a[n-3]]]; Array[a, 100] (* Paolo Xausa, May 31 2024 *)

A373231 Relative of Hofstadter Q-sequence: a(n) = 0 for n <= 0, a(n) = n for 1 <= n <= 11; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 11.

Original entry on oeis.org

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

Views

Author

Nathan Fox, May 28 2024

Keywords

Comments

Similar to A278055 but with different starting values.
a(117) = 120. This is the smallest index for which a(n) > n. So, without the condition that a(n) = 0 for n <= 0, this sequence would be finite and have exactly 117 terms.
Much like the Hofstadter Q-sequence A005185, it is not known if this sequence is defined for all positive n.
a(n) exists for n <= 3*10^7.

Crossrefs

Similar sequences based on the Q-recurrence: A278056, A278057, A278058, A278059, A278060, A278061, A278062, A278063, A278064, A278065.

Programs

  • Mathematica
    a[n_] := a[n] = Which[n < 1, 0, n < 12, n, True, a[n-a[n-1]] + a[n-a[n-2]] + a[n-a[n-3]]]; Array[a, 100] (* Paolo Xausa, May 31 2024 *)

A373232 Relative of Hofstadter Q-sequence: a(n) = 0 for n <= 0, a(n) = n for 1 <= n <= 12; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 12.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 6, 13, 14, 15, 9, 16, 17, 18, 12, 19, 20, 21, 15, 22, 23, 17, 25, 18, 25, 27, 28, 22, 21, 35, 31, 19, 30, 31, 40, 25, 31, 27, 47, 31, 33, 24, 46, 35, 43, 24, 51, 32, 49, 33, 44, 37, 55, 40, 39, 46, 50, 44, 43, 54, 47, 40, 58, 50, 43, 57, 53
Offset: 1

Views

Author

Nathan Fox, May 28 2024

Keywords

Comments

Similar to A278055 but with different starting values.
a(45) = 47. This is the smallest index for which a(n) > n. So, without the condition that a(n) = 0 for n <= 0, this sequence would be finite and have exactly 45 terms.
Much like the Hofstadter Q-sequence A005185, it is not known if this sequence is defined for all positive n.
a(n) exists for n <= 3*10^7.

Crossrefs

Similar sequences based on the Q-recurrence: A278056, A278057, A278058, A278059, A278060, A278061, A278062, A278063, A278064, A278065.

Programs

  • Mathematica
    a[n_] := a[n] = Which[n < 1, 0, n < 13, n, True, a[n-a[n-1]] + a[n-a[n-2]] + a[n-a[n-3]]]; Array[a, 100] (* Paolo Xausa, May 31 2024 *)

A373233 Relative of Hofstadter Q-sequence: a(n) = 0 for n <= 0, a(n) = n for 1 <= n <= 13; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 13.

Original entry on oeis.org

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

Views

Author

Nathan Fox, May 28 2024

Keywords

Comments

Similar to A278055 but with different starting values.
a(73) = 82. This is the smallest index for which a(n) > n. So, without the condition that a(n) = 0 for n <= 0, this sequence would be finite and have exactly 73 terms.
Much like the Hofstadter Q-sequence A005185, it is not known if this sequence is defined for all positive n.
a(n) exists for n <= 3*10^7.

Crossrefs

Similar sequences based on the Q-recurrence: A278056, A278057, A278058, A278059, A278060, A278061, A278062, A278063, A278064, A278065.

Programs

  • Mathematica
    a[n_] := a[n] = Which[n < 1, 0, n < 14, n, True, a[n-a[n-1]] + a[n-a[n-2]] + a[n-a[n-3]]]; Array[a, 100] (* Paolo Xausa, May 31 2024 *)
Showing 1-10 of 28 results. Next