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

A062318 Numbers of the form 3^m - 1 or 2*3^m - 1; i.e., the union of sequences A048473 and A024023.

Original entry on oeis.org

0, 1, 2, 5, 8, 17, 26, 53, 80, 161, 242, 485, 728, 1457, 2186, 4373, 6560, 13121, 19682, 39365, 59048, 118097, 177146, 354293, 531440, 1062881, 1594322, 3188645, 4782968, 9565937, 14348906, 28697813, 43046720, 86093441, 129140162
Offset: 1

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 05 2001

Keywords

Comments

WARNING: The offset of this sequence has been changed from 0 to 1 without correcting the formulas and programs, many of them correspond to the original indexing a(0)=0, a(1)=1, ... - M. F. Hasler, Oct 06 2014
Numbers n such that no entry in n-th row of Pascal's triangle is divisible by 3, i.e., such that A062296(n) = 0.
The base 3 representation of these numbers is 222...222 or 122...222.
a(n+1) is the smallest number with ternary digit sum = n: A053735(a(n+1)) = n and A053735(m) <> n for m < a(n+1). - Reinhard Zumkeller, Sep 15 2006
A138002(a(n)) = 0. - Reinhard Zumkeller, Feb 26 2008
Also, number of terms in S(n), where S(n) is defined in A114482. - N. J. A. Sloane, Nov 13 2014
a(n+1) is also the Moore lower bound on the order of a (4,g)-cage. - Jason Kimberley, Oct 30 2011

Examples

			The first rows in Pascal's triangle with no multiples of 3 are:
row 0: 1;
row 1: 1, 1;
row 2: 1, 2,  1;
row 5: 1, 5, 10, 10,  5,  1;
row 8: 1, 8, 28, 56, 70, 56, 28, 8, 1;
		

Crossrefs

