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.

A063892 a(1) = a(2) = a(3) = 1, a(n) = a(n-a(n-2))+a(n-a(n-3)) for n>3.

Original entry on oeis.org

1, 1, 1, 2, 4, 6, 5, 3, 3, 9, 6, 4, 7, 12, 9, 5, 7, 10, 16, 16, 10, 12, 12, 16, 14, 21, 13, 17, 8, 14, 24, 26, 19, 12, 8, 23, 22, 23, 12, 17, 18, 28, 35, 26, 16, 22, 34, 47, 22, 6, 10, 36, 69, 36
Offset: 1

Views

Author

Henry Bottomley, Aug 29 2001

Keywords

Comments

Undefined for n>54 since a(53)=69>=55.

Examples

			a(7) = a(7-a(5))+a(7-a(4)) = a(7-4)+a(7-2) = a(3)+a(5) = 1+4 = 5.
		

Crossrefs

See A064714 for a variant which does not die.

Programs

  • Maple
    #Q(r,s) with initial values 1,1,1,..., from N. J. A. Sloane, Apr 15 2014
    r:=2; s:=3;
    a:=proc(n) option remember; global r,s;
    if n <= s then 1
    else
        if (a(n-r) <= n) and (a(n-s) <= n) then
        a(n-a(n-r))+a(n-a(n-s));
        else lprint("died with n =",n); return (-1);
        fi;
    fi; end;
    [seq(a(n),n=1..54)];

A087777 a(1) = ... = a(4) = 1; a(n) = a(n - a(n-2)) + a(n - a(n-4)).

Original entry on oeis.org

1, 1, 1, 1, 2, 4, 6, 7, 7, 5, 3, 8, 9, 11, 12, 9, 9, 13, 11, 9, 13, 16, 13, 19, 16, 11, 14, 16, 21, 22, 14, 14, 19, 17, 22, 27, 25, 16, 20, 28, 22, 22, 26, 25, 24, 32, 26, 22, 29, 29, 32, 35, 32, 27, 26, 34, 30, 33, 40, 25, 27, 46, 40, 33, 32, 28, 36, 50, 44, 31, 36, 38, 46, 53, 41, 29, 41
Offset: 1

Views

Author

Roger L. Bagula, Oct 05 2003

Keywords

Comments

This is the sequence Q(2,4) in the Hofstadter-Huber classification.
It is not known if this sequence is defined for all positive n. Balamohan et al. comment that it shows "inscrutably wild behavior".

Crossrefs

Cf. A005185 (Q(1,2)), A063882 (Q(1,4)), A046700.

Programs

  • Magma
    [n le 4 select 1 else Self(n-Self(n-2))+Self(n-Self(n-4)): n in [1..80]]; // Vincenzo Librandi, Sep 10 2016
  • Maple
    a := proc(n) option remember; if n<=4 then 1 else if n > a(n-2) and n > a(n-4) then RETURN(a(n-a(n-2))+a(n-a(n-4))); else ERROR(" died at n= ", n); fi; fi; end;
  • Mathematica
    a[n_] := a[n] = If[n <= 4, 1, a[n - a[n - 2]] + a[n - a[n - 4]]];
    Array[a, 80] (* Jean-François Alcover, Nov 24 2017 *)

Extensions

Edited by N. J. A. Sloane, Nov 06 2007

A134680 a(n) = length (or lifetime) of the meta-Fibonacci sequence {f(1) = ... = f(n) = 1; f(k)=f(k-f(k-1))+f(k-f(k-n))} if that sequence is only defined for finitely many terms, or 0 if that sequence is infinite.

Original entry on oeis.org

6, 0, 164, 0, 60, 2354, 282, 1336, 100, 1254, 366, 419, 498, 483, 778, 1204, 292, 373, 845, 838, 1118, 2120, 815, 2616, 686, 1195, 745, 1112, 2132, 1588, 754, 1227, 1279, 1661, 716, 2275, 784, 2341, 1874, 1463, 1122, 2800, 1350, 1613, 2279, 1557, 1532
Offset: 1

Views

Author

T. D. Noe, Nov 06 2007

Keywords

Comments

Such a sequence has finite length when the k-th term becomes greater than k.
The term a(2) = 0 is only conjectural - see A005185. a(4) = 0 is a theorem of Balamohan et al. (2007). - N. J. A. Sloane, Nov 07 2007, Apr 18 2014.

Examples

			a(1) = 6: the f-sequence is defined by f(1) = 1, f(n) = 2f(n-f(n-1)), which gives 1,2,2,4,2,8 but f(7) = 2f(-1) is undefined, so the length is 6.
		

Crossrefs

Cf. A005185, A046700, A063882, A132172, A134679 (sequences for n=2..6).
See A240810 for another version.
A diagonal of the triangle in A240813.

