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.

A131098 Partial sums of A151798.

Original entry on oeis.org

1, 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239
Offset: 1

Views

Author

Hans Isdahl, Sep 24 2007

Keywords

Comments

1 together with A004767. - Omar E. Pol, Feb 23 2014

Examples

			g.f. = x + 3*x^2 + 7*x^3 + 11*x^4 + 15*x^5 + 19*x^6 + 23*x^7 + 27*x^8 + ...
		

Crossrefs

Programs

  • Magma
    I:=[1,3,7]; [n le 3 select I[n] else 2*Self(n-1)-Self(n-2): n in [1..70]]; // Vincenzo Librandi, Feb 25 2014
    
  • Mathematica
    CoefficientList[Series[(x + 2 x^2 + 1)/(x - 1)^2, {x, 0, 80}], x] (* Vincenzo Librandi, Feb 25 2014 *)
    LinearRecurrence[{2,-1},{1,3,7},70] (* Harvey P. Dale, Jan 03 2023 *)
  • PARI
    A131098(n)=abs(4*n-5) \\ M. F. Hasler, Apr 27 2018

Formula

a(1) = 1, a(n) = 4*n - 5 for n >= 2. - Jaroslav Krizek, Aug 15 2009
G.f.: x*(x+2*x^2+1)/(x-1)^2. - R. J. Mathar, Dec 08 2010
E.g.f.: exp(x)*(4*x - 5) + 5 + 2*x. - Stefano Spezia, Mar 21 2025

Extensions

Edited by N. J. A. Sloane, Jun 29 2009

A174723 a(n) = n*(4*n^2 - 3*n + 5)/6.

Original entry on oeis.org

1, 5, 16, 38, 75, 131, 210, 316, 453, 625, 836, 1090, 1391, 1743, 2150, 2616, 3145, 3741, 4408, 5150, 5971, 6875, 7866, 8948, 10125, 11401, 12780, 14266, 15863, 17575, 19406, 21360, 23441, 25653, 28000, 30486, 33115, 35891, 38818, 41900, 45141
Offset: 1

Views

Author

Michel Lagneau, Mar 28 2010

Keywords

Comments

We prove that a(n) = Sum_{k=1..n^2} floor(sqrt(k)): a(n) = Sum_{k=1..3} 1 + Sum_{k=4..8} 2 + ... + Sum_{k=(n-1)^2..n^2 - 1} (n-1) + n = 3*1 + 5*2 + 7*3 + ... + (2n-1)(n-1)+ n = Sum_{k=1..n} (2k-1)*(k-1) + n = 2*Sum_{k=1..n} k^2 - 3*Sum_{k=1..n} k + 2n = 2n(n+1)(2n+1)/6 - 3n(n+1)/2 + 2n = n*(4n^2 - 3n + 5) / 6.
Notice that a(4) = 4 + 3*5 + 2*6 + 1*7 and a(8) = 8 + 7*9 + 6*10 + 5*11 + 4*12 + 3*13 + 2*14 + 1*15. In general, a(n) = n + Sum_{k=1..n-1} (n-k)*(n+k). - J. M. Bergot, Jul 31 2013

Examples

			From _Bruno Berselli_, Feb 17 2015: (Start)
Third differences:  1, 2,  4,  4,   4,   4,   4, (repeat 4) ... (A151798)
Second differences: 1, 3,  7, 11,  15,  19,  23,  27,   31, ... (A131098)
First differences:  1, 4, 11, 22,  37,  56,  79, 106,  137, ... (A084849)
-------------------------------------------------------------------------
This sequence:      1, 5, 16, 38,  75, 131, 210, 316,  453, ...
-------------------------------------------------------------------------
Partial sums:       1, 6, 22, 60, 135, 266, 476, 792, 1245, ... (A071239)
(End)
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 3rd ed., Oxford Univ. Press, 1954.

Crossrefs

Programs

  • Magma
    I:=[1, 5, 16, 38]; [n le 4 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..50]]; // Vincenzo Librandi, Jul 04 2012
    
  • Maple
    A174723 := proc(n)
            n*(4*n^2-3*n+5)/6 ;
    end proc:
    seq( A174723(n),n=1..20) ; # R. J. Mathar, Nov 07 2011
  • Mathematica
    Table[n (4n^2-3n+5)/6,{n,50}] (* or *) LinearRecurrence[{4,-6,4,-1},{1,5,16,38},50] (* Harvey P. Dale, Jan 16 2012 *)
  • PARI
    a(n)=n*(4*n^2-3*n+5)/6 \\ Charles R Greathouse IV, Oct 07 2015

Formula

