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.

Previous Showing 21-30 of 30 results.

A285762 A slow relative of Hofstadter's Q sequence.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 9, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 21, 21, 21, 22, 23, 24, 24, 24, 24, 24, 24, 24, 25, 26, 27, 27, 27, 27, 28
Offset: 1

Views

Author

Nathan Fox, Apr 25 2017

Keywords

Comments

a(n) is the solution to the recurrence relation a(n) = a(n-12-a(n-3)) + a(n-12-a(n-12)), with a(1) through a(33) as initial conditions.
The sequence a(n) is monotonic, with successive terms increasing by 0 or 1. So the sequence hits every positive integer.
This sequence can be obtained from A285761 using a construction of Isgur et al.

Crossrefs

Programs

  • Maple
    A285762:=proc(n) option remember: if n <= 0 then 0: elif n = 1 then 1: elif n = 2 then 2: elif n = 3 then 3: elif n = 4 then 4: elif n = 5 then 5: elif n = 6 then 6: elif n = 7 then 7: elif n = 8 then 8: elif n = 9 then 9: elif n = 10 then 9: elif n = 11 then 9: elif n = 12 then 9: elif n = 13 then 9: elif n = 14 then 9: elif n = 15 then 9: elif n = 16 then 10: elif n = 17 then 11: elif n = 18 then 12: elif n = 19 then 12: elif n = 20 then 12: elif n = 21 then 12: elif n = 22 then 12: elif n = 23 then 12: elif n = 24 then 12: elif n = 25 then 13: elif n = 26 then 14: elif n = 27 then 15: elif n = 28 then 15: elif n = 29 then 15: elif n = 30 then 15: elif n = 31 then 15: elif n = 32 then 15: elif n = 33 then 15: else A285762(n-12-A285762(n-3)) + A285762(n-12-A285762(n-12)): fi: end:

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]
    				

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

Original entry on oeis.org

4, 2, 5, 3, 1, 4, 7, 5, 8, 6, 4, 12, 5, 13, 6, 9, 17, 5, 18, 6, 9, 22, 5, 23, 11, 9, 27, 5, 28, 11, 9, 32, 5, 33, 11, 14, 37, 5, 38, 11, 14, 42, 5, 43, 11, 14, 47, 5, 48, 16, 14, 52, 5, 53, 16, 14, 57, 5, 58, 16, 14, 62, 5, 63, 16, 19, 67, 5, 68, 16, 19, 72, 5, 73, 16, 19, 77, 5, 78, 16, 19, 82, 5, 83, 21, 19, 87, 5
Offset: 1

Views

Author

Altug Alkan and Rémy Sigrist, Aug 08 2019

Keywords

Comments

A well-defined quasi-periodic solution for Hofstadter V recurrence (a(n) = a(n-a(n-1)) + a(n-a(n-4))).

Crossrefs

