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.

A063882 a(n) = a(n - a(n - 1)) + a(n - a(n - 4)), with a(1) = ... = a(4) = 1.

Original entry on oeis.org

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

Views

Author

Theodor Schlickmann (Theodor.Schlickmann(AT)cec.eu.int), Aug 28 2001

Keywords

Comments

A captivating recursive function. A meta-Fibonacci recursion.
This has been completely analyzed by Balamohan et al. They prove that the sequence a(n) is monotonic, with successive terms increasing by 0 or 1, so the sequence hits every positive integer.
They demonstrate certain special structural properties and periodicities of the associated frequency sequence (the number of times a(n) hits each positive integer) that make possible an iterative computation of a(n) for any value of n.
Further, they derive a natural partition of the a-sequence into blocks of consecutive terms ("generations") with the property that terms in one block determine the terms in the next.
a(A202014(n)) = n and a(m) < n for m < A202014(n). [Reinhard Zumkeller, Dec 08 2011]

Crossrefs

Cf. A132157. For partial sums see A129632.
A136036(n) = a(n+1) - a(n).
Cf. A202016 (occur only once).

Programs

  • Haskell
    a063882 n = a063882_list !! (n-1)
    a063882_list = 1 : 1 : 1 : 1 : zipWith (+)
       (map a063882 $ zipWith (-) [5..] a063882_list)
       (map a063882 $ zipWith (-) [5..] $ drop 3 a063882_list)
    -- Reinhard Zumkeller, Dec 08 2011
  • Maple
    a := proc(n) option remember; if n<=4 then 1 else if n > a(n-1) and n > a(n-4) then RETURN(a(n-a(n-1))+a(n-a(n-4))); else ERROR(" died at n= ", n); fi; fi; end;
  • Mathematica
    a[1]=a[2]=a[3]=a[4]=1;a[n_]:=a[n]=a[n-a[n-1]]+a[n-a[n-4]];Table[a[n],{n,80}]

Formula

n/2 < a(n) <= n/2 + log_2 (n) - 1 for all n > 6 [Balamohan et al., Proposition 5].

Extensions

Edited by N. J. A. Sloane, Nov 06 2007
Mathematica program corrected by Harvey P. Dale, Jan 24 2025

A240811 a(n) = length (or lifetime) of the meta-Fibonacci sequence f(1) = ... = f(n) = 1; f(k)=f(k-f(k-2))+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

14, 54, 0, 37, 30, 63, 368, 47, 46, 108, 188, 118, 62, 209, 126, 197, 78, 127, 190, 141, 94, 130, 138, 226, 110, 134, 158, 138, 126, 170, 242, 371, 142, 190, 178, 225, 158, 206, 214, 304, 174, 226, 238, 245, 190, 250, 262, 328, 206, 234, 278, 357, 222, 290
Offset: 2

Views

Author

N. J. A. Sloane, Apr 15 2014

Keywords

Comments

The term a(4) = 0 is only conjectural.

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

Cf. A063892, A087777, A240817 (sequences for n=3..5).
See A240814 for another version.
A diagonal of the triangle in A240813.

Extensions

More terms from Lars Blomberg, Oct 24 2014

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

Original entry on oeis.org

1, 1, 1, 5, 6, 4, 5, 6, 6, 9, 10, 5, 6, 12, 12, 15, 16, 5, 6, 18, 18, 21, 22, 5, 6, 24, 24, 27, 28, 5, 6, 30, 30, 33, 34, 5, 6, 36, 36, 39, 40, 5, 6, 42, 42, 45, 46, 5, 6, 48, 48, 51, 52, 5, 6, 54, 54, 57, 58, 5, 6, 60, 60, 63, 64, 5, 6, 66, 66, 69, 70, 5, 6, 72, 72, 75, 76, 5, 6, 78, 78, 81, 82, 5, 6
Offset: 1

Views

Author

Altug Alkan, May 13 2018

Keywords

Comments

A quasi-periodic solution to the recurrence a(n) = a(n-a(n-2)) + a(n-a(n-4)). Although A087777 and A240809 are highly chaotic, this sequence is completely predictable thanks to its initial conditions.

Crossrefs

Programs

  • PARI
    q=vector(85); q[1]=1;q[2]=1;q[3]=1;q[4]=5;q[5]=6;q[6]=4; for(n=7, #q, q[n] = q[n-q[n-2]]+q[n-q[n-4]]); q

Formula

a(6*k) = 5, a(6*k+1) = 6, a(6*k+2) = a(6*k+3) = 6*k, a(6*k+4) = 6*k+3, a(6*k+5) = 6*k+4 for k > 1.
Conjectures from Colin Barker, May 14 2018: (Start)
G.f.: x*(1 - x + 2*x^2 + 2*x^3 + 2*x^5 - x^6 + 4*x^7 - 3*x^8 + x^9 - x^10 - 2*x^11 + 2*x^12 - x^13 + x^14 + x^15 - x^16) / ((1 - x)^2*(1 - x + x^2)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-1) - 3*a(n-2) + 4*a(n-3) - 5*a(n-4) + 6*a(n-5) - 5*a(n-6) + 4*a(n-7) - 3*a(n-8) + 2*a(n-9) - a(n-10) for n>17.
(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
    

A304622 a(n) = 11 - n for 1 <= n <= 10. Thereafter a(n) = a(n-a(n-2)) + a(n-a(n-4)).

Original entry on oeis.org

10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 6, 8, 10, 15, 8, 13, 6, 14, 16, 9, 14, 13, 6, 14, 22, 18, 20, 16, 6, 23, 28, 15, 26, 22, 6, 29, 34, 15, 32, 28, 6, 35, 40, 15, 38, 34, 6, 41, 46, 15, 44, 40, 6, 47, 52, 15, 50, 46, 6, 53, 58, 15, 56, 52, 6, 59, 64, 15, 62, 58, 6, 65, 70, 15, 68, 64, 6, 71
Offset: 1

Views

Author

Altug Alkan, May 15 2018

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) option remember; procname(n-procname(n-2))+procname(n-procname(n-4)) end proc:
    for i from 1 to 10 do f(i):= 11-i od:
    map(f, [$1..100]); # Robert Israel, May 16 2018
  • PARI
    q=vector(10^5); for(n=1, 10, q[n]=10-n+1); for(n=11, #q, q[n]=q[n-q[n-2]]+ q[n-q[n-4]]); q

Formula

a(6*k-3) = 6*(k-1)-4, a(6*k-2) = 6*(k-2)-2, a(6*k-1) = 6, a(6*k) = 6*(k-1)-1, a(6*k+1) = 6*k-2, a(6*k+2) = 15 for k > 4.
Showing 1-5 of 5 results.