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-10 of 38 results. Next

A147880 Expansion of Product_{k > 0} (1 + A005229(k)*x^k).

Original entry on oeis.org

1, 1, 1, 3, 5, 8, 12, 21, 30, 50, 75, 110, 169, 249, 361, 539, 757, 1076, 1583, 2207, 3121, 4415, 6184, 8468, 11775, 16274, 22314, 30601, 41745, 56412, 77008, 103507, 138383, 186928, 249855, 333375, 443898, 588402, 778276, 1031126, 1356945, 1780645
Offset: 0

Views

Author

Roger L. Bagula, Nov 16 2008

Keywords

Examples

			From _Petros Hadjicostas_, Apr 10 2020: (Start)
Let f(m) = A005229(m). Using the strict partitions of each n (see A000009), we get
a(1) = f(1) = 1,
a(2) = f(2) = 1,
a(3) = f(3) + f(1)*f(2) = 2 + 1*1 = 3,
a(4) = f(4) + f(1)*f(3) = 3 + 1*2 = 5,
a(5) = f(5) + f(1)*f(4) + f(2)*f(3) = 3 + 1*3 + 1*2 = 8,
a(6) = f(6) + f(1)*f(5) + f(2)*f(4) + f(1)*f(2)*f(3) = 4 + 1*3 + 1*3 + 1*1*2 = 12,
a(7) = f(7) + f(1)*f(6) + f(2)*f(5) + f(3)*f(4) + f(1)*f(2)*f(4) = 5 + 1*4 + 1*3 + 2*3 + 1*1*3 = 21. (End)
		

Crossrefs

Programs

  • Mathematica
    (*A005229*) f[n_Integer?Positive] := f[n] = f[ f[n - 2]] + f[n - f[n - 2]]; f[0] = 0; f[1] = f[2] = 1;
    P[x_, n_] := P[x, n] = Product[1 + f[m] *x^m, {m, 0, n}];
    Take[CoefficientList[P[x, 45], x], 45] (* Program simplified by Petros Hadjicostas, Apr 13 2020 *)
  • PARI
    \\ here B(n) is A005229 as vector.
    B(n)={my(a=vector(n, i, 1)); for(n=3, n, a[n] = a[a[n-2]] + a[n-a[n-2]]); a}
    seq(n)={my(v=B(n)); Vec(prod(k=1, n, 1 + v[k]*x^k + O(x*x^n)))} \\ Andrew Howroyd, Apr 10 2020

Formula

G.f.: Product_{k > 0} (1 + A005229(k)*x^k).
a(n) = Sum_{(b_1,...,b_n)} f(1)^b_1 * f(2)^b_2 * ... * f(n)^b_n, where f(m) = A005229(m), and the sum is taken over all lists (b_1,...,b_n) with b_j in {0,1} and Sum_{j=1..n} j*b_j = n.

Extensions

Various sections edited by Joerg Arndt and Petros Hadjicostas, Apr 10 2020

A051105 First differences of A005229.

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A005229.

Programs

Formula

a(n) = A005229(n+1) - A005229(n). - G. C. Greubel, Mar 28 2022

A087758 Index of first occurrence of n in A005229.

Original entry on oeis.org

1, 3, 4, 6, 7, 8, 10, 12, 13, 14, 16, 17, 19, 20, 21, 22, 24, 26, 27, 29, 31, 32, 33, 34, 36, 37, 39, 40, 41, 43, 46, 47, 48, 49, 50, 51, 53, 55, 56, 58, 59, 60, 61, 63, 64, 67, 69, 70, 71, 72, 73, 74, 75, 77, 80, 81, 82, 83, 85, 87, 88, 89, 90, 92, 94, 95, 98, 99, 100, 102
Offset: 1

Views

Author

Roger L. Bagula, Oct 02 2003

Keywords

Crossrefs

Cf. A005229.

