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-6 of 6 results.

A046699 a(1) = a(2) = 1, a(n) = a(n - a(n-1)) + a(n-1 - a(n-2)) if n > 2.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Ignoring first term, this is the meta-Fibonacci sequence for s=0. - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
Except for the first term, n occurs A001511(n) times. - Franklin T. Adams-Watters, Oct 22 2006

References

  • Sequence was proposed by Reg Allenby.
  • B. W. Conolly, "Meta-Fibonacci sequences," in S. Vajda, editor, Fibonacci and Lucas Numbers and the Golden Section. Halstead Press, NY, 1989, pp. 127-138. See Eq. (2).
  • Michael Doob, The Canadian Mathematical Olympiad & L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society & Société Mathématique du Canada, Problem 5, 1990, pp. 212-213, 1993.
  • S. Vajda, Fibonacci and Lucas Numbers and the Golden Section, Wiley, 1989, see p. 129.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

Callaghan et al. (2005)'s sequences T_{0,k}(n) for k=1 through 7 are A000012, A046699, A046702, A240835, A241154, A241155, A240830.

Programs

  • Haskell
    a046699 n = a046699_list !! (n-1)
    a046699_list = 1 : 1 : zipWith (+) zs (tail zs) where
       zs = map a046699 $ zipWith (-) [2..] a046699_list
    -- Reinhard Zumkeller, Jan 02 2012
    
  • Magma
    [ n le 2 select 1 else Self(n - Self(n-1)) + Self(n-1 -Self(n-2)):n in [1..80]]; // Marius A. Burtea, Oct 17 2019
  • Maple
    a := proc(n) option remember; if n <= 1 then return 1 end if; if n <= 2 then return 2 end if; return add(a(n - i + 1 - a(n - i)), i = 1 .. 2) end proc # Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
    a := proc(n) option remember; if n <= 2 then 1 else a(n - a(n-1)) + a(n-1 - a(n-2)); fi; end; # N. J. A. Sloane, Apr 16 2014
  • Mathematica
    a[n_] := (k = 1; While[ !Divisible[(2*++k)!, 2^(n-1)]]; k); a[1] = a[2] = 1; Table[a[n], {n, 1, 72}] (* Jean-François Alcover, Oct 06 2011, after Benoit Cloitre *)
    CoefficientList[ Series[1 + x/(1 - x)*Product[1 + x^(2^n - 1), {n, 6}], {x, 0, 80}], x] (* or *)
    a[1] = a[2] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - 1 - a[n - 2]]; Array[a, 80] (* Robert G. Wilson v, Sep 08 2014 *)
  • Maxima
    a[1]:1$
    a[2]:1$
    a[n]:=a[n-a[n-1]]+a[n-1-a[n-2]]$
    makelist(a[n],n,2,60); /* Martin Ettl, Oct 29 2012 */
    
  • PARI
    a(n)=if(n<0,1,s=1;while((2*s)!%2^(n-1)>0,s++);s) \\ Benoit Cloitre, Jan 19 2007
    
  • Python
    from sympy import factorial
    def a(n):
        if n<3: return 1
        s=1
        while factorial(2*s)%(2**(n - 1))>0: s+=1
        return s
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 11 2017, after Benoit Cloitre
    

Formula

First differences seem to be A079559. - Vladeta Jovovic, Nov 30 2003. This is correct and not too hard to prove, giving the generating function x + x^2(1+x)(1+x^3)(1+x^7)(1+x^15).../(1-x). - Paul Boddington, Jul 30 2004
G.f.: x + x^2/(1-x) * Product_{n=1}^{infinity} (1 + x^(2^n-1)). - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
For n>=1, a(n)=w(n-1) where w(n) is the least k such that 2^n divides (2k)!. - Benoit Cloitre, Jan 19 2007
Conjecture: a(n+1) = a(n) + A215530(a(n) + n) for all n > 0. - Velin Yanev, Oct 17 2019
From Bernard Schott, Dec 03 2021: (Start)
a(n) <= a(n+1) <= a(n) +1.
For n > 1, if a(n) is odd, then a(n+1) = a(n) + 1.
a(2^n+1) = 2^(n-1) + 1 for n > 0.
Results coming from the 5th problem proposed during the 22nd Canadian Mathematical Olympiad in 1990 (link IMO Compendium and Doob reference). (End)

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

