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

A005229 a(1) = a(2) = 1; for n > 2, a(n) = a(a(n-2)) + a(n - a(n-2)).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

By induction a(n) <= n, but an exact rate of growth is not known.

References

  • J. Arkin, D. C. Arney, L. S. Dewald, and W. E. Ebel, Jr., Families of recursive sequences, J. Rec. Math., 22 (No. 22, 1990), 85-94.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    import Data.Function (on)
    a005229 n = a005229_list !! (n-1)
    a005229_list = 1 : 1 : zipWith ((+) `on` a005229)
                           a005229_list (zipWith (-) [3..] a005229_list)
    -- Reinhard Zumkeller, Jan 17 2014
    
  • Maple
    A005229:= proc(n) option remember;
         if n<=2 then 1 else A005229(A005229(n-2)) +A005229(n-A005229(n-2));
         fi; end;
    seq(A005229(n), n=1..70)
  • Mathematica
    a[1] = a[2] = 1; a[n_] := a[n] = a[a[n-2]] + a[n - a[n-2]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Sep 06 2013 *)
  • PARI
    a(n)=an[n]; an=vector(100,n,1); for(n=3,100,an[n]=a(a(n-2))+a(n-a(n-2)))
    
  • Sage
    @CachedFunction
    def a(n): # A005229
        if (n<3): return 1
        else: return a(a(n-2)) + a(n-a(n-2))
    [a(n) for n in (1..100)] # G. C. Greubel, Mar 27 2022

Extensions

Typo in definition corrected by Nick Hobson, Feb 21 2007

A118179 Numbers which occur only once in A005229.

Original entry on oeis.org

2, 4, 5, 8, 9, 11, 13, 14, 15, 18, 21, 22, 23, 25, 27, 28, 31, 32, 33, 34, 35, 38, 40, 41, 42, 44, 47, 48, 49, 50, 51, 52, 55, 56, 57, 60, 61, 62, 65, 67, 68, 70, 71, 72, 73, 74, 75, 76, 79, 82, 83, 84, 86, 88, 89, 90, 91, 96, 98, 99, 100, 101, 103, 104, 105, 106, 107, 108
Offset: 1

Views

Author

Klaus Brockhaus, Apr 13 2006

Keywords

Examples

			1, 3, 6 and 7 occur twice in A005229, so these numbers are not in the sequence.
		

Crossrefs

Programs

  • Mathematica
    terms = 70; Clear[b, f]; b[1] = b[2] = 1; b[n_] := b[n] = b[b[n - 2]] + b[n - b[n - 2]]; f[max_] := f[max] = PadRight[Select[Tally[Array[b, max]], #[[2]] == 1 &][[All, 1]], terms]; f[max = terms]; f[max = max + terms]; While[f[max] != f[max - terms], max = max + terms]; A118179 = f[max](* Jean-François Alcover, Oct 12 2017 *)
  • PARI
    {m=156;v=vector(m);v[1]=1;v[2]=1;for(n=3,m,v[n]=v[v[n-2]]+v[n-v[n-2]]); i=1;k=1;while(i<=m,c=0;while(i<=m&&v[i]==k,c++;i++);if(i<=m&&c==1,print1(k,","));k++)}
Showing 1-2 of 2 results.