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.

A000392 Stirling numbers of second kind S(n,3).

Original entry on oeis.org

0, 0, 0, 1, 6, 25, 90, 301, 966, 3025, 9330, 28501, 86526, 261625, 788970, 2375101, 7141686, 21457825, 64439010, 193448101, 580606446, 1742343625, 5228079450, 15686335501, 47063200806, 141197991025, 423610750290, 1270865805301
Offset: 0

Views

Author

Keywords

Comments

Number of palindromic structures using exactly three different symbols; Mobius transform: A056279. - Marks R. Nester
Number of ways of placing n labeled balls into k=3 indistinguishable boxes. - Thomas Wieder, Nov 30 2004
With two leading zeros, this is the second binomial transform of cosh(x)-1 and the binomial transform of A000225 (with extra leading zero). - Paul Barry, May 13 2003
Let [m] denote the first m positive integers. Then a(n) is the number of functions f from [n] to [n+1] that satisfy (i) f(x) > x for all x, (ii) f(x) = n+1 for exactly 3 elements and (iii) f(f(x)) = n+1 for the remaining n-3 elements of [n]. For example, a(4)=6 since there are exactly 6 functions from {1,2,3,4} to {1,2,3,4,5} such that f(x) > x, f(x) = 5 for 3 elements and f(f(x)) = 5 for the remaining element. The functions are f1 = {(1,5), (2,5), (3,4), (4,5)}, f2 = {(1,5), (2,3), (3,5), (4,5)}, f3 = {(1,5), (2,4), (3,5), (4,5)}, f4 = {(1,2), (2,5), (3,5), (4,5)}, f5 = {(1,3), (2,5), (3,5), (4,5)}, f6 = {(1,4), (2,5), (3,5), (4,5)}. - Dennis P. Walsh, Feb 20 2007
Conjecture. Let S(1)={1} and, for n > 1, let S(n) be the smallest set containing x, 2x and 3x for each element x in S(n-1). Then a(n+2) is the sum of the elements in S(n). (It is easy to prove that the number of elements in S(n) is the n-th triangular number given by A001952.) See A122554 for a sequence defined in this way. - John W. Layman, Nov 21 2007; corrected (a(n) to a(n+2) due to offset change) by Fred Daniel Kline, Oct 02 2014
Let P(A) be the power set of an n-element set A. Then a(n+1) = the number of pairs of elements {x,y} of P(A) for which x and y are disjoint and for which x is not a subset of y and y is not a subset of x. Wieder calls these "disjoint strict 2-combinations". - Ross La Haye, Jan 11 2008; corrected by Ross La Haye, Oct 29 2008
Also, let P(A) be the power set of an n-element set A. Then a(n+2) = the number of pairs of elements {x,y} of P(A) for which either 0) x and y are disjoint and for which either x is a subset of y or y is a subset of x, or 1) x and y are disjoint and for which x is not a subset of y and y is not a subset of x, or 2) x and y are intersecting and for which either x is a proper subset of y or y is a proper subset of x. - Ross La Haye, Jan 11 2008
3 * a(n+1) = p(n+1) where p(x) is the unique degree-n polynomial such that p(k) = a(k+1) for k = 0, 1, ..., n. - Michael Somos, Apr 29 2012
John W. Layman's conjecture that a(n+2) is the sum of elements in S(n) follows from the identification of S(n) with the first n rows of A036561, whose row sums are A001047. - Fred Daniel Kline, Oct 02 2014
From M. Sinan Kul, Sep 08 2016: (Start)
Let m be equal to the product of n-1 distinct primes. Then a(n) is equal to the number of distinct fractions >=1 that may be created by dividing a divisor of m by another divisor. For example for m = 2*3*5 = 30, we would have the following 6 fractions: 6/5, 3/2, 5/3, 5/2, 10/3, 15/2.
Here finding the number of fractions would be equivalent to distributing n-1 balls (distinct primes) to two bins (numerator and denominator) with no empty bins which can be found by Stirling numbers of the second kind. So another definition for a(n) is a(n) = Sum_{i=2..n-1} Stirling2(i,2)*binomial(n-1,i).
Also for n > 0, a(n) = (d(m^2)+1)/2 - d(m) where m is equal to the product of n-1 distinct primes. Example for a(5): m = 2*3*5*7 = 210 (product of four distinct primes) so a(5) = (d(210^2)+1)/2 - d(210) = 41 - 16 = 25. (End)
6*a(n) is the number of ternary strings of length n that contain at least one of each of the 3 symbols on which they are defined. For example, for n=4, the strings are the 12 permutations of 0012, the 12 permutations of 0112, and the 12 permutations of 0122. - Enrique Navarrete, Aug 23 2021
A simpler form of La Haye's first comment is: a(n+1) is the number of ways we can form disjoint unions of two nonempty subsets of [n] (see example below). Cf. A001047 for the requirement that the union contains n. - Enrique Navarrete, Aug 24 2021
As partial sums of the Nicomachus triangle's rows and the differences of the powers of 3 and 2 (A001047), each iteration corresponds to two figurate variations of the Sierpinski triangle (3^n) with cross-correlation to the Nicomachus triangle, see illustrations in links. The Sierpinski half-hexagons of (A001047) stack and conform to the footprint of 2^n - 1 triangular numbers. The 3^n Sierpinski triangle minus its 2^n bottom row, also correlates to the Nicomachus triangle according to each Sierpinski triangular sub-row. - John Elias, Oct 04 2021

