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 10 results.

A001047 a(n) = 3^n - 2^n.

Original entry on oeis.org

0, 1, 5, 19, 65, 211, 665, 2059, 6305, 19171, 58025, 175099, 527345, 1586131, 4766585, 14316139, 42981185, 129009091, 387158345, 1161737179, 3485735825, 10458256051, 31376865305, 94134790219, 282412759265, 847255055011, 2541798719465, 7625463267259, 22876524019505
Offset: 0

Views

Author

Keywords

Comments

a(n+1) is the sum of the elements in the n-th row of triangle pertaining to A036561. - Amarnath Murthy, Jan 02 2002
Number of 2 X n binary arrays with a path of adjacent 1's and no path of adjacent 0's from top row to bottom row. - R. H. Hardin, Mar 21 2002
With offset 1, partial sums of A027649. - Paul Barry, Jun 24 2003
Number of distinct lines through the origin in the n-dimensional lattice of side length 2. A049691 has the values for the 2-dimensional lattice of side length n. - Joshua Zucker, Nov 19 2003
a(n+1)/(n+1)=(3*3^n-2*2^n)/(n+1) is the second binomial transform of the harmonic sequence 1/(n+1). - Paul Barry, Apr 19 2005
a(n+1) is the sum of n-th row of A036561. - Reinhard Zumkeller, May 14 2006
The sequence gives the sum of the lengths of the segments in Cantor's dust generating sequence up to the i-th step. Measurement unit = length of the segment of i-th step. - Giorgio Balzarotti, Nov 18 2006
Let T be a binary relation on the power set P(A) of a set A having n = |A| elements such that for every element x, y of P(A), xTy if x is a proper subset of y. Then a(n) = |T|. - Ross La Haye, Dec 22 2006
From Alexander Adamchuk, Jan 04 2007: (Start)
a(n) is prime for n in A057468.
p divides a(p) - 1 for prime p.
Quotients (3^p - 2^p - 1)/p, where p = prime(n), are listed in A127071.
Numbers k such that k divides 3^k - 2^k - 1 are listed in A127072.
Pseudoprimes in A127072(n) include all powers of primes {2,3,7} and some composite numbers that are listed in A127073, which includes all Carmichael numbers A002997.
Numbers n such that n^2 divides 3^n - 2^n - 1 are listed in A127074.
5 divides a(2n).
5^2 divides a(2*5n).
5^3 divides a(2*5^2n).
5^4 divides a(2*5^3n).
7^2 divides a(6*7n).
13 divides a(4n).
13^2 divides a(4*13n).
19 divides a(3n).
19^2 divides a(3*19n).
23^2 divides a(11n).
23^3 divides a(11*23n).
23^4 divides a(11*23^2n).
29 divides a(7n).
p divides a((p-1)n) for prime p>3.
p divides a((p-1)/2) for prime p in A097934. Also primes p such that 6 is a square mod p, except {2,3}, A038876(n).
p^(k+1) divides a(p^k*(p-1)/2*n) for prime p in A097934.
p^(k+1) divides a(p^k*(p-1)*n) for prime p>3.
Note the exception that for p = 23, p^(k+2) divides a(p^k*(p-1)/2*n).
There are no more such exceptions for primes p up to 600000. (End)
a(n) divides a(q*(n+1)-1), for all q integer. Leonardo Sarasua, Apr 15 2024
Final digits of terms follow sequence 1,5,9,5. - Enoch Haga, Nov 26 2007
This is also the second column sequence of the Sheffer triangle A143494 (2-restricted Stirling2 numbers). See the e.g.f. given below. - Wolfdieter Lang, Oct 08 2011
Partial sums give A000392. - Jon Perry, Apr 05 2014
For n >= 1, this is also row 2 of A281890: when consecutive positive integers are written as a product of primes in nondecreasing order, "3" occurs in n-th position a(n) times out of every 6^n. - Peter Munn, May 17 2017
a(n) is the number of ternary sequences of length n which include the digit 2. For example, a(2)=5 since the sequences are 02,20,12,21,22. - Enrique Navarrete, Apr 05 2021
a(n-1) is the number of ways we can form disjoint unions of two nonempty subsets of [n] such that the union contains n. For example, for n = 3, a(2) = 5 since the disjoint unions are {1}U{3}, {1}U{2,3}, {2}U{3}, {2}U{1,3}, and {1,2}U{3}. Cf. A000392 if we drop the requirement that the union contains n. - Enrique Navarrete, Aug 24 2021
Configures as a composite Koch Snowflake Fractal (see illustration in links) based on the five-fold division of the Cantor Square/Cantor Dust Fractal of (9^n-4^n)/5 see my illustration in (A016153). - John Elias, Oct 13 2021
Number of pairs (A,B) where B is a subset of {1,2,...,n} and A is a proper subset of B. - Jianing Song, Jun 18 2022
From Manfred Boergens, Mar 29 2023: (Start)
With regard to the comments by Ross La Haye and Jianing Song: Omitting "proper" gives A000244.
Number of pairs (A,B) where B is a nonempty subset of {1,2,...,n} and A is a nonempty subset of B. For nonempty proper subsets see a(n+1) in A028243. (End)
a(n) is the number of n-digit numbers whose smallest decimal digit is 7. - Stefano Spezia, Nov 15 2023
a(n-1) is the number of all possible player-reduced binary games observed by each player in an nx2 game assuming the individual strategies of k < n - 1 players are fixed and the remaining n - k - 1 player will play as one, either maintaining their status quo strategies or jointly adopting an alternative strategy. - Ambrosio Valencia-Romero, Apr 11 2024

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 86-87.
  • 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

