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 11-20 of 37 results. Next

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.

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

Original entry on oeis.org

1, 3, 6, 6, 2, 6, 4, 6, 10, 12, 6, 12, 10, 9, 16, 18, 6, 16, 18, 9, 22, 24, 6, 22, 24, 9, 28, 30, 6, 28, 30, 9, 34, 36, 6, 34, 36, 9, 40, 42, 6, 40, 42, 9, 46, 48, 6, 46, 48, 9, 52, 54, 6, 52, 54, 9, 58, 60, 6, 58, 60, 9, 64, 66, 6, 64, 66, 9, 70, 72, 6, 70, 72, 9, 76, 78, 6, 76, 78, 9, 82, 84, 6, 82, 84, 9, 88
Offset: 1

Views

Author

Altug Alkan, Aug 05 2019

Keywords

Comments

A well-defined solution sequence for recurrence a(n) = a(n-a(n-4)) + a(n-a(n-5)).

Crossrefs

Programs

  • Magma
    I:=[1,3,6,6,2,6,4];[n le 7 select I[n] else Self(n-Self(n-4))+Self(n-Self(n-5)): n in [1..90]]; // Marius A. Burtea, Aug 07 2019
  • Mathematica
    a[n_] := a[n] = If[n < 8, {1, 3, 6, 6, 2, 6, 4}[[n]], a[n - a[n-4]] + a[n - a[n-5]]]; Array[a, 87] (* Giovanni Resta, Aug 07 2019 *)
  • PARI
    q=vector(100); q[1]=1; q[2]=3; q[3]=q[4]=q[6]=6; q[5]=2; q[7]=4; for(n=8, #q, q[n] = q[n-q[n-4]]+q[n-q[n-5]]); q
    
  • PARI
    Vec(x*(1 + 3*x + 6*x^2 + 5*x^3 - x^4 - 3*x^6 + x^7 - 2*x^8 + 3*x^9 + x^10 + 2*x^11 - x^13 - 3*x^16 - 2*x^17 + 2*x^18 + 2*x^20 - 2*x^21) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)^2) + O(x^80)) \\ Colin Barker, Aug 15 2019
    

Formula

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

A269328 An eventually quasilinear solution to Hofstadter's Q recurrence.

Original entry on oeis.org

5, 2, 0, 3, 6, 5, 2, 5, 5, 12, 5, 2, 10, 5, 18, 5, 2, 15, 5, 24, 5, 2, 20, 5, 30, 5, 2, 25, 5, 36, 5, 2, 30, 5, 42, 5, 2, 35, 5, 48, 5, 2, 40, 5, 54, 5, 2, 45, 5, 60, 5, 2, 50, 5, 66, 5, 2, 55, 5, 72, 5, 2, 60, 5, 78, 5, 2, 65, 5, 84, 5, 2, 70, 5, 90
Offset: 1

Views

Author

Nathan Fox, Feb 23 2016

Keywords

Comments