Programs

  • PARI
    {m=102;v5229=vector(m);v5229[1]=1;v5229[2]=1;for(k=3,m,v5229[k]=v5229[v5229[k-2]]+v5229[k-v5229[k-2]]); v=vector(m);for(j=1,m,if(v[v5229[j]]==0,v[v5229[j]]=j));n=0;while(v[n++ ]>0,print1(v[n],","))}

Formula

a(n) = least k such that A005229(k) = n.

Extensions

Edited by N. J. A. Sloane, Apr 07 2006

A116591 a(n) = b(n+2) + b(n) with a(0) = 1, where b(n) = A005229(n) for n>2.

Original entry on oeis.org

1, 3, 4, 5, 7, 8, 10, 11, 13, 13, 15, 16, 18, 19, 21, 22, 23, 25, 26, 28, 30, 31, 33, 33, 35, 36, 37, 39, 39, 41, 42, 44, 46, 47, 49, 50, 51, 53, 54, 56, 57, 59, 59, 60, 61, 62, 64, 66, 68, 70, 71, 73, 73, 75, 76, 77, 79, 80, 82, 84, 85, 87, 88, 89, 90, 91, 91, 93, 94, 96, 98
Offset: 0

Views

Author

Roger L. Bagula, Mar 27 2006

Keywords

Comments

A similar definition applied to the Fibonacci sequence (A000045) leads to the Lucas sequence (A000032).

Crossrefs

Programs

  • Maple
    b:=proc(n) option remember; if n<=2 then 1 else b(b(n-2))+b(n-b(n-2)): fi: end: seq(b(n),n=1..75): a[0]:=1: for n from 1 to 70 do a[n]:=b(n)+b(n+2) od: seq(a[n],n=0..70);
  • Mathematica
    M[n_]:= M[n]= If[n<3, 1 -Boole[n==0], M[M[n-2]] + M[n -M[n-2]]];
    L[n_]:= L[n]= If[n==1, 1, M[n-1] + M[n+1]];
    Table[L[n], {n, 100}] (* modified by G. C. Greubel, Mar 28 2022 *)
  • Sage
    @CachedFunction
    def b(n): # A005229
        if (n<3): return 1
        else: return b(b(n-2)) + b(n-b(n-2))
    def A116591(n): return b(n+2) +b(n) -bool(n==0)
    [A116591(n) for n in (0..100)] # G. C. Greubel, Mar 28 2022

Formula

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

Extensions

Edited by N. J. A. Sloane, Apr 15 2006

A169638 Number of multiset permutations of the n initial elements of A005229 with additional element A005229(0)=1.

Original entry on oeis.org

1, 1, 1, 4, 20, 60, 420, 3360, 30240, 151200, 1663200, 9979200, 129729600, 1816214400, 27243216000, 217945728000, 3705077376000, 66691392768000, 633568231296000, 12671364625920000, 266098657144320000, 5854170457175040000, 134645920515025920000, 1615751046180311040000
Offset: 0

Views

Author

Roger L. Bagula, Apr 04 2010

Keywords

Crossrefs

Cf. A169637.

Programs

  • Maple
    N:= 100: # to get a(0) to a(N)
    A005229:= proc(n) option remember;
    procname(procname(n-2))+procname(n-procname(n-2))
    end proc:
    A005229(1):= 1: A005229(2):= 1:
    V:= Vector(N):
    A[0]:= 1: V[1]:= 1:
    for n from 1 to N do
      r:= A005229(n);
      V[r]:= V[r]+1;
      A[n]:= A[n-1]*(n+1)/V[r];
    od:
    seq(A[i],i=0..N); # Robert Israel, Dec 23 2014
  • Mathematica
    Mallows[n_Integer?Positive] := Mallows[n] = Mallows[Mallows[n - 2]] + Mallows[ n - Mallows[n - 2]];
    Mallows[0] = Mallows[1] = Mallows[2] = 1;
    a[m_] := Length[Permutations[Table[Mallows[i], {i, 0, m}]]];
    Table[a[m], {m, 0, 10}]
    (* A much better way to compute the terms is to use the multinomials of the multiplicities of the terms of A005229! - Joerg Arndt, Dec 23 2014 *)