Programs

  • Maple
    f:= proc(n) local k,j;
      j:= n mod 5;
      k:= (n-j)/5;
      if j=0 then 5*floor(sqrt(k-1))+1
      elif j=1 then 5*round(sqrt(k))-1
      elif j=2 then 5*k+2
      elif j=3 then 5
      else 5*k+3
      fi
    end proc:
    f(1):= 4:
    map(f, [$1..100]); # Robert Israel, Aug 08 2019
  • Mathematica
    a[n_] := a[n] = If[n < 6, {4, 2, 5, 3, 1}[[n]], a[n - a[n-1]] + a[n - a[n-4]]]; Array[a, 88] (* Giovanni Resta, Aug 08 2019 *)
  • PARI
    q=vector(100); q[1]=4; q[2]=2; q[3]=5; q[4]=3; q[5]=1; for(n=6, #q, q[n]=q[n-q[n-1]]+q[n-q[n-4]]); q

Formula

For k >= 1:
a(5*k) = 5*floor(sqrt(k-1))+1,
a(5*k+1) = 5*round(sqrt(k))-1,
a(5*k+2) = 5*k+2,
a(5*k+3) = 5,
a(5*k+4) = 5*k+3.

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

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

Original entry on oeis.org

3, 1, 4, 2, 5, 3, 6, 4, 7, 10, 8, 6, 9, 7, 10, 13, 6, 14, 12, 10, 18, 6, 14, 17, 10, 23, 11, 14, 22, 10, 28, 16, 14, 27, 10, 33, 16, 14, 32, 10, 38, 16, 19, 37, 10, 43, 16, 24, 42, 10, 48, 16, 24, 47, 10, 53, 16, 24, 52, 10, 58, 16, 24, 57, 10, 63, 21, 24, 62, 10, 68, 26, 24, 67, 10
Offset: 1

Views

Author

Altug Alkan and Nathan Fox, Aug 10 2019

Keywords

Comments

A well-defined quasi-periodic solution for Hofstadter V recurrence (a(n) = a(n-a(n-1)) + a(n-a(n-4))).

Crossrefs

Programs

  • Magma
    I:=[3,1,4,2,5,3]; [n le 6 select I[n] else  Self(n-Self(n-1)) + Self(n-Self(n-4)): n in [1..80]]; // Marius A. Burtea, Aug 11 2019
  • Mathematica
    Nest[Append[#, #[[-#[[-1]] ]] + #[[-#[[-4]] ]]] &, {3, 1, 4, 2, 5, 3}, 69] (* Michael De Vlieger, May 08 2020 *)
  • PARI
    q=vector(100); q[1]=3; q[2]=1; q[3]=4; q[4]=2; q[5]=5; q[6]=3; for(n=7, #q, q[n] = q[n-q[n-1]] + q[n-q[n-4]]); q
    

Formula

For k > 1:
a(5*k) = 10,
a(5*k+1) = 5*k-2,
a(5*k+2) = 5*(floor((sqrt(2*k-1)-1)/2) + floor((sqrt(2*k-3)-1)/2)) + 6,
a(5*k+3) = 5*(floor(sqrt(k/2)) + floor(sqrt((k-1)/2))) + 4,
a(5*k+4) = 5*k-3.
Also, a(5*k+2) = 5*f(k)+1 and a(5*k+3) = 5*g(k)-1 where f(k) = g(k-g(k-1)) and g(k) = f(k-f(k))+2 with f(1) = g(1) = 1, g(2) = 2.

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

Original entry on oeis.org

1, 3, 1, 3, 4, 2, 1, 3, 3, 6, 1, 8, 3, 10, 1, 12, 3, 14, 1, 16, 3, 18, 1, 20, 3, 22, 1, 24, 3, 26, 1, 28, 3, 30, 1, 32, 3, 34, 1, 36, 3, 38, 1, 40, 3, 42, 1, 44, 3, 46, 1, 48, 3, 50, 1, 52, 3, 54, 1, 56, 3, 58, 1, 60, 3, 62, 1, 64, 3, 66, 1, 68, 3, 70, 1, 72, 3, 74, 1, 76, 3, 78, 1, 80, 3, 82, 1, 84, 3, 86
Offset: 1

Views

Author

Altug Alkan, Dec 11 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Fold[Append[#1, #2 - #1[[#2 - #1[[#2 - 1]] ]] - #1[[#2 - #1[[#2 - 4]] ]] ] &, {1, 3, 1, 3, 4}, Range[6, 90]] (* Michael De Vlieger, Dec 11 2017 *)
  • PARI
    q=vector(10^5); q[1]=1;q[2]=3;q[3]=1;q[4]=3;q[5]=4;for(n=6, #q, q[n] = n-q[n-q[n-1]]-q[n-q[n-4]]); q
    
  • PARI
    Vec(x*(1 + 3*x + 2*x^4 - 4*x^5 - 3*x^6 + x^7 - x^8 + 4*x^9 + x^10 + x^11 - x^13) / ((1 - x)^2*(1 + x)^2*(1 + x^2)) + O(x^100)) \\ Colin Barker, Dec 12 2017

Formula

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

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

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 4, 8, 11, 11, 12, 12, 12, 4, 3, 3, 13, 6, 7, 7, 9, 10, 14, 9, 9, 19, 12, 13, 14, 15, 16, 18, 15, 15, 22, 18, 19, 10, 18, 18, 23, 18, 18, 24, 24, 26, 23, 24, 30, 31, 24, 29, 25, 30, 28, 25, 27, 29, 30, 30, 33, 37, 33, 38, 35, 33, 29, 31, 36, 41, 36, 36, 42, 28, 36, 37, 53, 36, 37, 41, 48, 48, 33
Offset: 1

Views

Author

Altug Alkan, May 15 2018

Keywords

Crossrefs

Programs

  • GAP
    a:=[1,1,1,2,1,3];; for n in [7..100] do a[n]:=a[n-a[n-3]]+a[n-a[n-6]]; od; a; # Muniru A Asiru, May 19 2018
  • Maple
    f:= proc(n) option remember; procname(n-procname(n-3))+procname(n-procname(n-6)) end proc:
    for i from 1 to 6 do f(i):= [1,1,1,2,1,3][i] od:
    map(f, [$1..100]); # Robert Israel, May 16 2018
  • Mathematica
    Nest[Append[#2, #2[[#1 - #2[[-3]] ]] + #2[[#1 - #2[[-6]] ]] ] & @@ {Length@ # + 1, #} &, {1, 1, 1, 2, 1, 3}, 77] (* Michael De Vlieger, Jul 20 2018 *)
  • PARI
    q=vector(100); q[1]=q[2]=q[3]=q[5]=1;q[4]=2;q[6]=3; for(n=7, #q, q[n]=q[n-q[n-3]]+q[n-q[n-6]]); q
    

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

Original entry on oeis.org

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

Views

Author

Altug Alkan and Rémy Sigrist, Aug 13 2019

Keywords

Comments

This sequence is finite but has an exceptionally long life: a(3080193026) = 3101399868 is its last term since a(3080193027) refers to a nonpositive index and thus fails to exist. See plots in Links section to fractal-like structure of a(n)-n/2.

Crossrefs

Programs

  • Mathematica
    Nest[Append[#, #[[-#[[-1]] ]] + #[[-#[[-4]] ]]] &, {3, 4, 5, 4, 5, 6}, 94] (* Michael De Vlieger, May 08 2020 *)
  • PARI
    q=vector(100); q[1]=3; q[2]=4; q[3]=5; q[4]=4; q[5]=5; q[6]=6; for(n=7, #q, q[n] = q[n-q[n-1]] + q[n-q[n-4]]); q

Extensions

a(3080193026) from Giovanni Resta, Aug 13 2019

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

Original entry on oeis.org

1, 1, 2, 3, 8, 6, 4, 4, 9, 4, 8, 7, 9, 12, 6, 13, 7, 14, 17, 6, 18, 7, 19, 22, 6, 23, 7, 24, 27, 6, 28, 7, 29, 32, 6, 33, 7, 34, 37, 6, 38, 7, 39, 42, 6, 43, 7, 44, 47, 6, 48, 7, 49, 52, 6, 53, 7, 54, 57, 6, 58, 7, 59, 62, 6, 63, 7, 64, 67, 6, 68, 7, 69, 72, 6, 73, 7, 74, 77, 6, 78, 7
Offset: 1

Views

Author

Altug Alkan, Aug 25 2019

Keywords

Comments

A quasilinear solution sequence for Hofstadter V recurrence (a(n) = a(n-a(n-1)) + a(n-a(n-4))).

Crossrefs

Programs

  • PARI
    q=vector(100); q[1]=q[2]=1; q[3]=2; q[4]=3; q[5]=8; q[6]=6; q[7]=q[8]=4; for(n=9, #q, q[n]=q[n-q[n-1]]+q[n-q[n-4]]); q
    
  • PARI
    Vec(x*(1 + x + 2*x^2 + 3*x^3 + 8*x^4 + 4*x^5 + 2*x^6 + 3*x^8 - 12*x^9 - 3*x^10 +  3*x^12 - 3*x^13 + 6*x^14 + 3*x^15 - 3*x^16 + 2*x^18 - 2*x^19) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)^2) + O(x^40)) \\ Colin Barker, Aug 25 2019

Formula

For k > 2:
a(5*k-4) = 5*k-7,
a(5*k-3) = 7,
a(5*k-2) = 5*k-6,
a(5*k-1) = 5*k-3,
a(5*k) = 6.
From Colin Barker, Aug 25 2019: (Start)
G.f.: x*(1 + x + 2*x^2 + 3*x^3 + 8*x^4 + 4*x^5 + 2*x^6 + 3*x^8 - 12*x^9 - 3*x^10 + 3*x^12 - 3*x^13 + 6*x^14 + 3*x^15 - 3*x^16 + 2*x^18 - 2*x^19) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)^2).
a(n) = 2*a(n-5) - a(n-10) for n > 20.
(End)

A309430 a(n) = a(n-a(n-1)) + a(n-a(n-4)), with a(n) = ceiling(2*n/3) for n <= 7.

Original entry on oeis.org

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

Views

Author

Altug Alkan, Aug 01 2019

Keywords

Comments

A slow solution to Hofstadter V recurrence.
Numbers k such that a(k) < A063882(k) are 1654, 1721, 1925, ...

Crossrefs

Programs

  • PARI
    q=vector(100); for(n=1, 7, q[n]=ceil(2*n/3));for(n=8, #q, q[n]=q[n-q[n-1]] +q[n-q[n-4]]); q

Formula

a(n+1) - a(n) = 0 or 1 for all n >= 1.
Previous Showing 21-30 of 30 results.