Original entry on oeis.org

1, 1, 1, 3, 3, 3, 5, 5, 7, 5, 7, 7, 9, 9, 9, 11, 11, 13, 11, 15, 13, 17, 13, 17, 15, 19, 17, 19, 17, 21, 19, 23, 19, 23, 21, 25, 23, 25, 25, 27, 27, 27, 29, 29, 31, 29, 33, 31, 35, 31, 37, 33, 39, 33, 41, 35, 43, 35, 43, 37, 45, 39, 45, 39, 47, 41, 49, 41, 49, 43, 51, 45, 51, 45
Offset: 1

Views

Author

Keywords

References

  • Sequence proposed by Reg Allenby.
  • Callaghan, Joseph, John J. Chew III, and Stephen M. Tanny. "On the behavior of a family of meta-Fibonacci sequences." SIAM Journal on Discrete Mathematics 18.4 (2005): 794-824. See T_{0,3} with initial values 1,1,1, as in Fig. 1.6. - N. J. A. Sloane, Apr 16 2014

Crossrefs

Callaghan et al. (2005)'s sequences T_{0,k}(n) for k=1 through 7 are A000012, A046699, A046702, A240835, A241154, A241155, A240830.

Programs

  • Maple
    #T_s,k(n) from Callaghan et al. Eq. (1.6). - From N. J. A. Sloane, Apr 16 2014
    s:=0; k:=3;
    a:=proc(n) option remember; global s,k;
    if n <= 2 then 1
    elif n = 3 then 1
    else
        add(a(n-i-s-a(n-i-1)),i=0..k-1);
    fi; end;
    t1:=[seq(a(n),n=1..100)];
  • Mathematica
    a[n_] := a[n] = a[n-a[n-1]] + a[n-1-a[n-2]] + a[n-2-a[n-3]]; a[1] = a[2] = a[3] = 1; Array[a, 80] (* Jean-François Alcover, Dec 12 2016 *)

Extensions

Corrected and extended by Michael Somos

A240830 a(n)=1 for n <= s+k; thereafter a(n) = Sum(a(n-i-s-a(n-i-1)),i=0..k-1) where s=0, k=7.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, 7, 7, 13, 13, 13, 13, 13, 13, 19, 13, 19, 19, 19, 19, 25, 19, 25, 19, 25, 25, 31, 25, 31, 25, 31, 25, 31, 31, 37, 31, 37, 31, 37, 37, 37, 37, 43, 37, 43, 43, 43, 43, 43, 43, 49, 49, 49, 49, 49, 49, 49, 55, 55, 55, 55, 55, 55, 61, 55, 61, 61, 61, 61, 67, 61, 67, 61, 67, 67, 73
Offset: 1

Views

Author

N. J. A. Sloane, Apr 16 2014

Keywords

Crossrefs

Same recurrence as A240828, A120503 and A046702.
See also A240831, A240832.
Callaghan et al. (2005)'s sequences T_{0,k}(n) for k=1 through 7 are A000012, A046699, A046702, A240835, A241154, A241155, A240830.

Programs

  • Maple
    #T_s,k(n) from Callaghan et al. Eq. (1.7).
    s:=0; k:=7;
    a:=proc(n) option remember; global s,k;
    if n <= s+k then 1
    else
        add(a(n-i-s-a(n-i-1)),i=0..k-1);
    fi; end;
    t1:=[seq(a(n),n=1..100)];
  • Mathematica
    A240830[n_]:=A240830[n]=If[n<=7,1,Sum[A240830[n-i-A240830[n-i-1]],{i,0,6}]];
    Array[A240830,100] (* Paolo Xausa, Dec 06 2023 *)

A240835 a(n)=1 for n <= s+k; thereafter a(n) = Sum_{i=0..k-1} a(n-i-s-a(n-i-1)) where s=0, k=4.

Original entry on oeis.org