Formula

a(n) = number of permutations of the list b[0..n] where b(0)=0 and b(n) = A005229(n) for n>=1.

Extensions

Edited and new name, Joerg Arndt, Dec 23 2014
a(11) to a(23) from Robert Israel, Dec 23 2014

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++)}

A152569 Terms in A005229 occurring exactly 3 times.

Original entry on oeis.org

30, 45, 54, 66, 78, 93, 97, 113, 118, 135, 142, 143, 163, 171, 195, 205, 211, 235, 247, 278, 297, 310, 339, 355, 379, 401, 429, 432, 455, 490, 510, 519, 524, 548, 555, 578, 618, 627, 640, 646, 654, 658, 668, 734, 746, 759, 790, 797, 834, 846, 852, 875, 890
Offset: 1

Views

Author

Zak Seidov, Dec 08 2008

Keywords

Crossrefs

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

Programs

  • Mathematica
    aa[1] = aa[2] = 1; aa[n_] := aa[n] = aa[aa[n - 2]] + aa[n - aa[n - 2]]; ta2000 = Table[aa[n], {n, 2000}]; re3 = Reap[Do[If[Count[ta2000, k] == 3, Sow[k]], {k, 1379}]][[2, 1]]

A004001 Hofstadter-Conway $10000 sequence: a(n) = a(a(n-1)) + a(n-a(n-1)) with a(1) = a(2) = 1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

On Jul 15 1988 during a colloquium talk at Bell Labs, John Conway stated that he could prove that a(n)/n -> 1/2 as n approached infinity, but that the proof was extremely difficult. He therefore offered $100 to someone who could find an n_0 such that for all n >= n_0, we have |a(n)/n - 1/2| < 0.05, and he offered $10,000 for the least such n_0. I took notes (a scan of my notebook pages appears below), plus the talk - like all Bell Labs Colloquia at that time - was recorded on video. John said afterwards that he meant to say $1000, but in fact he said $10,000. I was in the front row. The prize was claimed by Colin Mallows, who agreed not to cash the check. - N. J. A. Sloane, Oct 21 2015
a(n) - a(n-1) = 0 or 1 (see the D. Newman reference). - Emeric Deutsch, Jun 06 2005
a(A188163(n)) = n and a(m) < n for m < A188163(n). - Reinhard Zumkeller, Jun 03 2011
From Daniel Forgues, Oct 04 2019: (Start)
Conjectures:
a(n) = n/2 iff n = 2^k, k >= 1.
a(n) = 2^(k-1): k times, for n = 2^k - (k-1) to 2^k, k >= 1. (End)

Examples

			If n=4, 2^4=16, a(16-i) = 2^(4-1) = 8 for 0 <= i <= 4-1 = 3, hence a(16)=a(15)=a(14)=a(13)=8.
		

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.
  • 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.
  • R. K. Guy, Unsolved Problems Number Theory, Sect. E31.
  • D. R. Hofstadter, personal communication.
  • C. A. Pickover, Wonders of Numbers, "Cards, Frogs and Fractal sequences", Chapter 96, pp. 217-221, Oxford Univ. Press, NY, 2000.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • 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

Cf. A005229, A005185, A080677, A088359, A087686, A093879 (first differences), A265332, A266341, A055748 (a chaotic cousin), A188163 (greedy inverse).
Cf. A004074 (A249071), A005350, A005707, A093878. Different from A086841. Run lengths give A051135.
Cf. also permutations A267111-A267112 and arrays A265901, A265903.