G.f. x*(1 + x + 2*x^2) / (x-1)^4. - R. J. Mathar, Nov 07 2011
a(1)=1, a(2)=5, a(3)=16, a(4)=38; for n > 4, a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). - Harvey P. Dale, Jan 16 2012
a(n) = A022554(n^2). - Ridouane Oudra, Jun 13 2025

A255176 a(n) = H_n(2,2) where H_n is the n-th hyperoperator.

Original entry on oeis.org

3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Offset: 0

Views

Author

Natan Arie Consigli, Feb 25 2015

Keywords

Comments

See A054871 for definitions and key links.
Also, decimal expansion of 31/90. - Bruno Berselli, Mar 18 2015
Essentially the same as A010709, A040002, A113311, A123932, and A151798. - R. J. Mathar, Mar 20 2015
Remainder of the Euclidean division when 10^(10^n) is divided by 7 (proof by induction for n >= 1) [see reference Julien Freslon & Jérôme Poineau]; example: 10^(10^1) = 1428571428 * 7 + 4. - Bernard Schott, Aug 28 2020

Examples

			a(0) = H_0(2,2) = 2+1 = 3.
a(1) = H_1(2,2) = 2+2 = 4.
a(2) = H_2(2,2) = 2*2 = 4.
a(3) = H_3(2,2) = 2^2 = 4.
a(n) = H_n(2,2) = H_{n-1}(2,H_n(2,1)) = H_{n-1}(2,2) = 4, for n>1.
		

References

  • Julien Freslon & Jérôme Poineau, Les 100 exercices-types de mathématiques: MPSI/PCSI/PTSI, EdiScience, 2007, Exercice 11.2, page 242.

Crossrefs

Formula

G.f.: (3 + x)/(1 - x). - Bruno Berselli, Mar 18 2015
a(n) = 10^(10^n) mod 7. - Bernard Schott, Aug 28 2020

Extensions

Edited by Danny Rorabaugh, Oct 20 2015

A322419 Number of n-step self-avoiding walks on L-lattice.

Original entry on oeis.org

1, 2, 4, 8, 12, 20, 32, 52, 84, 136, 220, 356, 564, 904, 1448, 2320, 3684, 5872, 9376, 14960, 23688, 37652, 59912, 95316, 150744, 239080, 379528, 602424, 951788, 1507136, 2388252, 3784344, 5973988, 9447880, 14950796, 23658540, 37321752, 58965260, 93206864, 147333080, 232286272
Offset: 0

Views

Author

Robert FERREOL, Dec 07 2018

Keywords

Comments

The L-lattice is an oriented square lattice in which each step must be followed by a step perpendicular to the preceding one.

Examples

			a(1) = 2 because there are only two possible directions at each intersection; for the same reason a(2) = 2*2 and a(3) = 2*4 ; but a(4) = 12 (not 16) because four paths return to the starting point and are not self-avoiding. See the 12 paths under "links".
		

Crossrefs

Cf. A001411 (square lattice), A117633 (Manhattan lattice), A189722, A004277 (coordination sequence), A151798.