1, 1, 1, 1, 4, 4, 4, 4, 7, 7, 7, 10, 7, 10, 13, 10, 13, 13, 13, 16, 16, 16, 16, 16, 19, 19, 19, 22, 19, 22, 25, 22, 25, 25, 25, 28, 28, 28, 28, 31, 31, 31, 34, 31, 34, 37, 34, 37, 37, 34, 40, 40, 37, 43, 40, 40, 46, 43, 43, 46, 46, 46, 49, 49, 46, 52, 52, 49, 55, 52, 52, 58, 55, 55, 58, 55, 58, 61, 58, 61, 61, 61
Offset: 1

Views

Author

N. J. A. Sloane, Apr 16 2014

Keywords

Crossrefs

Callaghan et al. (2005)'s sequences T_{0,k}(n) for k=1 through 7 are A000012, A046699, A046702, A240835, A241154, A241155, A240830.

Programs

  • Maple
    #T_s,k(n) from Callaghan et al. Eq. (1.7).
    s:=0; k:=4;
    a:=proc(n) option remember; global s,k;
    if n <= s+k then 1
    else
        add(a(n-i-s-a(n-i-1)),i=0..k-1);
    fi; end;
    t1:=[seq(a(n),n=1..100)];
  • Mathematica
    A240835[n_]:=A240835[n]=If[n<=4,1,Sum[A240835[n-i-A240835[n-i-1]],{i,0,3}]];
    Array[A240835,100] (* Paolo Xausa, Dec 06 2023 *)

A241155 a(n)=1 for n <= s+k; thereafter a(n) = Sum_{i=0..k-1} a(n-i-s-a(n-i-1)) where s=0, k=6.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 6, 6, 6, 6, 6, 6, 11, 11, 11, 11, 11, 16, 11, 16, 16, 16, 21, 16, 21, 16, 21, 26, 21, 26, 21, 26, 26, 26, 31, 26, 31, 31, 31, 31, 31, 36, 36, 36, 36, 36, 36, 36, 41, 41, 41, 41, 41, 46, 41, 46, 46, 46, 51, 46, 51, 46, 51, 56, 51, 56, 51, 56, 56, 56, 61, 56, 61, 61, 61, 61, 61, 66, 66, 66, 66, 66
Offset: 1

Views

Author

N. J. A. Sloane, Apr 16 2014

Keywords

Crossrefs

Callaghan et al. (2005)'s sequences T_{0,k}(n) for k=1 through 7 are A000012, A046699, A046702, A240835, A241154, A241155, A240830.

Programs

  • Maple
    #T_s,k(n) from Callaghan et al. Eq. (1.7).
    s:=0; k:=6;
    a:=proc(n) option remember; global s,k;
    if n <= s+k then 1
    else
    add(a(n-i-s-a(n-i-1)),i=0..k-1);
    fi; end;
    t1:=[seq(a(n),n=1..100)];
  • Mathematica
    A241155[n_]:=A241155[n]=If[n<=6,1,Sum[A241155[n-i-A241155[n-i-1]],{i,0,5}]];
    Array[A241155,100] (* Paolo Xausa, Dec 06 2023 *)

A259615 a(0)=0, a(1)=a(2)=a(3)=a(4)=1; thereafter, a(n) = Sum_{k=1..5} a(n-k-(a(n-k) mod 5)).

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 4, 5, 9, 9, 11, 19, 23, 27, 45, 87, 105, 205, 401, 587, 747, 1121, 1763, 2145, 4085, 7965, 15529, 16545, 32503, 38323, 49767, 74305, 146847, 180069, 210427, 341745, 650987, 787109, 917411
Offset: 0

Views

Author

Anders Hellström, Jun 30 2015

Keywords

Crossrefs

Cf. A000322, A241154 (sequence obtained without mod 5 in formula).

Programs

  • Ruby
    def first(m)
        v=[0,1,1,1,1]
        for i in 5..m-1
          i2=0
          for j in 1..5
            r=i-j
            i2 += v[r-v[r]%5]
          end
          v << i2
        end
        v
    end
  • Sage
    def first(m):
        v=[0,1,1,1,1]
        for i in range(5,m+1):
          l=0
          for s in range(1,5+1):
            l += v[i-s-v[i-s]%5]
          v.append(l)
        return v
    
Showing 1-6 of 6 results.