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.

A214833 Number of formula representations of n using addition, multiplication and the constant 1.

Original entry on oeis.org

1, 1, 2, 6, 16, 52, 160, 536, 1796, 6216, 21752, 77504, 278720, 1013184, 3712128, 13701204, 50880808, 190003808, 712975648, 2687114976, 10167088608, 38605365712, 147060726688, 561853414896, 2152382687488, 8265949250848, 31817041756880, 122728993889056
Offset: 1

Views

Author

Alois P. Heinz, Mar 07 2013

Keywords

Examples

			a(1) = 1: 1.
a(2) = 1: 11+.
a(3) = 2: 111++, 11+1+.
a(4) = 6: 1111+++, 111+1++, 11+11++, 111++1+, 11+1+1+, 11+11+*.
a(5) = 16: 11111++++, 1111+1+++, 111+11+++, 1111++1++, 111+1+1++, 111+11+*+, 11+111+++, 11+11+1++, 111++11++, 11+1+11++, 1111+++1+, 111+1++1+, 11+11++1+, 111++1+1+, 11+1+1+1+, 11+11+*1+.
All formulas are given in postfix (reverse Polish) notation but other notations would give the same results.
		

Crossrefs

Cf. A213923 (minimal length of formula), A005408(n-1) (maximal length of formula), A214835 (total sum of lengths), A214836, A214843, A242970, A242955.

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; `if`(n=1, 1,
           add(a(i)*a(n-i), i=1..n-1)+
           add(a(d)*a(n/d), d=divisors(n) minus {1, n}))
        end:
    seq(a(n), n=1..40);
  • Mathematica
    a[n_] := a[n] = If[n == 1, 1, Sum[a[i]*a[n-i], {i, 1, n-1}] + Sum[a[d]*a[n/d], {d, Divisors[n][[2 ;; -2]]}]]; Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Feb 05 2015, after Alois P. Heinz *)
  • PARI
    A214833_vec=[1]; alias(A,A214833_vec); A214833(n)={n>#A&&A=concat(A,vector(n-#A));if(A[n],A[n],A[n]=sum(i=1,n-1,A214833(i)*A214833(n-i))+sumdiv(n,d,if(d>1&&dA214833(d)*A214833(n/d))))} \\ M. F. Hasler, May 04 2017

Formula

a(n) = Sum_{i=1..n-1} a(i)*a(n-i) + Sum_{d|n, 11, a(1)=1.
a(n) ~ c * d^n / n^(3/2), where d = 4.076561785276... = A242970, c = 0.145691854699979... = A242955. - Vaclav Kotesovec, Sep 12 2014

A214836 Number of formula representations of n using addition, multiplication, exponentiation and the constant 1.

Original entry on oeis.org

1, 1, 2, 7, 18, 58, 180, 613, 2076, 7270, 25752, 92918, 338432, 1246092, 4624536, 17290646, 65047436, 246079536, 935484928, 3571960668, 13692523960, 52675401248, 203299385584, 786949008100, 3054440440486, 11884949139900, 46351113658232, 181153317512536
Offset: 1

Views

Author

Alois P. Heinz, Mar 07 2013

Keywords

Examples

			a(1) = 1: 1.
a(2) = 1: 11+.
a(3) = 2: 111++, 11+1+.
a(4) = 7: 1111+++, 111+1++, 11+11++, 111++1+, 11+1+1+, 11+11+*, 11+11+^.
a(5) = 18: 11111++++, 1111+1+++, 111+11+++, 1111++1++, 111+1+1++, 111+11+*+, 111+11+^+, 11+111+++, 11+11+1++, 111++11++, 11+1+11++, 1111+++1+, 111+1++1+, 11+11++1+, 111++1+1+, 11+1+1+1+, 11+11+*1+, 11+11+^1+.
All formulas are given in postfix (reverse Polish) notation but other notations would give the same results.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; `if`(n=1, 1,
           add(a(i)*a(n-i), i=1..n-1)+
           add(a(d)*a(n/d), d=divisors(n) minus {1, n})+
           add(a(root(n, p))*a(p), p=divisors(igcd(seq(i[2],
               i=ifactors(n)[2]))) minus {0,1}))
        end:
    seq(a(n), n=1..40);
  • Mathematica
    a[n_] := a[n] = If[n==1, 1, Sum[a[i]*a[n-i], {i, 1, n-1}] + Sum[a[d]*a[n/d], {d, Divisors[n] ~Complement~ {1, n}}] + Sum[a[n^(1/p)] * a[p], {p, Divisors[GCD @@ Table[i[[2]], {i, FactorInteger[n]}]] ~Complement~ {0, 1}}]]; Array[a, 40] (* Jean-François Alcover, Apr 11 2017, translated from Maple *)

A213924 Minimal lengths of formulas representing n only using addition, exponentiation and the constant 1.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 9, 9, 11, 13, 15, 17, 19, 21, 11, 13, 15, 17, 19, 21, 23, 25, 21, 13, 15, 11, 13, 15, 17, 19, 13, 15, 17, 19, 15, 17, 19, 21, 23, 23, 25, 23, 25, 25, 27, 29, 25, 17, 19, 21, 23, 25, 23, 25, 27, 27, 27, 25, 27, 29, 31, 27, 13, 15, 17, 19, 21, 23, 25, 27, 23, 23, 25, 27, 29, 31, 33
Offset: 1

Views

Author

Jonathan Vos Post, Mar 06 2013

Keywords

Examples

			There are 502 different formulas for n=8. Two of them have shortest length 9: 11+111++^, 11+11+1+^. Thus a(8) = 9.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; 1+ `if`(n=1, 0, min(
           seq(a(i)+a(n-i), i=1..n-1),
           seq(a(root(n, p))+a(p), p=divisors(igcd(seq(i[2],
               i=ifactors(n)[2]))) minus {0, 1})))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 12 2013
  • Mathematica
    a[n_] := a[n] = 1 + If[n==1, 0, Min[Table[a[i]+a[n-i], {i, 1, n-1}], Table[ a[Floor[n^(1/p)]] + a[p], {p, Divisors[GCD @@ FactorInteger[n][[All, 2]]] ~Complement~ {0, 1}}]]]; Array[a, 100] (* Jean-François Alcover, Mar 22 2017, after Alois P. Heinz *)
Showing 1-3 of 3 results.