Cf. A062296, A024023, A048473, A114482. Pairwise sums of A052993.
Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), A027383 (k=3), this sequence (k=4), A061547 (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), A005843 (g=4), A002522 (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 30 2011
Cf. A037233 (actual order of a (4,g)-cage).
Smallest number whose base b sum of digits is n: A000225 (b=2), this sequence (b=3), A180516 (b=4), A181287 (b=5), A181288 (b=6), A181303 (b=7), A165804 (b=8), A140576 (b=9), A051885 (b=10).

Programs

  • Magma
    I:=[0,1,2]; [n le 3 select I[n] else Self(n-1)+3*Self(n-2) -3*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Apr 20 2012
    
  • Maple
    A062318 :=proc(n)
        if n mod 2 = 1 then
            3^((n-1)/2)-1
        else
            2*3^(n/2-1)-1
        fi
    end proc:
    seq(A062318(n), n=1..37); # Emeric Deutsch, Feb 03 2005, offset updated
  • Mathematica
    CoefficientList[Series[x^2*(1+x)/((1-x)*(1-3*x^2)),{x,0,40}],x] (* Vincenzo Librandi, Apr 20 2012 *)
    A062318[n_]:= (1/3)*(Boole[n==0] -3 +3^(n/2)*(2*Mod[n+1,2] +Sqrt[3] *Mod[n, 2]));
    Table[A062318[n], {n, 50}] (* G. C. Greubel, Apr 17 2023 *)
  • PARI
    a(n)=3^(n\2)<M. F. Hasler, Oct 06 2014
    
  • SageMath
    def A062318(n): return (1/3)*(int(n==0) - 3 + 2*((n+1)%2)*3^(n/2) + (n%2)*3^((n+1)/2))
    [A062318(n) for n in range(1,41)] # G. C. Greubel, Apr 17 2023

Formula

a(n) = 2*3^(n/2-1)-1 if n is even; a(n) = 3^(n/2-1/2)-1 if n is odd. - Emeric Deutsch, Feb 03 2005, offset updated.
From Paul Curtz, Feb 21 2008: (Start)
a(n) = a(n-1) + 3*a(n-2) - 3*a(n-3).
Partial sums of A108411. (End)
G.f.: x^2*(1+x)/((1-x)*(1-3*x^2)). - Colin Barker, Apr 02 2012
a(2n+1) = 3*a(2n-1) + 2; a(2n) = ( a(2n-1) + a(2n+1) )/2. See A060647 for case where a(1)= 1. - Richard R. Forberg, Nov 30 2013
a(n) = 2^((1+(-1)^n)/2) * 3^((2*n-3-(-1)^n)/4) - 1. - Luce ETIENNE, Aug 29 2014
a(n) = A052993(n-1) + A052993(n-2). - R. J. Mathar, Sep 10 2021
E.g.f.: (1 - 3*cosh(x) + 2*cosh(sqrt(3)*x) - 3*sinh(x) + sqrt(3)*sinh(sqrt(3)*x))/3. - Stefano Spezia, Apr 06 2022
a(n) = (1/3)*([n=0] - 3 + (1+(-1)^n)*3^(n/2) + ((1-(-1)^n)/2)*3^((n+1)/2)). - G. C. Greubel, Apr 17 2023

Extensions

More terms from Emeric Deutsch, Feb 03 2005
Entry revised by N. J. A. Sloane, Jul 29 2011

A087503 a(n) = 3(a(n-2) + 1), with a(0) = 1, a(1) = 3.

Original entry on oeis.org

1, 3, 6, 12, 21, 39, 66, 120, 201, 363, 606, 1092, 1821, 3279, 5466, 9840, 16401, 29523, 49206, 88572, 147621, 265719, 442866, 797160, 1328601, 2391483, 3985806, 7174452, 11957421, 21523359, 35872266, 64570080, 107616801, 193710243
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 11 2003

Keywords

Crossrefs

Sequences with similar recurrence rules: A027383 (p=2), A133628 (p=4), A133629 (p=5).
Other related sequences for different p: A016116 (p=2), A038754 (p=3), A084221 (p=4), A133632 (p=5).
See A133629 for general formulas with respect to the recurrence rule parameter p.
Related sequences: A132666, A132667, A132668, A132669.

Programs

  • Magma
    [(3/2)*(3^Floor((n+1)/2)+3^Floor(n/2)-3^Floor((n-1)/2)-1): n in [0..40]]; // Vincenzo Librandi, Aug 16 2011
  • Maple
    A087503 := proc(n)
        option remember;
        if n <=1 then
            op(n+1,[1,3]) ;
        else
            3*procname(n-2)+3 ;
        end if;
    end proc:
    seq(A087503(n),n=0..20) ; # R. J. Mathar, Sep 10 2021
  • Mathematica
    RecurrenceTable[{a[0]==1,a[1]==3,a[n]==3(a[n-2]+1)},a,{n,40}] (* or *) LinearRecurrence[{1,3,-3},{1,3,6},40] (* Harvey P. Dale, Jan 01 2015 *)

Formula

a(n) = a(n-1) + A038754(n). (i.e., partial sums of A038754).
From Hieronymus Fischer, Sep 19 2007, formulas adjusted to offset, Dec 29 2012: (Start)
G.f.: g(x) = (1+2x)/((1-3x^2)(1-x)).
a(n) = (3/2)*(3^((n+1)/2)-1) if n is odd, else a(n) = (3/2)*(5*3^((n-2)/2)-1).
a(n) = (3/2)*(3^floor((n+1)/2) + 3^floor(n/2) - 3^floor((n-1)/2)-1).
a(n) = 3^floor((n+1)/2) + 3^floor((n+2)/2)/2 - 3/2.
a(n) = A132667(a(n+1)) - 1.
a(n) = A132667(a(n-1) + 1) for n > 0.
A132667(a(n)) = a(n-1) + 1 for n > 0.
Also numbers such that: a(0)=1, a(n) = a(n-1) + (p-1)*p^((n+1)/2 - 1) if n is odd, else a(n) = a(n-1) + p^(n/2), where p=3.
(End)
a(n) = A052993(n)+2*A052993(n-1). - R. J. Mathar, Sep 10 2021

Extensions

Additional comments from Hieronymus Fischer, Sep 19 2007
Edited by N. J. A. Sloane, May 04 2010. I merged two essentially identical entries with different offsets, so some of the formulas may need to be adjusted.
Formulas and MAGMA prog adjusted to offset 0 by Hieronymus Fischer, Dec 29 2012

A358027 Expansion of g.f.: (1 + x - 2*x^2 + 2*x^4)/((1-x)*(1-3*x^2)).

Original entry on oeis.org

1, 2, 3, 6, 11, 20, 35, 62, 107, 188, 323, 566, 971, 1700, 2915, 5102, 8747, 15308, 26243, 45926, 78731, 137780, 236195, 413342, 708587, 1240028, 2125763, 3720086, 6377291, 11160260, 19131875, 33480782, 57395627
Offset: 0

Views

Author

G. C. Greubel, Oct 31 2022

Keywords

Crossrefs

Programs

  • Magma
    I:=[3,6,11]; [1,2] cat [n le 3 select I[n] else Self(n-1) +3*Self(n-2) -3*Self(n-3): n in [1..60]];
    
  • Mathematica
    LinearRecurrence[{1,3,-3}, {1,2,3,6,11}, 61]
  • SageMath
    def A254006(n): return 3^(n/2)*(1 + (-1)^n)/2
    def A358027(n): return (1/3)*( 4*A254006(n) + 7*A254006(n-1) +2*int(n==0) + 2*int(n==1) - 3 )
    [A358027(n) for n in (0..60)]

Formula

a(n) = (1/3)*(2*[n=0] + 2*[n=1] - 3 + 4*A254006(n) + 7*A254006(n-1)).
a(n) = a(n-1) - 3*a(n-2) + 3*a(n-3), for n >= 5.
E.g.f.: (1/3)*( 2 + 2*x - 3*exp(x) + 4*cosh(sqrt(3)*x) + (7/sqrt(3))*sinh(sqrt(3)*x) ).
G.f.: (1 +x -2*x^2 +2*x^4)/((1-x)*(1-3*x^2)). - Clark Kimberling, Oct 31 2022

A372782 Least number m for which there exists some positive k < m where the sum of the integers from k + 1 to m inclusive is an n-th power > 1.

Original entry on oeis.org

2, 4, 7, 13, 22, 40, 67, 121, 202, 364, 607, 1093, 1822, 3280, 5467, 9841, 16402, 29524, 49207, 88573, 147622, 265720, 442867, 797161, 1328602, 2391484, 3985807, 7174453, 11957422, 21523360, 35872267, 64570081, 107616802, 193710244, 322850407, 581130733, 968551222, 1743392200
Offset: 1

Views

Author

Jean-Marc Rebert, May 14 2024

Keywords

Comments

With triangular sum T(i) = i*(i+1)/2 = Sum_{j=1..i} i, the aim is T(m) - T(k) = b^n for some b. T(m) - T(k) = (m+k+1)*(m-k)/2 so if m-k is odd then use m-k = b^x to eliminate k in the other factor (m+k+1)/2 = b^(n-x), so that m = b^(n-x) + (b^x - 1)/2. If instead m+k+1 is odd then the resulting expression is the same. This form is an integer and minimized at b=3 and x = ceiling(n/2). - Kevin Ryde, May 18 2024

Examples

			a(2) = 4 because the sum of all integers from 3 + 1 to 4 inclusive is 4 = 2^2, a square.
a(3) = 7 as we have 2 + 3 + 4 + 5 + 6 + 7 = 27 = 3^3, i.e., m = 7 and k = 1. - _David A. Corneth_, May 15 2024
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, 3, -3}, {2, 4, 7}, 50] (* Paolo Xausa, Jun 09 2024 *)
  • PARI
    isok(m, n) = my(s = m*(m+1)/2); for (k=1, m-1, s -= k; if (ispower(s, n), return(k)););
    a(n) = my(m=1); while (! isok(m, n), m++); m; \\ Michel Marcus, May 16 2024
    
  • PARI
    a(n) = {
    	my(res, c, l, u);
    	res = 2^n; c = 8*3^n;
    	l = (sqrt(c) - 1)\2; u = res;
    	for(i = l, u,
    		if(issquare(4*(i + 1)*i + 1 - c),
    			return(i);
    		)
    	);
    	return(2^n)
    } \\ David A. Corneth, May 16 2024

Formula

a(n) = A087503(n-1) + 1.
a(n) = 3*a(n-2) + 1.
G.f.: x*(2 + 2*x - 3*x^2)/((1 - x)*(1 - 3*x^2)). - Stefano Spezia, May 18 2024

Extensions

More terms from David A. Corneth, May 16 2024
Showing 1-4 of 4 results.