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.

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)

A296413 a(1) = a(2) = a(3) = 1, a(4) = 4, a(5) = 3; 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, 1, 4, 3, 5, 6, 5, 9, 8, 7, 8, 11, 12, 11, 10, 14, 15, 16, 12, 17, 16, 18, 16, 24, 14, 19, 25, 23, 16, 21, 26, 28, 21, 27, 25, 26, 26, 34, 29, 25, 30, 38, 33, 25, 33, 40, 34, 30, 30, 48, 36, 35, 36, 44, 37, 40, 44, 43, 36, 53, 39, 43, 48, 44, 49, 49, 48, 41, 56, 45, 50, 57, 53, 55, 51, 46, 63, 63, 49, 56, 58, 64, 51
Offset: 1

Views

Author

Altug Alkan, Dec 11 2017

Keywords

Comments

For this recurrence (a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3))) with five initial conditions, only three options such that 1 <= a(i) <= 5 with 1 <= i <= 5 result in a sequence that does not quickly terminate, of which A278055 is the only well-behaved sequence. The other two sets of initial conditions are (1,1,1,4,3) (which yields this sequence) and (1,1,3,4,4), which yields A292351. This sequence is finite but has a relatively long life: a(509871) = 519293 is its final term since a(509872) refers to a nonpositive index and thus fails to exist; see graph in Links section.

Crossrefs

Programs

  • PARI
    my(q=vector(100)); q[1]=1;q[2]=1;q[3]=1;q[4]=4;q[5]=3; 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 (A296413 n) (cond ((< n 1) (error "Dead!")) ((<= n 3) 1) ((= 4 n) 4) ((= 5 n) 3) (else (+ (A296413 (- n (A296413 (- n 1)))) (A296413 (- n (A296413 (- n 2)))) (A296413 (- n (A296413 (- n 3)))))))) ;; Antti Karttunen, Dec 13 2017

A296690 a(1) = a(2) = a(3) = 2, a(4) = 4, a(5) = a(6) = 5; 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

2, 2, 2, 4, 5, 5, 6, 6, 8, 10, 9, 8, 11, 12, 12, 13, 14, 14, 15, 15, 16, 17, 17, 18, 18, 20, 22, 21, 20, 24, 25, 20, 25, 28, 28, 21, 29, 32, 30, 25, 30, 30, 36, 30, 32, 35, 34, 36, 35, 37, 37, 38, 38, 40, 40, 40, 42, 41, 43, 43, 43, 45, 44, 46, 46, 47, 47, 49, 49, 49, 51, 50, 52, 52, 52, 54, 53, 56, 55, 58, 55, 62, 55
Offset: 1

Views

Author

Altug Alkan, Dec 18 2017

Keywords

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):= 2: a(2):= 2: a(3):= 2: a(4):= 4: a(5):= 5: a(6):= 5:
    map(a, [$1..100]); #  after Robert Israel at A296440
  • Mathematica
    a[n_] := a[n] = If[n<7, {2, 2, 2, 4, 5, 5}[[n]], a[n - a[n-1]] + a[n - a[n-2]] + a[n - a[n-3]]]; Array[a, 100] (* after Giovanni Resta at A296440 *)
  • PARI
    q=vector(10^5); q[1]=2; q[2]=2; q[3]=2; q[4]=4; q[5]=5; q[6]=5; for(n=7, #q, q[n] = q[n-q[n-1]]+q[n-q[n-2]]+q[n-q[n-3]]); q
    
  • Scheme
    (definec (A296690 n) (cond ((<= n 3) 2) ((<= n 5) n) ((= n 6) 5) (else (+ (A296690 (- n (A296690 (- n 1)))) (A296690 (- n (A296690 (- n 2)))) (A296690 (- n (A296690 (- n 3)))))))) ;; Antti Karttunen, Dec 18 2017

A296786 a(1) = a(2) = a(5) = 2, a(3) = 1, a(4) = 3, a(6) = 5; 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

2, 2, 1, 3, 2, 5, 7, 8, 7, 4, 11, 12, 11, 4, 15, 16, 15, 4, 19, 20, 19, 4, 23, 24, 23, 4, 27, 28, 27, 4, 31, 32, 31, 4, 35, 36, 35, 4, 39, 40, 39, 4, 43, 44, 43, 4, 47, 48, 47, 4, 51, 52, 51, 4, 55, 56, 55, 4, 59, 60, 59, 4, 63, 64, 63, 4, 67, 68, 67, 4, 71, 72, 71, 4, 75, 76, 75, 4, 79, 80, 79, 4
Offset: 1

Views

Author

Altug Alkan, Dec 20 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)). See comments in A296518.

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):= 2: a(2):= 2: a(3):= 1: a(4):= 3: a(5):= 2: a(6):= 5:
    map(a, [$1..100]); # after Robert Israel at A296440
  • Mathematica
    a[n_] := a[n] = If[n<7, {2, 2, 1, 3, 2, 5}[[n]], a[n - a[n-1]] + a[n - a[n-2]] + a[n - a[n-3]]]; Array[a, 100] (* after Giovanni Resta at A296440 *)
  • PARI
    q=vector(10^5); q[1]=2;q[2]=2;q[3]=1;q[4]=3;q[5]=2;q[6]=5;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*(2 + 2*x + x^2 + 3*x^3 - 2*x^4 + x^5 + 5*x^6 + 2*x^7 + 5*x^8 - 4*x^9 - 2*x^10 - x^11 - x^12 + x^13) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2) + O(x^100)) \\ Colin Barker, Dec 29 2017

Formula

a(4*k-1) = a(4*k+1) = 4*k-1, a(4*k) = 4*k, a(4*k+2) = 4, for k > 1.
From Colin Barker, Dec 28 2017: (Start)
G.f.: x*(2 + 2*x + x^2 + 3*x^3 - 2*x^4 + x^5 + 5*x^6 + 2*x^7 + 5*x^8 - 4*x^9 - 2*x^10 - x^11 - x^12 + 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)
Showing 1-5 of 5 results.