Programs

  • Mathematica
    Table[Clear[a]; a[n_] := a[n] = If[n<=k, 1, a[n-a[n-1]]+a[n-a[n-k]]]; t={1}; n=2; While[n<10000 && a[n-1]
    				

A240818 a(n) = length (or lifetime) of the meta-Fibonacci sequence f(k) = k for k <= n; f(k)=f(k-f(k-1))+f(k-f(k-n)) if that sequence is only defined for finitely many terms, or 0 if that sequence is infinite.

Original entry on oeis.org

6, 0, 162, 0, 56, 2349, 276, 1300, 84, 1245, 356, 408, 486, 470, 764, 1172, 258, 356, 805, 819, 1078, 2099, 470, 2593, 662, 1170, 665, 1085, 2104, 1417, 724, 1196, 1247, 1628, 648, 2240, 712, 2304, 1836, 1424, 1082, 2759, 1264, 1570, 2235, 1512, 1442, 2447
Offset: 1

Views

Author

N. J. A. Sloane, Apr 15 2014

Keywords

Comments

The terms a(2) = 0 and a(4) = 0 are only conjectural.
This sequence is very similar to A134680.

References

  • D. R. Hofstadter, Curious patterns and non-patterns in a family of meta-Fibonacci recursions, Lecture in Doron Zeilberger's Experimental Mathematics Seminar, Rutgers University, April 10 2014.

Crossrefs

The sequences for n=2,3,4 are A005185 and (essentially) A046700, A063882.
See A240822 for another version.
A diagonal of the triangle in A240821.
Cf. A134680.

Extensions

More terms from Lars Blomberg, Oct 24 2014

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

Original entry on oeis.org

1, 2, 2, 7, 5, 1, 7, 2, 9, 3, 11, 3, 6, 4, 14, 5, 9, 16, 6, 15, 6, 10, 8, 21, 21, 21, 2, 28, 3, 30, 3, 6, 4, 33, 5, 9, 35, 6, 34, 6, 10, 8, 40, 40, 40, 2, 47, 3, 49, 3, 6, 4, 52, 5, 9, 54, 6, 53, 6, 10, 8, 59, 59, 59, 2, 66, 3, 68, 3, 6, 4, 71, 5, 9, 73, 6, 72, 6, 10, 8, 78, 78, 78, 2, 85, 3, 87, 3, 6, 4
Offset: 1

Views

Author

Altug Alkan and Rémy Sigrist, Aug 07 2019

Keywords

Comments

A well-defined solution sequence for recurrence a(n) = a(n-a(n-1)) + a(n-a(n-3)).

Crossrefs

Programs

  • Magma
    I:=[1,2,2,7,5,1,7,2];[n le 8 select I[n] else Self(n-Self(n-1))+Self(n-Self(n-3)): n in [1..90]]; // Marius A. Burtea, Aug 08 2019
  • PARI
    q=vector(100); q[1]=q[6]=1; q[2]=q[3]=q[8]=2; q[4]=q[7]=7; q[5]=5; for(n=9, #q, q[n]=q[n-q[n-1]]+q[n-q[n-3]]); q
    
  • PARI
    Vec(x*(1 + x)*(1 + x + x^2 + 6*x^3 - x^4 + 2*x^5 + 5*x^6 - 3*x^7 + 12*x^8 - 9*x^9 + 20*x^10 - 17*x^11 + 23*x^12 - 19*x^13 + 33*x^14 - 28*x^15 + 37*x^16 - 21*x^17 + 27*x^18 - 14*x^19 + 16*x^20 - 10*x^21 + 4*x^22 + 7*x^23 + 12*x^24 - 5*x^25 + 3*x^26 + 7*x^27 - 10*x^28 + 18*x^29 - 21*x^30 + 15*x^31 - 19*x^32 + 24*x^33 - 29*x^34 + 20*x^35 - 17*x^36 + 11*x^37 - 6*x^38 + 2*x^39 - 10*x^40 + 9*x^41 - 6*x^42 + 5*x^43) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^10 + x^11 + x^12 + x^13 + x^14 + x^15 + x^16 + x^17 + x^18)^2) + O(x^90)) \\ Colin Barker, Aug 11 2019
    

Formula

For k >= 1:
a(19*k-11) = 2,
a(19*k-10) = 19*k-10,
a(19*k-9) = 3,
a(19*k-8) = 19*k-8,
a(19*k-7) = 3,
a(19*k-6) = 6,
a(19*k-5) = 4,
a(19*k-4) = 19*k-5,
a(19*k-3) = 5,
a(19*k-2) = 9,
a(19*k-1) = 19*k-3,
a(19*k) = 6,
a(19*k+1) = 19*k-4,
a(19*k+2) = 6,
a(19*k+3) = 10,
a(19*k+4) = 8,
a(19*k+5) = a(19*k+6) = a(19*k+7) = 19*k+2.
From Colin Barker, Aug 08 2019: (Start)
G.f.: x*(1 + x)*(1 + x + x^2 + 6*x^3 - x^4 + 2*x^5 + 5*x^6 - 3*x^7 + 12*x^8 - 9*x^9 + 20*x^10 - 17*x^11 + 23*x^12 - 19*x^13 + 33*x^14 - 28*x^15 + 37*x^16 - 21*x^17 + 27*x^18 - 14*x^19 + 16*x^20 - 10*x^21 + 4*x^22 + 7*x^23 + 12*x^24 - 5*x^25 + 3*x^26 + 7*x^27 - 10*x^28 + 18*x^29 - 21*x^30 + 15*x^31 - 19*x^32 + 24*x^33 - 29*x^34 + 20*x^35 - 17*x^36 + 11*x^37 - 6*x^38 + 2*x^39 - 10*x^40 + 9*x^41 - 6*x^42 + 5*x^43) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^10 + x^11 + x^12 + x^13 + x^14 + x^15 + x^16 + x^17 + x^18)^2).
a(n) = 2*a(n-19) - a(n-38) for n > 45.
(End)
Showing 1-5 of 5 results.