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-3 of 3 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)

A324475 k appears t+1 times, where t is the number of trailing zeros in A324474(k).

Original entry on oeis.org

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

Views

Author

Nathan Fox and N. J. A. Sloane, Mar 09 2019

Keywords

Comments

Interesting because the recurrence is nested one layer deeper than the recurrences for A046699 and A316628.

Crossrefs

Cf. A324474.
A046699, A316628, A324473, A324477 have similar definitions.

Programs

  • PARI
    See Links section.

Formula

For n>3, a(n) = a(n-a(n-1)) + a(n-1-a(n-2)-a(n-2-a(n-2))) + a(n-2-a(n-3)-a(n-3-a(n-3)) - a(n-3-a(n-3)-a(n-3-a(n-3)))). - Nathan Fox, Mar 09 2019 (This formula assumes that a(0) = 0. - Rémy Sigrist, Mar 14 2021)

Extensions

Data corrected and more terms from Rémy Sigrist, Mar 14 2021

A364377 The number of trailing 0's in the representation of n in Jacobsthal greedy base (A265747).

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 0, 1, 0, 2, 3, 0, 0, 1, 0, 2, 0, 0, 1, 0, 4, 0, 0, 1, 0, 2, 0, 0, 1, 0, 2, 3, 0, 0, 1, 0, 2, 0, 0, 1, 0, 4, 5, 0, 0, 1, 0, 2, 0, 0, 1, 0, 2, 3, 0, 0, 1, 0, 2, 0, 0, 1, 0, 4, 0, 0, 1, 0, 2, 0, 0, 1, 0, 2, 3, 0, 0, 1, 0, 2, 0, 0, 1, 0, 6, 0, 0
Offset: 1

Views

Author

Amiram Eldar, Jul 21 2023

Keywords

Comments

The first position of k, for k = 0, 1, 2, ..., is A001045(k+2).
The asymptotic density of the occurrences of 2*k is 9/4^(k+2), and of 2*k+1 is 3/4^(k+2), both for k >= 0.
The asymptotic mean of this sequence is 11/12, and its asymptotic standard deviation is sqrt(283)/12.

Crossrefs

Programs

  • Mathematica
    a[n_] := IntegerExponent[A265747[n], 10]; Array[a, 100] (* using A265747[n] *)
  • PARI
    a(n) = valuation(A265747(n), 10); \\ using A265747(n)
Showing 1-3 of 3 results.