Programs

  • Maple
    walks:=proc(n)
        option remember;
        local i,father,End,X,walkN,dir,u,x,y;
        if n=1 then [[[0,0]]] else
             father:=walks(n-1):
             walkN:=NULL:
             for i to nops(father) do
                u:=father[i]:End:=u[n-1]:if n mod 2 = 0 then
                dir:=[[1,0], [-1, 0]] else dir := [[0,1], [0, -1]] fi:
                for X in dir do
                 if not(member(End+X,u)) then walkN:=walkN,[op(u),End+X] fi;
                 od od:
             [walkN] fi end:
    n:=5:L:=walks(n):N:=nops(L);
    # This program explicitly gives the a(n) walks.
  • Mathematica
    mo = {{1, 0}, {-1, 0}}; moo = {{0, 1}, {0, -1}}; a[0] = 1;
    a[tg_, p_: {{0, 0}}] := Module[{e, mv},
    If[Mod[tg, 2] == 0, mv = Complement[Last[p] + # & /@ mo, p],
    mv = Complement[Last[p] + # & /@ moo, p]];
    If[tg == 1, Length@mv, Sum[a[tg - 1, Append[p, e]], {e, mv}]]];
    a /@ Range[0, 20] (* after the program from Giovanni Resta at A001411 *)
  • Python
    def add(L, x):
        M = [y for y in L]
        M.append(x)
        return M
    plus = lambda L, M: [x + y for x, y in zip(L, M)]
    mo = [[1, 0], [-1, 0]]
    moo = [[0, 1], [0, -1]]
    def a(n, P=[[0, 0]]):
        if n == 0:
            return 1
        if n % 2 == 0:
            mv1 = [plus(P[-1], x) for x in mo]
        else:
            mv1 = [plus(P[-1], x) for x in moo]
        mv2 = [x for x in mv1 if x not in P]
        if n == 1:
            return len(mv2)
        else:
            return sum(a(n - 1, add(P, x)) for x in mv2)
    [a(n) for n in range(21)]

Formula

a(n) = 4*A189722(n) for n >= 2.
It is proved that a(n)^(1/n) has a limit mu called the "connective constant" of the L-lattice; approximate value of mu: 1.5657. It is only conjectured that a(n + 1) ~ mu * a(n).

A172090 Triangle T(n, k) = f(n-k) + f(k) - f(n), where f(n) = -3*n with f(0) = 1, f(1) = -2, read by rows.

Original entry on oeis.org

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

Views

Author

Roger L. Bagula, Jan 25 2010

Keywords

Examples

			Triangle begins as:
  1;
  1, 1;
  1, 2, 1;
  1, 1, 1, 1;
  1, 1, 0, 1, 1;
  1, 1, 0, 0, 1, 1;
  1, 1, 0, 0, 0, 1, 1;
  1, 1, 0, 0, 0, 0, 1, 1;
  1, 1, 0, 0, 0, 0, 0, 1, 1;
  1, 1, 0, 0, 0, 0, 0, 0, 1, 1;
  1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1;
		

Crossrefs

Row sums are A151798.

Programs

  • Mathematica
    (* First program *)
    f[n_]:= f[n]= If[n < 2, (-1)^n*(n+1), -3*n];
    T[n_, k_]:= f[n-k] +f[k] -f[n];
    Table[T[n, k], {n, 0, 15}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Apr 29 2021 *)
    (* Second program *)
    T[n_, k_]:= If[n<3, Binomial[n, k], If[n==3 || k<2 || k>n-2, 1, 0]];
    Table[T[n, k], {n, 0, 15}, {k, 0, n}]//Flatten (* G. C. Greubel, Apr 29 2021 *)
  • Sage
    def f(n): return (-1)^n*(n+1) if (n<2) else -3*n
    def T(n,k): return f(n-k) + f(k) - f(n)
    flatten([[T(n,k) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Apr 29 2021

Formula

T(n, k) = f(n-k) + f(k) - f(n), where f(n) = -3*n with f(0) = 1, f(1) = -2.
From G. C. Greubel, Apr 29 2021: (Start)
T(n, k) is defined by T(n, 0) = T(n, 1) = T(n, n-1) = T(n, n) = T(3, k) = 1, T(2, 1) = 2 and 0 otherwise.
Sum_{k=0..n} T(n,k) = A151798(n). (End)

Extensions

Edited by G. C. Greubel, Apr 29 2021

A267649 a(0) = a(1) = 2 then a(n) = 4 for n>=2.

Original entry on oeis.org

2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Offset: 0

Views

Author

Natan Arie Consigli, Jan 19 2016

Keywords

Comments

Decimal expansion of 101/450.
Also list of smallest n-composites.
A hyperoperator aggregation b[n]c is n-composite if b,c are positive non-right-identity elements.
The identity elements are:
Hyper-0 (zeration): none.
Hyper-1 (addition): 0.
Hyper-2 (multiplication): 1.
Hyper-3 (exponentiation): 1.
Hyper-n (n>2): 1.
For more information on hyperoperations see A054871.
Essentially the same as A255176, A151798, A123932, A113311, A040002 and A010709. - R. J. Mathar, May 25 2023
Continued fraction expansion of 2 + sqrt(1/5) = 2 + sqrt(5)/5. - Elmo R. Oliveira, Aug 06 2024

Examples

			a(0) = 2 because 1 is the smallest non-identity element in zeration and 1[0]1=2;
a(1) = 2 because 1 is the smallest non-identity element in addition and 1[1]1=2;
a(2) = 4 because 2 is the smallest non-identity element in multiplication and 2[2]2=4;
a(3) = 4 because 2 is the smallest non-identity element in exponentiation and 2[2]2=4;
a(4) = 4 because 2 is the smallest non-identity element in titration and 2[2]2=4;
Etc.
		

Crossrefs

Cf. A000027 (1-composites), A002808 (composites), A267647 (3-composites), A097374 (4-composites).

Formula

a(n) = a[n]b where a,b are the positive smallest non-right-identity elements.
From Elmo R. Oliveira, Aug 06 2024: (Start)
G.f.: 4/(1 - x) - 2*(1 + x).
E.g.f.: 4*exp(x) - 2*(1 + x). (End)
Showing 1-6 of 6 results.