Examples

			a(4) = 6. Let denote Z[i] the i-th labeled element = "ball". Then one has for n=4 six different ways to fill sets = "boxes" with the labeled elements:
Set(Set(Z[3], Z[4]), Set(Z[1]), Set(Z[2])), Set(Set(Z[3], Z[1]), Set(Z[4]), Set(Z[2])), Set(Set(Z[4], Z[1]), Set(Z[3]), Set(Z[2])), Set(Set(Z[4]), Set(Z[1]), Set(Z[3], Z[2])), Set(Set(Z[3]), Set(Z[1], Z[2]), Set(Z[4])), Set(Set(Z[3]), Set(Z[1]), Set(Z[4], Z[2])).
G.f. = x^3 + 6*x^4 + 25*x^5 + 90*x^6 + 301*x^7 + 966*x^8 + 3025*x^9 + ...
For example, for n=3, a(4)=6 since the disjoint unions are: {1}U{2}, {1}U{3}, {1}U{2,3}, {2}U{3}, {2}U{1,3}, and {1,2}U{3}. - _Enrique Navarrete_, Aug 24 2021
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 835.
  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 223.
  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • GAP
    List([0..400], n->Stirling2(n,3)); # Muniru A Asiru, Feb 04 2018
  • Maple
    A000392 := n -> 9/2*3^n-4*2^n+1/2;  [ seq(9/2*3^n-4*2^n+1/2,n=0..30) ]; # Thomas Wieder
    A000392:=-1/(z-1)/(3*z-1)/(2*z-1); # Simon Plouffe in his 1992 dissertation
  • Mathematica
    StirlingS2[Range[0,30],3] (* Harvey P. Dale, Dec 29 2011 *)
  • PARI
    {a(n) = 3^(n-1) / 2 - 2^(n-1) + 1/2};
    
  • Sage
    [stirling_number2(i,3) for i in (0..40)] # Zerinvary Lajos, Jun 26 2008
    

Formula

G.f.: x^3/((1-x)*(1-2*x)*(1-3*x)).
E.g.f.: ((exp(x) - 1)^3) / 3!.
Recurrence: a(n+3) = 6*a(n+2) - 11*a(n+1) + 6*a(n), a(3) = 1, a(4) = 6, a(5) = 25. - Thomas Wieder, Nov 30 2004
With offset 0, this is 9*3^n/2 - 4*2^n + 1/2, the partial sums of 3*3^n - 2*2^n = A001047(n+1). - Paul Barry, Jun 26 2003
a(n) = (1 + 3^(n-1) - 2^n)/2, n > 0. - Dennis P. Walsh, Feb 20 2007
For n >= 3, a(n) = 3*a(n-1) + 2^(n-2) - 1. - Geoffrey Critzer, Mar 03 2009
a(n) = 5*a(n-1) - 6*a(n-2) + 1, for n > 3. - Vincenzo Librandi Nov 25 2010
a(n) = det(|s(i+3,j+2)|, 1 <= i,j <= n-3), where s(n,k) are Stirling numbers of the first kind. - Mircea Merca, Apr 06 2013
G.f.: x^3 + 12*x^4/(G(0)-12*x), where G(k) = x + 1 + 9*(3*x+1)*3^k - 8*(2*x+1)*2^k - x*(9*3^k+1-8*2^k)*(81*3^k+1-32*2^k)/G(k+1); (continued fraction). - Sergei N. Gladkovskii, Feb 01 2014
a(n + 2) = (1 - 2^(2 + n) + 3^(1 + n))/2 for n > 0. - Fred Daniel Kline, Oct 02 2014
For n > 0, a(n) = (1/2) * Sum_{k=1..n-1} Sum_{i=1..n-1} C(n-k-1,i) * C(n-1,k). - Wesley Ivan Hurt, Sep 22 2017
a(n) = Sum_{k=0..n-3} 2^(k-1)*(3^(n-2-k) - 1). - J. M. Bergot, Feb 05 2018