Programs

  • Haskell
    a004001 n = a004001_list !! (n-1)
    a004001_list = 1 : 1 : h 3 1  {- memoization -}
      where h n x = x' : h (n + 1) x'
              where x' = a004001 x + a004001 (n - x)
    -- Reinhard Zumkeller, Jun 03 2011
    
  • Magma
    [n le 2 select 1 else Self(Self(n-1))+ Self(n-Self(n-1)):n in [1..75]]; // Marius A. Burtea, Aug 16 2019
    
  • Maple
    A004001 := proc(n) option remember; if n<=2 then 1 else procname(procname(n-1)) +procname(n-procname(n-1)); fi; end;
  • Mathematica
    a[1] = 1; a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; Table[ a[n], {n, 1, 75}] (* Robert G. Wilson v *)
  • PARI
    a=vector(100);a[1]=a[2]=1;for(n=3,#a,a[n]=a[a[n-1]]+a[n-a[n-1]]);a \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    first(n)=my(v=vector(n)); v[1]=v[2]=1; for(k=3, n, v[k]=v[v[k-1]]+v[k-v[k-1]]); v \\ Charles R Greathouse IV, Feb 26 2017
    
  • Python
    def a004001(n):
        A = {1: 1, 2: 1}
        c = 1 #counter
        while n not in A.keys():
            if c not in A.keys():
                A[c] = A[A[c-1]] + A[c-A[c-1]]
            c += 1
        return A[n]
    # Edward Minnix III, Nov 02 2015
    
  • SageMath
    @CachedFunction
    def a(n): # a = A004001
        if n<3: return 1
        else: return a(a(n-1)) + a(n-a(n-1))
    [a(n) for n in range(1,101)] # G. C. Greubel, Apr 25 2024
  • Scheme
    ;; An implementation of memoization-macro definec can be found for example from: http://oeis.org/wiki/Memoization
    (definec (A004001 n) (if (<= n 2) 1 (+ (A004001 (A004001 (- n 1))) (A004001 (- n (A004001 (- n 1)))))))
    ;; Antti Karttunen, Oct 22 2014
    

Formula

Limit_{n->infinity} a(n)/n = 1/2 and as special cases, if n > 0, a(2^n-i) = 2^(n-1) for 0 <= i < = n-1; a(2^n+1) = 2^(n-1) + 1. - Benoit Cloitre, Aug 04 2002 [Corrected by Altug Alkan, Apr 03 2017]

A028310 Expansion of (1 - x + x^2) / (1 - x)^2 in powers of x.

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71
Offset: 0

Views

Author

Keywords

Comments

1 followed by the natural numbers.
Molien series for ring of Hamming weight enumerators of self-dual codes (with respect to Euclidean inner product) of length n over GF(4).
Engel expansion of e (see A006784 for definition) [when offset by 1]. - Henry Bottomley, Dec 18 2000
Also the denominators of the series expansion of log(1+x). Numerators are A062157. - Robert G. Wilson v, Aug 14 2015
The right-shifted sequence (with a(0)=0) is an autosequence (of the first kind - see definition in links). - Jean-François Alcover, Mar 14 2017

Examples

			G.f. = 1 + x + 2*x^2 + 3*x^3 + 4*x^4 + 5*x^5 + 6*x^6 + 7*x^7 + 8*x^8 + 9*x^9  + ...
		

Crossrefs

Cf. A000007, A000027, A000660 (boustrophedon transform).

Programs

  • Haskell
    a028310 n = 0 ^ n + n
    a028310_list = 1 : [1..]  -- Reinhard Zumkeller, Nov 06 2012
    
  • Magma
    [n eq 0 select 1 else n: n in [0..75]]; // G. C. Greubel, Jan 05 2024
    
  • Maple
    a:= n-> `if`(n=0, 1, n):
    seq(a(n), n=0..60);
  • Mathematica
    Denominator@ CoefficientList[Series[Log[1+x], {x,0,75}], x] (* or *)
    CoefficientList[ Series[(1 -x +x^2)/(1-x)^2, {x,0,75}], x] (* Robert G. Wilson v, Aug 14 2015 *)
    Join[{1}, Range[75]] (* G. C. Greubel, Jan 05 2024 *)
    LinearRecurrence[{2,-1},{1,1,2},80] (* Harvey P. Dale, Jan 29 2025 *)
  • PARI
    {a(n) = (n==0) + max(n, 0)} /* Michael Somos, Feb 02 2004 */
    
  • PARI
    A028310(n)=n+!n  \\ M. F. Hasler, Jan 16 2012
    
  • Python
    def A028310(n): return n|bool(n)^1 # Chai Wah Wu, Jul 13 2023
    
  • SageMath
    [n + int(n==0) for n in range(76)] # G. C. Greubel, Jan 05 2024

Formula

Binomial transform is A005183. - Paul Barry, Jul 21 2003
G.f.: (1 - x + x^2) / (1 - x)^2 = (1 - x^6) /((1 - x) * (1 - x^2) * (1 - x^3)) = (1 + x^3) / ((1 - x) * (1 - x^2)). a(0) = 1, a(n) = n if n>0.
Euler transform of length 6 sequence [ 1, 1, 1, 0, 0, -1]. - Michael Somos Jul 30 2006
G.f.: 1 / (1 - x / (1 - x / (1 + x / (1 - x)))). - Michael Somos, Apr 05 2012
G.f. of A112934(x) = 1 / (1 - a(0)*x / (1 - a(1)*x / ...)). - Michael Somos, Apr 05 2012
a(n) = A000027(n) unless n=0.
a(n) = Sum_{k=0..n} A123110(n,k). - Philippe Deléham, Oct 06 2009
E.g.f: 1+x*exp(x). - Wolfdieter Lang, May 03 2010
a(n) = sqrt(floor[A204503(n+3)/9]). - M. F. Hasler, Jan 16 2012
E.g.f.: 1-x + x*E(0), where E(k) = 2 + x/(2*k+1 - x/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Dec 24 2013
a(n) = A001477(n) + A000007(n). - Miko Labalan, Dec 12 2015 (See the first comment.)

A088493 a(n) = Sum_{k=1..8} floor(p(n, k)/p(n-1, k)), where p(n, k) = n!/( Product_{i=1..floor(n/2^k)} A004001(i) ).

Original entry on oeis.org

16, 24, 32, 40, 45, 56, 60, 72, 73, 88, 81, 104, 101, 120, 108, 136, 129, 152, 129, 168, 157, 184, 141, 200, 185, 216, 178, 232, 213, 248, 188, 264, 241, 280, 226, 296, 269, 312, 222, 328, 297, 344, 273, 360, 325, 376, 237, 392, 353, 408, 321, 424, 381, 440
Offset: 2

Views

Author

Roger L. Bagula, Nov 10 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Conway[n_]:= Conway[n]= If[n<3, 1, Conway[Conway[n-1]] +Conway[n-Conway[n-1]]];
    f[n_, k_]:= f[n, k]= Product[Conway[i], {i, Floor[n/2^k]}];
    a[n_]:= a[n]= Sum[Floor[n*f[n-1,k]/f[n,k]], {k,8}];
    Table[a[n], {n, 2, 70}] (* modified by G. C. Greubel, Mar 27 2022 *)
  • Sage
    @CachedFunction
    def b(n): # A004001
        if (n<3): return 1
        else: return b(b(n-1)) + b(n-b(n-1))
    def f(n,k): return product( b(j) for j in (1..(n//2^k)) )
    def A088493(n): return sum( (n*f(n-1,k)//f(n,k)) for k in (1..8) )
    [A088493(n) for n in (2..70)] # G. C. Greubel, Mar 27 2022

Formula

a(n) = Sum_{k=1..8} floor(p(n, k)/p(n-1, k)), where p(n, k) = n!/( Product_{i=1..floor(n/2^k)} A004001(i) ).

Extensions

Edited by G. C. Greubel, Mar 27 2022
Showing 1-10 of 38 results. Next