a(n) is the solution to the recurrence relation a(n) = a(n-a(n-1)) + a(n-a(n-2)) [Hofstadter's Q recurrence], with the initial conditions: a(n) = 0 if n <= 0; a(1) = 5, a(2) = 2, a(3) = 0, a(4) = 3, a(5) = 6, a(6) = 5, a(7) = 2.
Starting from n=5, this sequence consists of five interleaved linear sequences with three different slopes.
Square array read by rows: T(j,k), j>=1, 1<=k<=5, in which row j list [5, 2, 5*(j-1), 5, 6*j], except T(1,4) = 3, not 5. - Omar E. Pol, Jun 22 2016

Examples

			From _Omar E. Pol_, Jun 22 2016: (Start)
Written as a square array T(j,k) with five columns the sequence begins:
5, 2,  0, 3,  6;
5, 2,  5, 5, 12;
5, 2, 10, 5, 18;
5, 2, 15, 5, 24;
5, 2, 20, 5, 30;
5, 2, 25, 5, 36;
5, 2, 30, 5, 42;
5, 2, 35, 5, 48;
5, 2, 40, 5, 54;
5, 2, 45, 5, 60;
5, 2, 50, 5, 66;
5, 2, 55, 5, 72;
5, 2, 60, 5, 78;
5, 2, 65, 5, 84;
5, 2, 70, 5, 90;
...
Note that T(1,4) = 3, not 5. (End)
		

Crossrefs

Programs

  • Magma
    I:=[5,2,0,3,6,5,2,5,5,12,5,2,10,5]; [n le 14 select I[n] else 2*Self(n-5)-Self(n-10): n in [1..100]]; // Vincenzo Librandi, Dec 16 2018
  • Mathematica
    Join[{5, 2, 0, 3}, LinearRecurrence[{0, 0, 0, 0, 2, 0, 0, 0, 0, -1} , {6, 5, 2, 5, 5, 12, 5, 2, 10, 5}, 80]] (* Jean-François Alcover, Dec 16 2018 *)
    CoefficientList[Series[(-2 x^13 - x^8 + 5 x^7 - 2 x^6 - 5 x^5 + 6 x^4 + 3 x^3 + 2 x + 5) / (x^10 - 2 x^5 + 1), {x, 0, 100}], x] (* Vincenzo Librandi, Dec 16 2018 *)

Formula

a(4) = 3; otherwise a(5n) = 6n, a(5n+1) = 5, a(5n+2) = 2, a(5n+3) = 5n, a(5n+4) = 5.
From Chai Wah Wu, Jun 22 2016: (Start)
a(n) = 2*a(n-5) - a(n-10) for n > 14.
G.f.: x*(-2*x^13 - x^8 + 5*x^7 - 2*x^6 - 5*x^5 + 6*x^4 + 3*x^3 + 2*x + 5)/(x^10 - 2*x^5 + 1). (End)

A275361 An eventually quasilinear solution to Hofstadter's Q-recurrence.

Original entry on oeis.org

0, 4, -40, -9, 8, -8, 7, 1, 5, 13, -24, -1, 8, 8, 8, 1, 5, 13, -8, 7, 8, 8, 23, 1, 5, 13, 8, 15, 8, 16, 31, 1, 5, 13, 24, 23, 8, 24, 39, 1, 5, 13, 40, 31, 8, 32, 47, 1, 5, 13, 56, 39, 8, 40, 55, 1, 5, 13, 72, 47, 8, 48, 63, 1, 5, 13, 88, 55, 8, 56, 71
Offset: 1

Views

Author

Nathan Fox, Jul 24 2016

Keywords

Comments

a(n) is the solution to the recurrence relation a(n) = a(n-a(n-1)) + a(n-a(n-2)) [Hofstadter's Q recurrence], with the first 45 terms as initial conditions.
This is a quasilinear sequence with quasiperiod 8. Four of the component sequences are constant, three have slope 1, and one has slope 2.

Crossrefs

Programs

  • Mathematica
    Join[{0, 4, -40, -9, 8, -8, 7, 1, 5, 13, -24, -1, 8, 8, 8}, LinearRecurrence[ {0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, -1}, {1, 5, 13, -8, 7, 8, 8, 23, 1, 5, 13, 8, 15, 8, 16, 31}, 100]] (* Jean-François Alcover, Dec 12 2018 *)

Formula

a(1) = 0, a(2) = 4, a(14) = 8, a(15) = 8; otherwise:
a(8n) = 1, a(8n+1) = 5, a(8n+2) = 13, a(8n+3) = 16n-40, a(8n+4) = 8n-9, a(8n+5) = 8, a(8n+6) = 8n-8, a(8n+7) = 8n+7.
a(n) = 2*a(n-8) - a(n-16) for n>31.
G.f.: -(7*x^30 -8*x^29 -14*x^22 +16*x^21 +9*x^17 +5*x^16 +x^15 +6*x^14 -24*x^13 +8*x^12 -17*x^11 -56*x^10 -5*x^9 -5*x^8 -x^7 -7*x^6 +8*x^5 -8*x^4 +9*x^3 +40*x^2 -4*x)/((x-1)^2*(x+1)^2*(x^2+1)^2*(x^4+1)^2).

A275362 An eventually quasilinear solution to Hofstadter's Q recurrence.

Original entry on oeis.org

-9, 2, 9, 2, 0, 7, 9, 10, 3, 0, 2, 9, 2, 9, 9, 9, 20, 3, 9, 22, 9, 2, 18, 9, 18, 30, 3, 18, 32, 9, 2, 27, 9, 27, 40, 3, 27, 42, 9, 2, 36, 9, 36, 50, 3, 36, 52, 9, 2, 45, 9, 45, 60, 3, 45, 62, 9, 2, 54, 9, 54, 70, 3, 54, 72, 9, 2, 63, 9, 63, 80, 3, 63, 82
Offset: 1

Views

Author

Nathan Fox, Jul 24 2016

Keywords

Comments

a(n) is the solution to the recurrence relation a(n) = a(n-a(n-1)) + a(n-a(n-2)) [Hofstadter's Q recurrence], with the initial conditions: a(n) = 0 if n <= 0; a(1) = -9, a(2) = 2, a(3) = 9, a(4) = 2, a(5) = 0, a(6) = 7, a(7) = 9, a(8) = 10, a(9) = 3, a(10) = 0, a(11) = 2, a(12) = 9, a(13) = 2, a(14) = 9, a(15) = 9, a(16) = 9.
This is a quasilinear sequence with quasiperiod 9. Four of the component sequences are constant, three have slope 1, and two have slope 10/9.

Crossrefs

Programs

  • Mathematica
    Join[{-9, 2, 9, 2, 0, 7, 9, 10, 3, 0, 2}, LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, -1}, {9, 2, 9, 9, 9, 20, 3, 9, 22, 9, 2, 18, 9, 18, 30, 3, 18, 32}, 100]] (* Jean-François Alcover, Dec 13 2018 *)

Formula

a(6) = 7, a(7) = 9, a(11) = 2; otherwise:
a(9n) = 3, a(9n+1) = 9n-9, a(9n+2) = 10n+2, a(9n+3) = 9, a(9n+4) = 2, a(9n+5) = 9n, a(9n+6) = 9, a(9n+7) = 9n, a(9n+8) = 10n+10.
a(n) = 2*a(n-9) - a(n-18) for n>29.
G.f.: -(10*x^28 -9*x^24 +2*x^23 -20*x^19 +3*x^17 +9*x^15 +5*x^14 -9*x^13 +2*x^12 +9*x^11 +2*x^10 -18*x^9 -3*x^8 -10*x^7 -9*x^6 -7*x^5 -2*x^3 -9*x^2 -2*x+9)/((x-1)^2*(x^2+x+1)^2*(x^6+x^3+1)^2).

A283878 An eventually quasilinear solution to Hofstadter's Q recurrence.

Original entry on oeis.org

0, 2, 3, 1, 3, 6, 1, 3, 9, 1, 3, 12, 1, 3, 15, 1, 3, 18, 1, 3, 21, 1, 3, 24, 1, 3, 27, 1, 3, 30, 1, 3, 33, 1, 3, 36, 1, 3, 39, 1, 3, 42, 1, 3, 45, 1, 3, 48, 1, 3, 51, 1, 3, 54, 1, 3, 57, 1, 3, 60, 1, 3, 63, 1, 3, 66, 1, 3, 69, 1, 3, 72, 1, 3, 75
Offset: 1

Views

Author

Nathan Fox, Mar 19 2017

Keywords

Comments

a(n) is the solution to the recurrence relation a(n) = a(n-a(n-1)) + a(n-a(n-2)) [Hofstadter's Q recurrence], with the initial conditions: a(n) = 0 if n <= 0; a(1) = 0, a(2) = 2, a(3) = 3, a(4) = 1.

Crossrefs

Programs

  • Maple
    A283878:=proc(n) option remember: if n <= 0 then 0: elif n = 1 then 0: elif n = 2 then 2: elif n = 3 then 3: elif n = 4 then 1: else A283878(n-A283878(n-1)) + A283878(n-A283878(n-2)): fi: end:

Formula

G.f.: (-x*(x^6 + x^5 + x^3 - x^2 - 3*x - 2)) / ((-1 + x)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-3) - a(n-6) for n > 8.
a(1) = 0, a(2) = 2; thereafter a(3*k) = 3*k, a(3*k+1) = 1, a(3*k+2) = 3.

A283879 An eventually quasilinear solution to Hofstadter's Q recurrence.

Original entry on oeis.org

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

Views

Author

Nathan Fox, Mar 19 2017

Keywords

Comments

a(n) is the solution to the recurrence relation a(n) = a(n-a(n-1)) + a(n-a(n-2)) [Hofstadter's Q recurrence], with the initial conditions: a(n) = 0 if n <= 0; a(1) = 4, a(2) = 1, a(3) = 0, a(4) = 3, a(5) = 3, a(6) = 1, a(7) = 4, a(8) = 8.

Crossrefs

Programs

  • Maple
    A283879:=proc(n) option remember: if n <= 0 then 0: elif n = 1 then 4: elif n = 2 then 1: elif n = 3 then 0: elif n = 4 then 3: elif n = 5 then 3: elif n = 6 then 1: elif n = 7 then 4: elif n = 8 then 8: else A283879(n-A283879(n-1)) + A283879(n-A283879(n-2)): fi: end:
  • Mathematica
    LinearRecurrence[{1,-1,1,1,-1,1,-1},{4,1,0,3,3,1,4,8,7,1,4},80] (* Harvey P. Dale, May 25 2025 *)

Formula

a(1) = 4, a(4) = 3; otherwise a(4n) = 4n, a(4n+1) = 4n-1, a(4n+2) = 1, a(4n+3) = 4.
G.f.: (-x^10-3*x^9+3*x^8+2*x^7+4*x^5-5*x^4+3*x^2-3*x+4) / ((1+x)*(-1+x)^2*(1+x^2)^2).
a(n) = a(n-1) - a(n-2) + a(n-3) + a(n-4) - a(n-5) + a(n-6) - a(n-7) for n > 11.

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)

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.

A275363 a(1)=3, a(2)=6, a(3)=3; thereafter a(n) = a(n-a(n-1)) + a(n-1-a(n-2)).

Original entry on oeis.org

3, 6, 3, 3, 9, 6, 3, 12, 9, 3, 15, 12, 3, 18, 15, 3, 21, 18, 3, 24, 21, 3, 27, 24, 3, 30, 27, 3, 33, 30, 3, 36, 33, 3, 39, 36, 3, 42, 39, 3, 45, 42, 3, 48, 45, 3, 51, 48, 3, 54, 51, 3, 57, 54, 3, 60, 57, 3, 63, 60, 3, 66, 63, 3, 69, 66, 3, 72, 69
Offset: 1

Views

Author

Nathan Fox, Jul 24 2016

Keywords

Comments

Same recurrence as in A046699 but with different starting values.
This sequence is quasilinear.

Crossrefs

Programs

  • Mathematica
    Flatten[Array[{3, 3*# + 6, 3*# + 3} &, 30, 0]] (* Paolo Xausa, Oct 23 2024 *)
    LinearRecurrence[{0,0,2,0,0,-1},{3,6,3,3,9,6},80] (* Harvey P. Dale, Nov 27 2024 *)

Formula

a(3n) = 3n, a(3n+1) = 3, a(3n+2) = 3n+6.
a(n) = 2*a(n-3) - a(n-6) for n>6.
G.f.: -(3*x^4 +3*x^3 -3*x^2 -6*x-3)/((x-1)^2*(x^2+x+1)^2).
Previous Showing 11-20 of 37 results. Next