Extensions

Offset changed by N. J. A. Sloane, Feb 08 2008

A000126 A nonlinear binomial sum.

Original entry on oeis.org

1, 2, 4, 8, 15, 27, 47, 80, 134, 222, 365, 597, 973, 1582, 2568, 4164, 6747, 10927, 17691, 28636, 46346, 75002, 121369, 196393, 317785, 514202, 832012, 1346240, 2178279, 3524547, 5702855, 9227432, 14930318, 24157782, 39088133, 63245949
Offset: 1

Views

Author

Keywords

Comments

a(n)-1 counts ternary numbers with no 0 digit (A007931) and at least one 2 digit, where the total of ternary digits is <= n. E.g., a(4)-1 = 7: 2 12 21 22 112 121 211. - Frank Ellermann, Dec 02 2001
A107909(a(n-1)) = A000079(n-1) = 2^(n-1). - Reinhard Zumkeller, May 28 2005
a(n) is the permanent of the n X n 0-1 matrix whose (i,j) entry is 1 iff i=1 or j=n or |i-j|<=1. For example, a(5)=15 is per([[1, 1, 1, 1, 1], [1, 1, 1, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 1], [0, 0, 0, 1, 1]]). - David Callan, Jun 07 2006
Conjecture. Let S(1)={1} and, for n>1, let S(n) be the smallest set containing x+1 and 2x+1 for each element x in S(n-1). Then a(n) is the sum of the elements in S(n). (See A122554 for a sequence defined in this way.) - John W. Layman, Nov 21 2007
a(n+1) indexes the corner blocks on the Fibonacci spiral built from blocks of unit area (using F(1) and F(2) as the sides of the first block). - Paul Barry, Mar 06 2008
The number of length n binary words with fewer than 2 0-digits between any pair of consecutive 1-digits. - Jeffrey Liese, Dec 23 2010
If b(n) = a(n+1) then b(0) = 1 and 2*b(n) >= b(n+1) for all n > 1 which is sufficient for b(n) to be a complete sequence. - Frank M Jackson, Mar 17 2013
From Gus Wiseman, Feb 10 2019: (Start)
Also the number of non-singleton subsets of {1, ..., n + 1} with no successive elements. For example, the a(5) = 15 subsets are:
{},
{1,3}, {1,4}, {1,5}, {1,6}, {2,4}, {2,5}, {2,6}, {3,5}, {3,6}, {4,6},
{1,3,5}, {1,3,6}, {1,4,6}, {2,4,6}.
Also the number of binary sequences with all zeros or at least 2 ones and no adjacent ones. For example, the a(1) = 1 through a(4) = 8 sequences are:
(00) (000) (0000) (00000)
(101) (0101) (00101)
(1001) (01001)
(1010) (01010)
(10001)
(10010)
(10100)
(10101)
(End)

References

  • Ralph P. Grimaldi, A generalization of the Fibonacci sequence. Proceedings of the seventeenth Southeastern international conference on combinatorics, graph theory, and computing (Boca Raton, Fla., 1986). Congr. Numer. 54 (1986), 123--128. MR0885268 (89f:11030). - N. J. A. Sloane, Apr 08 2012
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Heap-transform of A000071. - John W. Layman
Cf. A007931: binary strings with leading 0's, or ternary strings without 0's.
Differences are A000071.
Cf. A122554.
Cf. A000045.