a(n) = row sums of A091913, row 2 of A047969, column 1 of A090888 and column 1 of A038719.
Cf. partitions: A241766, A241759.
A diagonal of A262307.

Programs

  • Haskell
    a001047 n = a001047_list !! n
    a001047_list = map fst $ iterate (\(u, v) -> (3 * u + v, 2 * v)) (0, 1)
    -- Reinhard Zumkeller, Jun 09 2013
  • Magma
    [3^n - 2^n: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
    
  • Maple
    seq(3^n - 2^n, n=0..40); # Giorgio Balzarotti, Nov 18 2006
    A001047:=1/(3*z-1)/(2*z-1); # Simon Plouffe in his 1992 dissertation, dropping the initial zero
  • Mathematica
    Table[ 3^n - 2^n, {n, 0, 25} ]
    LinearRecurrence[{5, -6}, {0, 1}, 25] (* Harvey P. Dale, Aug 18 2011 *)
    Numerator@NestList[(3#+1)/2&,1/2,100] (* Zak Seidov, Oct 03 2011 *)
  • PARI
    {a(n) = 3^n - 2^n};
    
  • Python
    [3**n - 2**n for n in range(25)] # Ross La Haye, Aug 19 2005; corrected by David Radcliffe, Jun 26 2016
    
  • Sage
    [lucas_number1(n, 5, 6) for n in range(26)]  # Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: x/((1-2*x)*(1-3*x)).
a(n) = 5*a(n-1) - 6*a(n-2).
a(n) = 3*a(n-1) + 2^(n-1). - Jon Perry, Aug 23 2002
Starting 0, 0, 1, 5, 19, ... this is 3^n/3 - 2^n/2 + 0^n/6, the binomial transform of A086218. - Paul Barry, Aug 18 2003
a(n) = A083323(n)-1 = A056182(n)/2 = (A002783(n)-1)/2 = (A003063(n+2)-A003063(n+1))/2. - Ralf Stephan, Jan 12 2004
Binomial transform of A000225. - Ross La Haye, Feb 07 2005
a(n) = Sum_{k=0..n-1} binomial(n, k)*2^k. - Ross La Haye, Aug 20 2005
a(n) = 2^(2n) - A083324(n). - Ross La Haye, Sep 10 2005
a(n) = A112626(n, 1). - Ross La Haye, Jan 11 2006
E.g.f.: exp(3*x) - exp(2*x). - Mohammad K. Azarian, Jan 14 2009
a(n) = A217764(n,1). - Ross La Haye, Mar 27 2013
a(n) = 2*a(n-1) + 3^(n-1). - Toby Gottfried, Mar 28 2013
a(n) = A000244(n) - A000079(n). - Omar E. Pol, Mar 28 2013
a(n) = Sum_{k=0..2} Stirling1(2,k)*(k+1)^n = c_2^{(-n)}, poly-Cauchy numbers. - Takao Komatsu, Mar 28 2013
a(n) = A227048(n,A098294(n)). - Reinhard Zumkeller, Jun 30 2013
a(n+1) = Sum_{k=0..n} 2^k*3^(n-k). - J. M. Bergot, Mar 27 2018
Sum_{n>=1} 1/a(n) = A329064. - Amiram Eldar, Nov 20 2020
a(n) = (1/2)*Sum_{k=0..n} binomial(n, k)*(2^(n-k) + 2^k - 2).
a(n) = A001117(n) + 2*A000918(n) + 1. - Ambrosio Valencia-Romero, Mar 08 2022
a(n) = A000225(n) + A028243(n+1). - Ambrosio Valencia-Romero, Mar 09 2022
From Peter Bala, Jun 27 2025: (Start)
exp(Sum_{n >=1} a(2*n)/a(n)*x^n/n) = Sum_{n >= 0} a(n+1)*x^n.
exp(Sum_{n >=1} a(3*n)/a(n)*x^n/n) = 1 + 19*x + 247*x^2 + ... is the g.f. of A019443.
exp(Sum_{n >=1} a(4*n)/a(n)*x^n/n) = 1 + 65*x + 2743*x^2 + ... is the g.f. of A383754.
The following are all examples of telescoping series:
Sum_{n >= 1} 6^n/(a(n)*a(n+1)) = 2, since 6^n/(a(n)*a(n+1)) = b(n) - b(n+1), where b(n) = 2^n/a(n);
Sum_{n >= 1} 18^n/(a(n)*a(n+1)*a(n+2)) = 22/75, since 18^n/(a(n)*a(n+1)*a(n+2)) = c(n) - c(n+1), where c(n) = (5*6^n - 2*4^n)/(15*a(n)*a(n+1));
Sum_{n >= 1} 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = 634/48735 since 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = d(n) - d(n+1), where d(n) = (57*18^n - 38*12^n + 8*8^n)/(513*a(n)*a(n+1)*a(n+2)).
Sum_{n >= 1} 6^n/(a(n)*a(n+2)) = 14/25; Sum_{n >= 1} (-6)^n/(a(n)*a(n+2)) = -6/25.
Sum_{n >= 1} 6^n/(a(n)*a(n+3)) = 306/1805.
Sum_{n >= 1} 6^n/(a(n)*a(n+4)) = 4282/80275; Sum_{n >= 1} (-6)^n/(a(n)*a(n+4)) = -1698/80275. (End)

Extensions

Edited by Charles R Greathouse IV, Mar 24 2010

A020914 Number of digits in the base-2 representation of 3^n.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23, 24, 26, 27, 29, 31, 32, 34, 35, 37, 39, 40, 42, 43, 45, 46, 48, 50, 51, 53, 54, 56, 58, 59, 61, 62, 64, 65, 67, 69, 70, 72, 73, 75, 77, 78, 80, 81, 83, 85, 86, 88, 89, 91, 92, 94, 96, 97, 99, 100, 102, 104, 105, 107
Offset: 0

Views

Author

Keywords

Comments

Also, numbers k such that the first digit in the ternary expansion of 2^k is 1. - Mohammed Bouayoun (Mohammed.bouayoun(AT)sanef.com), Apr 24 2006
a(n) is the smallest integer such that n/a(n) < log_2(3). - Trevor G. Hyde (thyde12(AT)amherst.edu), Jul 31 2008
This sequence represents allowable values of the "dropping time" in the Collatz (3x+1) problem when iterated according to the function f(n) := n/2 if n is even, (3n+1)/2 otherwise, as tabulated in A126241. There is one exception, A126241(1), which has been set to zero by convention. - K. Spage, Oct 22 2009
An integer k is a term of A020914 if and only if floor(k*(1 + log(2)/log(3))) - abs(k-1)*(1 + log(2)/log(3)) - 1 >= 0. - K. Spage, Oct 22 2009
Also smallest k such that ceiling(2^k / 3^n) = 2. - Michel Lagneau, Jan 31 2012
For n > 0, first differences of A022330. - Michel Marcus, Oct 03 2013
Also the number of powers of two less than or equal to 3^n. - Robert G. Wilson v, May 25 2014
Except for 1, A020914 is the complement of A054414 and therefore these two form a pair of Beatty sequences. - Robert G. Wilson v, May 25 2014

Crossrefs

Cf. A056576, A054414, A070939, A000244, A227048, A022330, A022921 (first differences), A126241.
Cf. A020857 (decimal expansion of log_2(3)).
Cf. A020915.
Cf. A204399 (essentially the same).

Programs

Formula

a(n) = floor(1 + n*log(3)/log(2)). - K. Spage, Oct 22 2009
a(0) = 1, a(n+1) = a(n) + A022921(n). - K. Spage, Oct 23 2009
a(n) = A122437(n-1) - n. - K. Spage, Oct 23 2009
A098294(n) = a(n) + n for n > 0. - Mike Winkler, Dec 31 2010
a(n) = A070939(A000244(n)) = length of n-th row in triangle A227048. - Reinhard Zumkeller, Jun 30 2013
a(n) = 1 + floor(n*log_2(3)) = 1 + A056576(n) = 1 + floor(n*A020857). - L. Edson Jeffery, Dec 12 2014
A020915(a(n)) = n + 1. - Reinhard Zumkeller, Mar 28 2015

Extensions

More terms from Stefan Steinerberger, Apr 19 2006

A100982 Number of admissible sequences of order j; related to 3x+1 problem and Wagon's constant.

Original entry on oeis.org

1, 1, 2, 3, 7, 12, 30, 85, 173, 476, 961, 2652, 8045, 17637, 51033, 108950, 312455, 663535, 1900470, 5936673, 13472296, 39993895, 87986917, 257978502, 820236724, 1899474678, 5723030586, 12809477536, 38036848410, 84141805077, 248369601964
Offset: 1

Views

Author

Steven Finch, Jan 13 2005

Keywords

Comments

Eric Roosendaal counted all admissible sequences up to order j=1000 (2005). Note: there is a typo in both Wagon and Chamberland in the definition of Wagon's constant 9.477955... The expression floor(1 + 2*i + i*log_2(3)) should be replaced by floor(1 + i + i*log_2(3)).
The length of all admissible sequences of order j is A020914(j). - T. D. Noe, Sep 11 2006
Conjecture: a(n) is given for each n > 3 by a formula using a(2)..a(n-1). This allows us to create an iterative algorithm which generates a(n) for each n > 6. This has been proved for each n <= 53. For higher values of n the algorithm must be slightly modified. - Mike Winkler, Jan 03 2018
Theorem 1: a(k) is given for each k > 1 by a formula using a(1)..a(k-1). Namely, a(1)=1 and a(k+1) = Sum_{m=1..k} (-1)^(m-1)*binomial(floor((k-m+1)*(log(3)/log(2))) + m - 1, m)*a(k-m+1) for k >= 1. - Vladimir M. Zarubin, Sep 25 2015
Theorem 2: a(n) can be generated for each n > 2 algorithmically in a Pascal's triangle-like manner from the two starting values 0 and 1. This result is based on the fact that the Collatz residues (mod 2^k) can be evolved according to a binary tree. There is a direct connection with A076227, A056576 and A022921. - Mike Winkler, Sep 12 2017
A177789 shows another theorem and algorithm for generating a(n). - Mike Winkler, Sep 12 2017

Examples

			The unique admissible sequence of order 1 is 3/2, 1/2.
The unique admissible sequence of order 2 is 3/2, 3/2, 1/2, 1/2.
The two admissible sequences of order 3 are 3/2, 3/2, 3/2, 1/2, 1/2 and 3/2, 3/2, 1/2, 3/2, 1/2.
a(13) = 8045 = binomial(floor(5*(13-2)/3), 13-2)
- Sum_{i=2..6} binomial(floor((3*(13-i)+0)/2), 13-i)*a(i)
- Sum_{i=7..11} binomial(floor((3*(13-i)-1)/2), 13-i)*a(i)
- Sum_{i=12..12} binomial(floor((3*(13-i)-2)/2), 13-i)*a(i)
= 31824 - 4368*1 - 3003*2 - 715*3 - 495*7 - 120*12 - 28*30 - 21*85 - 5*173 - 4*476 - 1*961 - 0*2652. (Conjecture)
From _Mike Winkler_, Sep 12 2017: (Start)
The next table shows how Theorem 2 works. No entry is equal to zero.
n =       3  4  5   6   7   8   9  10  11   12 .. |A076227(k)=
--------------------------------------------------|
k =  2 |  1                                       |     1
k =  3 |  1  1                                    |     2
k =  4 |     2  1                                 |     3
k =  5 |        3   1                             |     4
k =  6 |        3   4   1                         |     8
k =  7 |            7   5   1                     |    13
k =  8 |               12   6   1                 |    19
k =  9 |               12  18   7   1             |    38
k = 10 |                   30  25   8   1         |    64
k = 11 |                   30  55  33   9    1    |   128
:      |                        :   :   :    : .. |    :
--------------------------------------------------|---------
a(n) =    2  3  7  12  30  85 173 476 961 2652 .. |
The entries (k,n) in this table are generated by the rule (k+1,n) = (k,n) + (k,n-1). The last value of (k+1,n) is given by k+1 = A056576(n-1), or the highest value in column n is given twice only if A022921(n-2) = 2. Then a(n) is equal to the sum of the entries in column n. For n = 7 there is 1 = 0 + 1, 5 = 1 + 4, 12 = 5 + 7, 12 = 12 + 0. Therefore a(7) = 1 + 5 + 12 + 12 = 30. The sum of row k is equal to A076227(k). (End)
From _Ruud H.G. van Tol_, Dec 04 2023: (Start)
A tree view.
n-tree--A098294--ids-----paths-----------------a(n)
0 ._          0  0       0                       -
1 |_          1  1       10                      1
2 |_._        2  2       1100                    1
3 |_|_        2  3-4     11010     -   11100     2
4 |_|_._      3  5-7     1101100   -  1111000    3
5 |_|_|_      3  8-14    11011010  - 11111000    7
6 |_|_|_._    4  15-26   1101101100-1111110000  12
7 |_|_|_|_._  5  27-56   ...                    30
8 |_|_|_|_|_  5  57-141  ...                    85
...
For n>=1, the endpoints are at A098294(n) to the right.
(End)
		

Crossrefs

Cf. A122790 (Wagon's constant), A076227, A056576, A022921, A098294, A177789.

Programs

  • Mathematica
    (* based on Eric Roosendaal's algorithm *) nn=100; Clear[x,y]; Do[x[i]=0, {i,0,nn+1}]; x[1]=1; t=Table[Do[y[cnt]=x[cnt]+x[cnt-1], {cnt,p+1}]; Do[x[cnt]=y[cnt], {cnt,p+1}]; admis=0; Do[If[(p+1-cnt)*Log[3]T. D. Noe, Sep 11 2006 *)
  • PARI
    /* translation of the above code from T. D. Noe */
    {limit=100; n=1; x=y=vector(limit+1); x[1]=1; for(b=2, limit, for(c=2, b+1, y[c]=x[c]+x[c-1]); for(c=2, b+1, x[c]=y[c]); a_n=0; for(c=1, b+1, if((b+1-c)*log(3)Mike Winkler, Feb 28 2015
    
  • PARI
    /* algorithm for the Conjecture */
    {limit=53; zn=vector(limit); zn[2]=1; zn[3]=2; zn[4]=3; zn[5]=7; zn[6]=12; f=1; e1=-1; e2=-2; for(n=7, limit, m=floor((n-1)*log(3)/log(2))-(n-1); j=(m+n-2)!/(m!*(n-2)!); if(n>6*f, if(frac(n/2)==0, e=e1, e=e2)); if(frac((n-6 )/12)==0, f++; e1=e1+2); if(frac((n-12)/12)==0, f++; e2=e2+2); Sum=a=b=0; c=1; d=5; until(c>=n-1, for(i=2+a*5+b, 1+d+a*5, if(i>11 && frac((i+2)/6)==0, b++); delta=e-a; Sum=Sum+binomial(floor((3*(n-i)+delta)/2),n-i)*zn[i]; c++); a++; for(k=3, 50, if(n>=k*6 && a==k-1, d=k+3))); zn[n]=j-Sum; print(n" "zn[n]))} \\ Mike Winkler, Jan 03 2018
    
  • PARI
    /* cf. code for Theorem 2 */
    {limit=100; /*or limit>100*/ p=q=vector(limit); c=2; w=log(3)/log(2); for(n=3, limit, p[1]=Sum=1; for(i=2, c, p[i]=p[i-1]+q[i]; Sum=Sum+p[i]); a_n=Sum; print(n" "a_n); for(i=1, c, q[i]=p[i]); d=floor(n*w)-floor((n-1)*w); if(d==2, c++)); } \\ Mike Winkler, Apr 14 2015
    
  • PARI
    /* algorithm for Theorem 1 */
    n=20; a=vector(n); log32=log(3)/log(2);
    {a[1]=1; for ( k=1, n-1, a[k+1]=sum( m=1,k,(-1)^(m-1)*binomial( floor( (k-m+1)*log32)+m-1,m)*a[k-m+1] ); print(k" "a[k]) );
    } \\ Vladimir M. Zarubin, Sep 25 2015
    
  • PARI
    /* algorithm for Theorem 2 */
    {limit=30; /*or limit>30*/ R=matrix(limit,limit); R[2,1]=0; R[2,2]=1; for(n=2, limit, print; print1("For n="n" in column n: "); Kappa_n=floor(n*log(3)/log(2)); a_n=0; for(k=n, Kappa_n, R[k+1,n]=R[k,n]+R[k,n-1]; print1(R[k+1,n]", "); a_n=a_n+R[k+1,n]); print; print(" and the sum is a(n)="a_n))} \\ Mike Winkler, Sep 12 2017

Formula

A sequence s(k), where k=1, 2, ..., n, is *admissible* if it satisfies s(k)=3/2 exactly j times, s(k)=1/2 exactly n-j times, s(1)*s(2)*...*s(n) < 1 but s(1)*s(2)*...*s(m) > 1 for all 1 < m < n.
a(n) = (m+n-2)!/(m!*(n-2)!) - Sum_{i=2..n-1} binomial(floor((3*(n-i)+b)/2), n-i)*a(i), where m = floor((n-1)*log_2(3))-(n-1) and b assumes different integer values within the sum at intervals of 5 or 6 terms. (Conjecture)
a(n) = Sum_{k=n-1..A056576(n-1)} (k,n). (Theorem 2, cf. example)
a(k) = 2*A076227(A020914(k)-1) - A076227(A020914(k)), for k > 0. - Vladimir M. Zarubin, Sep 29 2019
a(1)=1, a(n) = Sum_{k=0..A020914(n-1)-n-2} A325904(k)*binomial(A020914(n-1)-k-2, n-2) for n>1. - Benjamin Lombardo, Oct 18 2019

Extensions

Two more terms from Jules Renucci (jules.renucci(AT)wanadoo.fr), Nov 02 2005
More terms from T. D. Noe, Sep 11 2006

A227048 Irregular triangle read by rows: row n, for n >= 0, lists the nonnegative differences 3^n - 2^m, m >= 0, in increasing order.

Original entry on oeis.org

0, 1, 2, 1, 5, 7, 8, 11, 19, 23, 25, 26, 17, 49, 65, 73, 77, 79, 80, 115, 179, 211, 227, 235, 239, 241, 242, 217, 473, 601, 665, 697, 713, 721, 725, 727, 728, 139, 1163, 1675, 1931, 2059, 2123, 2155, 2171, 2179, 2183, 2185, 2186, 2465, 4513, 5537, 6049, 6305
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 29 2013

Keywords

Comments

A020914(n) = length of n-th row;
T(n,1) = A056577(n);
T(n,A098294(n)) = A001047(n);
T(n,A020914(n)) = A024023(n);
T(n,k) = A196486(n,A020914(n)-k) for n > 0, k = 1..A056576(n).

Examples

			Initial rows:
0:  0
1:  1,2
2:  1,5,7,8
3:  11,19,23,25,26 (= 27-16, 27-8, 27-4, 27-2, 27-1)
4:  17,49,65,73,77,79,80
5:  115,179,211,227,235,239,241,242
6:  217,473,601,665,697,713,721,725,727,728
7:  139,1163,1675,1931,2059,2123,2155,2171,2179,2183,2185,2186
8:  2465,4513,5537,6049,6305,6433,6497,6529,6545,6553,6557,6559,6560
...
		

Crossrefs

Programs

  • Haskell
    a227048 n k = a227048_tabf !! n !! (k-1)
    a227048_row n = a227048_tabf !! n
    a227048_tabf = map f a000244_list  where
       f x = reverse $ map (x -) $ takeWhile (<= x) a000079_list

Extensions

Definition revised by N. J. A. Sloane, Oct 11 2019

A005378 The female of a pair of recurrences.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

F(n) is not equal to M(n) if and only if n+1 is a Fibonacci number (A000045); a(n) = A005379(n) + A192687(n). - Reinhard Zumkeller, Jul 12 2011
Differs from A098294 at indices n = 0, 17, 20, 22, 25, 27, 29, 30, ... - M. F. Hasler, Jun 29 2014

References

  • Hofstadter, "Goedel, Escher, Bach", p. 137.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A005379.

Programs

  • Haskell
    a005378 n = a005378_list !! n
    a005378_list = 1 : zipWith (-) [1..] (map a005379 a005378_list)
    a005379 n = a005379_list !! n
    a005379_list = 0 : zipWith (-) [1..] (map a005378 a005379_list)
    -- Without memoization the original recursion would be feasible only for small n.
    -- Reinhard Zumkeller, Jul 12 2011
  • Mathematica
    f[0] = 1; m[0] = 0; f[n_] := f[n] = n - m[f[n-1]]; m[n_] := m[n] = n - f[m[n-1]]; Table[f[n], {n, 0, 73}] (* Jean-François Alcover, Jul 27 2011 *)

Formula

F(0) = 1; M(0) = 0; F(n) = n-M(F(n-1)); M(n) = n-F(M(n-1)).

Extensions

More terms from James Sellers, Jul 12 2000
Comment corrected by Jaroslav Krizek, Dec 25 2011

A097293 Contains exactly once every triple i,j,k such that 0

Original entry on oeis.org

1, 2, 3, 1, 2, 4, 1, 2, 5, 1, 3, 4, 1, 2, 6, 1, 3, 5, 2, 3, 4, 1, 2, 7, 1, 3, 6, 1, 4, 5, 2, 3, 5, 1, 2, 8, 1, 3, 7, 1, 4, 6, 2, 3, 6, 2, 4, 5, 1, 2, 9, 1, 3, 8, 1, 4, 7, 1, 5, 6, 2, 3, 7, 2, 4, 6, 3, 4, 5, 1, 2, 10, 1, 3, 9, 1, 4, 8, 1, 5, 7, 2, 3, 8, 2, 4, 7, 2, 5, 6, 3, 4, 6, 1, 2, 11, 1, 3, 10, 1, 4, 9, 1, 5, 8
Offset: 1

Views

Author

Clark Kimberling, Aug 05 2004

Keywords

Crossrefs

Cf. A001399 (runlengths of sums), A098294.

Programs

  • Maple
    f:= proc(n) local i,j;
      seq(seq(op([i,j,n-i-j]),j = i+1 .. (n-i-1)/2),i=1..n/3);
    end proc:
    map(f, [$1..20]); # Robert Israel, May 09 2024
  • PARI
    a_rows(N) = [[Vec(e)+[0,1,2] |e<-partitions(n,,[3,3])] |n<-[3..N+2]]; \\ Ruud H.G. van Tol, May 09 2024

Formula

Terms are lexically ordered in triples by sum: 1 2 3 (sum = 6) 1 2 4 (sum = 7) 1 2 5, then 1 3 4 (two triples having sum = 8), etc.

A206807 Position of 3^n when {2^j} and {3^k} are jointly ranked; complement of A206805.

Original entry on oeis.org

2, 5, 7, 10, 12, 15, 18, 20, 23, 25, 28, 31, 33, 36, 38, 41, 43, 46, 49, 51, 54, 56, 59, 62, 64, 67, 69, 72, 74, 77, 80, 82, 85, 87, 90, 93, 95, 98, 100, 103, 105, 108, 111, 113, 116, 118, 121, 124, 126, 129, 131, 134, 137, 139, 142, 144, 147, 149, 152, 155
Offset: 1

Views

Author

Clark Kimberling, Feb 16 2012

Keywords

Comments

The joint ranking is for j >= 1 and k >= 1, so that the sets {2^j} and {3^k} are disjoint.

Examples

			The joint ranking begins with 2,3,4,8,9,16,27,32,64,81,128,243,256, so that
A206805 = (1,3,4,6,8,9,11,13,...)
A206807 = (2,5,7,10,12,...)
		

Crossrefs

Programs

  • Mathematica
    f[n_] := 2^n; g[n_] := 3^n; z = 200;
    c = Table[f[n], {n, 1, z}]; s = Table[g[n], {n, 1, z}];
    j = Sort[Union[c, s]];
    p[n_] := Position[j, f[n]]; q[n_] := Position[j, g[n]];
    Flatten[Table[p[n], {n, 1, z}]]           (* A206805 *)
    Table[n + Floor[n*Log[3, 2]], {n, 1, 50}] (* A206805 *)
    Flatten[Table[q[n], {n, 1, z}]]           (* this sequence *)
    Table[n + Floor[n*Log[2, 3]], {n, 1, 50}] (* this sequence as a table *)
  • PARI
    a(n) = logint(3^n, 2) + n; \\ Ruud H.G. van Tol, Dec 10 2023

Formula

a(n) = n + floor(n*log_2(3)).
A206805(n) = n + floor(n*log_3(2)).
a(n) = n + A056576(n). - Michel Marcus, Dec 12 2023
a(n) = A098294(n) + 2*n - 1. - Ruud H.G. van Tol, Jan 22 2024

A368514 Irregular triangle T(n,k) read by rows: similar to A009766 but length of rows grows like log(3)/log(2).

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 2, 0, 1, 3, 3, 1, 4, 7, 0, 1, 5, 12, 12, 0, 1, 6, 18, 30, 30, 1, 7, 25, 55, 85, 0, 1, 8, 33, 88, 173, 173, 1, 9, 42, 130, 303, 476, 0, 1, 10, 52, 182, 485, 961, 961, 0, 1, 11, 63, 245, 730, 1691, 2652, 2652, 1, 12, 75, 320, 1050, 2741, 5393, 8045, 0
Offset: 1

Views

Author

Ruud H.G. van Tol, Dec 28 2023

Keywords

Examples

			Triangle T(n,k) begins:
 n|k:1|  2|  3|  4|  5|  6|  7|  8|...
--+---+---+---+---+---+---+---+---+---
 1|  1
 2|  1   0
 3|  1   1
 4|  1   2   0
 5|  1   3   3
 6|  1   4   7   0
 7|  1   5  12  12   0
 8|  1   6  18  30  30
 9|  1   7  25  55  85   0
10|  1   8  33  88 173 173
11|  1   9  42 130 303 476   0
12|  1  10  52 182 485 961 961   0
...
		

Crossrefs

Cf. A009766 (Catalan's triangle), A098294 (row lengths), A100982 (row sums).

Programs

  • PARI
    row(n) = my(v=Vec([1], logint(3^n, 2)+1-n), c=1); for(i=2, n, for(j=2, c, v[j]+=v[j-1]); c=logint(3^i,2)+1-i); v
    
  • PARI
    rows(n) = my(v=vector(n, i, Vec([1], logint(3^i,2)+1-i))); for(i=3, n, for(j=2, #v[i-1], v[i][j]=v[i][j-1]+v[i-1][j])); v

Formula

Row length L(n) = A098294(n) = floor(n*log(3)/log(2)) + 1 - n.
T(n,1) = 1.
T(n+1,k) = T(n+1,k-1) + T(n,k) for 1 < k <= L(n).
T(n+1,L(n+1)) = 0 if L(n+1) > L(n).
T(n+1,2) = n-1.
T(n+3,3) = A055998(n-1) = (n-1)*(n+4)/2.
T(n+5,4) = A111396(n-1) = (n-1)*(n+6)*(n+7)/6.
T(n+1,k) = Sum_{j=1..k} T(n,j) for 1 <= k <= L(n).

Extensions

Corrected by Ruud H.G. van Tol, Nov 29 2024

A098295 ((3/2)^n)/2^a(n) lies in the half-open interval [1,2).

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Oct 18 2004

Keywords

Comments

Stacking perfect fifths (the frequency ratio of a fifth is 3/2), a division by 2^a(n) leads the equivalent tone belonging to the first octave interval [1,2). For example, the third fifth, (3/2)^3, falls into the second octave. This means it lies in the interval [2^1,2^2)=[2,4). Hence ((3/2)^3)/2^1 belongs to the first octave, the interval [1,2).
This sequence coincides for the first 93 term with the floor of y(n)= 4*Pi*log(phi)*n/(Pi^2 + (2*log(phi)^2)), with phi:=(1+sqrt(5))/2. a(n) = floor(y(n)), for n=1..93. Note that y(n) is not the imaginary part of the zero of the Fibonacci function because of a different bracket setting. See A214656. - Wolfdieter Lang, Jul 24 2012

Examples

			(3/2)^12 lies in the eighth octave [2^7,2^8) and
((3/2)^12)/2^a(12)= ((3/2)^12)/2^7 = 3^12/2^19 = 531441/524288 = 1.01363... belongs to the first octave [1,2). This ratio is called the Pythagorean comma.
		

Crossrefs

This sequence differs from A074840 for the first time at entry a(41)=23: A074840(41)=24.

Programs

Formula

a(n) = A098294(n)-1, n >= 1.
a(n) = ceiling(tau*n)-1 with tau = log(3)/log(2)-1 = 0.58496250072..., n >= 1.
a(n) = A056576(n) - n. - Ruud H.G. van Tol, Jan 26 2024

A195119 a(n) = 2*n - floor(n*sqrt(2)).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 09 2011

Keywords

Comments

Not A077467, which has only one 17; not A098294, which has two 41's.

Crossrefs

Cf. A005843 (2n), A001951 (floor(n*sqrt(2))).

Programs

  • Magma
    [2*n-Floor(n*Sqrt(2)): n in [0..70]]; // Vincenzo Librandi, Sep 12 2011
    
  • Maple
    seq(2*n-floor(n*sqrt(2)),n=0..80); # Muniru A Asiru, Sep 30 2018
  • Mathematica
    Table[2*n - Floor[n*Sqrt[2]], {n,0,100}] (* G. C. Greubel, Sep 29 2018 *)
  • PARI
    vector(100, n, n--; 2*n-floor(n*sqrt(2))) \\ G. C. Greubel, Sep 29 2018

Formula

a(n) = A005843(n) - A001951(n). - Michel Marcus, Sep 30 2018
Showing 1-10 of 10 results.