Programs

  • GAP
    List([1..40], n-> Fibonacci(n+3)-(n+1)); # G. C. Greubel, Jul 09 2019
  • Magma
    [Fibonacci(n+3)-(n+1): n in [1..40]]; // G. C. Greubel, Jul 09 2019
    
  • Maple
    a:= n-> (Matrix([[1,1,1,2]]). Matrix(4, (i,j)-> if (i=j-1) then 1 elif j=1 then [3,-2,-1,1][i] else 0 fi)^n)[1,2]; seq(a(n), n=1..36); # Alois P. Heinz, Aug 26 2008
    # alternative
    A000126 := proc(n)
        combinat[fibonacci](n+3)-n-1 ;
    end proc:
    seq(A000126(n),n=1..40) ; # R. J. Mathar, Aug 05 2022
  • Mathematica
    LinearRecurrence[{3,-2,-1,1},{1,2,4,8},40] (* or *) CoefficientList[ Series[-(1-x+x^3)/((x^2+x-1)(x-1)^2),{x,0,40}],x]  (* Harvey P. Dale, Apr 24 2011 *)
    Table[Length[Select[Subsets[Range[n]],Min@@Abs[Subtract@@@Partition[#,2,1,1]]>1&]],{n,15}] (* Gus Wiseman, Feb 10 2019 *)
  • PARI
    Vec((1-x+x^3)/(1-x-x^2)/(1-x)^2+O(x^40)) \\ Charles R Greathouse IV, Oct 06 2011
    
  • PARI
    vector(40, n, fibonacci(n+3) -(n+1)) \\ G. C. Greubel, Jul 09 2019
    
  • Python
    def seq(n):
        if n < 0:
            return 1
        a, b = 1, 1
        for i in range(n + 1):
            a, b = b, a + b + i
        return a
    [seq(i) for i in range(n)] # Reza K Ghazi, Mar 03 2019
    
  • Sage
    [fibonacci(n+3)-(n+1) for n in (1..40)] # G. C. Greubel, Jul 09 2019
    

Formula

G.f.: (1 - x + x^3 ) / (( 1 - x - x^2 )*( 1 - x )^2). - Simon Plouffe in his 1992 dissertation.
From Henry Bottomley, Oct 22 2001: (Start)
a(n) = Fibonacci(n+3) - (n+1) = a(n-1) + a(n-2) + n - 2
a(n) = A001924(n-1) + 1 = A065220(n+3) + 2. (End)
a(n) = 2*a(n-1) - a(n-3) + 1. - Franklin T. Adams-Watters, Jan 13 2006
a(n+1) = 1 + Sum_{k=0..n} (Fibonacci(k+2) - 1) = Sum_{k=0..n} Fibonacci(k+2) - n. - Paul Barry, Mar 06 2008
a(n) = 3*a(n-1)-2*a(n-2)-a(n-3)+a(n-4). - Harvey P. Dale, May 05 2011
Closed-form without extra leading 1: ((15+7*sqrt(5))*((1+sqrt(5))/2)^n+(15-7*sqrt(5))*((1-sqrt(5))/2)^n-10*n-20)/10; closed-form with extra leading 1: ((20+8*sqrt(5))*((1+sqrt(5))/2)^n+(20-8*sqrt(5))*((1-sqrt(5))/2)^n-20*n-20)/20. - Tim Monahan, Jul 16 2011
G.f. for closed-form with extra leading 1: (1-2*x+x^2+x^3)/((1-x-x^2)*(x-1)^2). - Tim Monahan, Jul 17 2011

A168043 Let S(1)={1} and, for n>1 let S(n) be the smallest set containing x+1, x+2, and 2*x for each element x in S(n-1). a(n) is the number of elements in S(n).

Original entry on oeis.org

1, 2, 4, 7, 13, 23, 40, 68, 114, 189, 311, 509, 830, 1350, 2192, 3555, 5761, 9331, 15108, 24456, 39582, 64057, 103659, 167737, 271418, 439178, 710620, 1149823, 1860469, 3010319, 4870816, 7881164, 12752010, 20633205, 33385247, 54018485, 87403766, 141422286
Offset: 1

Views

Author

John W. Layman, Nov 17 2009

Keywords

Examples

			Under the indicated set mapping we have {1} -> {2,3} -> {3,4,5,6} -> {4,5,6,7,8,10,12}, ..., so a(2)=2, a(3)=4, a(4)=7, etc.
		

Crossrefs

Programs

  • Python
    from itertools import chain, islice
    def agen(): # generator of terms
        s = {1}
        while True:
            yield len(s)
            s = set(chain.from_iterable((x+1, x+2, 2*x) for x in s))
    print(list(islice(agen(), 30))) # Michael S. Branicky, Jan 13 2022 after Chai Wah Wu in A123247

Formula

It appears that a(n) = a(n-1) + a(n-2) + n - 3, for n>3.
From R. J. Mathar, Nov 18 2009: (Start)
Apparently: a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4) for n>5;
and a(n) = A000032(n+1) - n for n>1. (End)
From Ilya Gutkovskiy, Jul 07 2016: (Start)
It appears that the g.f. is x*(1 - x + x^4)/((1 - x)^2*(1 - x - x^2)); and the e.g.f. is phi*exp(phi*x) - exp(-x/phi)/phi - x*(1 + exp(x)) - 1, where phi is the golden ratio. (End)
It would be nice to have a proof for any one of these formulas. The others would then presumably follow easily. - N. J. A. Sloane, Jul 11 2016

Extensions

a(17)-a(22) from R. J. Mathar, Nov 18 2009
a(23)-a(35) from Jinyuan Wang, Apr 14 2020
a(36)-a(38) from Michael S. Branicky, Jan 13 2022

A350603 Irregular triangle read by rows: row n lists the elements of the set S_n in increasing order, where S_0 = {0}, and S_n is obtained by applying the operations x -> x+1 and x -> 2*x to S_{n-1}.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 20, 24, 32, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 32, 33, 34, 36, 40, 48, 64
Offset: 0

Views

Author

N. J. A. Sloane, Jan 12 2022, following a suggestion from James Propp

Keywords

Comments

Theorem: S_n contains Fibonacci(n+2) elements.
Proof from Adam P. Goucher, Jan 12 2022 (Start)
Let 'D' and 'I' be the 'double' and 'increment' operators, acting on 0 from the right. Then every element of S_n can be written as a length-n word over {D,I}. E.g., S_4 contains
0: DDDD
1: DDDI
2: DDID
3: DIDI
4: DIDD
5: IDDI
6: IDID
8: IDDD
We can avoid having two adjacent 'I's (because we can transform it into an equivalent word by prepending a 'D' -- which has no effect -- and then replacing the first 'DII' with 'ID').
Subject to the constraint that there are no two adjacent 'I's, these 'II'-less words all represent distinct integers (because of the uniqueness of binary expansions).
So we're left with the problem of enumerating length-n words over the alphabet {I, D} which do not contain 'II' as a substring. These are easily seen to be the Fibonacci numbers because we can check n=0 and n=1 and verify that the recurrence relation holds since a length-n word is either a length-(n-1) word followed by 'D' or a length-(n-2) word followed by 'DI'. QED (End)
From Rémy Sigrist, Jan 12 2022: (Start)
For any m >= 0, the value m first appears on row A056792(m).
For any n > 0: row n minus row n-1 corresponds to row n of A243571.
(End)

Examples

			The first few sets S_n are:
[0],
[0, 1],
[0, 1, 2],
[0, 1, 2, 3, 4],
[0, 1, 2, 3, 4, 5, 6, 8],
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16],
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 20, 24, 32],
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 32, 33, 34, 36, 40, 48, 64],
...
		

Crossrefs

Programs

  • Maple
    T:= proc(n) option remember; `if`(n=0, 0,
          sort([map(x-> [x+1, 2*x][], {T(n-1)})[]])[])
        end:
    seq(T(n), n=0..8);  # Alois P. Heinz, Jan 12 2022
  • Mathematica
    T[n_] := T[n] = If[n==0, {0}, {#+1, 2#}& /@ T[n-1] // Flatten //
          Union];
    Table[T[n], {n, 0, 8}] // Flatten (* Jean-François Alcover, May 06 2022, after Alois P. Heinz *)
  • Python
    from itertools import chain, islice
    def A350603_gen(): # generator of terms
        s = {0}
        while True:
            yield from sorted(s)
            s = set(chain.from_iterable((x+1,2*x) for x in s))
    A350603_list = list(islice(A350603_gen(),30)) # Chai Wah Wu, Jan 12 2022

Extensions

Definition made more precise by Chai Wah Wu, Jan 12 2022

A123212 Let S(1) = {1} and, for n > 1, let S(n) be the smallest set containing x, 2x and x^2 for each element x in S(n-1). a(n) is the sum of the elements in S(n).

Original entry on oeis.org

1, 3, 7, 31, 383, 71679, 4313284607, 18447026747376402431, 340282367000167840050178713574329810943, 115792089237316195429848086745536112650120661123018741407845920610578123980799
Offset: 1

Views

Author

John W. Layman, Oct 05 2006

Keywords

Comments

If we take the cardinality of the set S(n) instead of the sum, we get the Fibonacci numbers 1,2,3,5,8,13,21,34,... If the set mapping uses x -> x, 2x and 3x instead of x -> x, 2x, and x^2, the corresponding sequence consists of the Stirling numbers of the second kind: 1, 6, 25, 90, 301, 966, 3025, ... (A000392).

Examples

			Under the indicated set mapping we have {1} -> {1,2} -> {1,2,4} -> {1,2,4,8,16}, giving the sums a(1)=1, a(2)=3, a(3)=7, a(4)=31, etc.
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n=1, 1,
          map(x-> [x, 2*x, x^2][], {s(n-1)})[])
        end:
    a:= n-> add(i, i=s(n)):
    seq(a(n), n=1..10);  # Alois P. Heinz, Jan 12 2022
  • Mathematica
    S[n_] := S[n] = If[n == 1, {1}, {#, 2#, #^2}& /@ S[n-1] // Flatten // Union];
    a[n_] := S[n] // Total;
    Table[a[n], {n, 1, 10}] (* Jean-François Alcover, Apr 22 2022 *)
  • Python
    from itertools import chain, islice
    def A123212_gen(): # generator of terms
        s = {1}
        while True:
            yield sum(s)
            s = set(chain.from_iterable((x,2*x,x**2) for x in s))
    A123212_list = list(islice(A123212_gen(),10)) # Chai Wah Wu, Jan 12 2022

A123247 Let S(1)={1} and, for n>1 let S(n) be the smallest set containing x, x+1, 2x and 3x for each element x in S(n-1). a(n) is the number of elements in S(n).

Original entry on oeis.org

1, 3, 6, 13, 27, 54, 107, 213, 423, 845, 1685, 3371, 6735, 13468, 26937, 53900, 107873, 216035, 432787, 867313, 1738728, 3486464, 6993111, 14029776, 28153533, 56507114, 113435141, 227755613, 457358671, 918562597
Offset: 1

Views

Author

John W. Layman, Oct 04 2006

Keywords

Comments

If the set mapping has x -> x, 2x, 3x, 5x is used instead of x -> x, x+1, 2x, 3x, the corresponding sequence consists of the tetrahedral numbers C(n+3,3) = A000292.

Examples

			Under the indicated set mapping we have {1} -> {1,2,3} -> {1,2,3,4,6,9} -> {1,2,3,4,5,6,7,8,9,10,12,18,27}, ..., so a(2)=3, a(3)=6, a(4)=13, etc.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(k, v=[1]); print1(1); for(n=2, nn, v=Set(vector(4*#v, i, if(k=i%4, k*v[(3+i)\4], v[i/4]+1))); print1(", ", #v)); } \\ Jinyuan Wang, Apr 14 2020
    
  • Python
    from itertools import chain, islice
    def A123247_gen(): # generator of terms
        s = {1}
        while True:
            yield len(s)
            s = set(chain.from_iterable((x,x+1,2*x,3*x) for x in s))
    A123247_list = list(islice(A123247_gen(),20)) # Chai Wah Wu, Jan 12 2022

Extensions

a(14)-a(25) from Jinyuan Wang, Apr 14 2020
a(26)-a(30) from Chai Wah Wu, Jan 12 2022
Showing 1-6 of 6 results.