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.

A077221 a(0) = 0 and then alternately even and odd numbers in increasing order such that the sum of any two successive terms is a square.

Original entry on oeis.org

0, 1, 8, 17, 32, 49, 72, 97, 128, 161, 200, 241, 288, 337, 392, 449, 512, 577, 648, 721, 800, 881, 968, 1057, 1152, 1249, 1352, 1457, 1568, 1681, 1800, 1921, 2048, 2177, 2312, 2449, 2592, 2737, 2888, 3041, 3200, 3361, 3528, 3697, 3872, 4049, 4232
Offset: 0

Views

Author

Amarnath Murthy, Nov 03 2002

Keywords

Comments

This sequence arises from reading the line from 0, in the direction 0, 1, ... and the same line from 0, in the direction 0, 8, ..., in the square spiral whose vertices are the triangular numbers A000217. Cf. A139591, etc. - Omar E. Pol, May 03 2008
The general formula for alternating sums of powers of odd integers is in terms of the Swiss-Knife polynomials P(n,x) A153641 (P(n,0)-(-1)^k*P(n,2*k))/2. Here n=2, thus a(k) = |(P(2,0)-(-1)^k*P(2,2*k))/2|. - Peter Luschny, Jul 12 2009
Axis perpendicular to A046092 in the square spiral whose vertices are the triangular numbers A000217. See the comment above. - Omar E. Pol, Sep 14 2011
Column 8 of A195040. - Omar E. Pol, Sep 28 2011
Concentric octagonal numbers. A139098 and A069129 interleaved. - Omar E. Pol, Sep 17 2011
Subsequence of A194274. - Bruno Berselli, Sep 22 2011
Partial sums of A047522. - Reinhard Zumkeller, Jan 07 2012
Alternating sum of the first n odd squares in decreasing order, n >= 1. Also number of "ON" cells at n-th stage in simple 2-dimensional cellular automaton. The rules are: on the infinite square grid, start with all cells OFF, so a(0) = 0. Turn a single cell to the ON state, so a(1) = 1. At each subsequent step, the neighbor cells of each cell of the old generation are turned ON, and the cells of the old generation are turned OFF. Here "neighbor" refers to the eight adjacent cells of each ON cell. See example. - Omar E. Pol, Feb 16 2014

Examples

			From _Omar E. Pol_, Feb 16 2014: (Start)
Illustration of initial terms as a cellular automaton:
.
.                                   O O O O O O O
.                     O O O O O     O           O
.           O O O     O       O     O   O O O   O
.     O     O   O     O   O   O     O   O   O   O
.           O O O     O       O     O   O O O   O
.                     O O O O O     O           O
.                                   O O O O O O O
.
.     1       8           17              32
.
(End)
		

Crossrefs

Programs

Formula

a(2n) = 8*n^2, a(2n+1) = 8*n(n+1) + 1.
From Ralf Stephan, Mar 31 2003: (Start)
a(n) = 2*n^2 + 4*n + 1 [+1 if n is odd] with a(0)=1.
G.f.: x*(x^2+6*x+1)/(1-x)^3/(1+x). (End)
Row sums of triangle A131925; binomial transform of (1, 7, 2, 4, -8, 16, -32, ...). - Gary W. Adamson, Jul 29 2007
a(n) = a(-n); a(n+1) = A195605(n) - (-1)^n. - Bruno Berselli, Sep 22 2011
a(n) = 2*n^2 + ((-1)^n-1)/2. - Omar E. Pol, Sep 28 2011
Sum_{n>=1} 1/a(n) = Pi^2/48 + tan(Pi/(2*sqrt(2)))*Pi /(4*sqrt(2)). - Amiram Eldar, Jan 16 2023

Extensions

Extended by Ralf Stephan, Mar 31 2003

A085250 4 times hexagonal numbers: a(n) = 4*n*(2*n-1).

Original entry on oeis.org

0, 4, 24, 60, 112, 180, 264, 364, 480, 612, 760, 924, 1104, 1300, 1512, 1740, 1984, 2244, 2520, 2812, 3120, 3444, 3784, 4140, 4512, 4900, 5304, 5724, 6160, 6612, 7080, 7564, 8064, 8580, 9112, 9660, 10224, 10804, 11400, 12012, 12640, 13284
Offset: 0

Views

Author

Gary W. Adamson, Jun 23 2003

Keywords

Comments

a(n) also can represented as n concentric squares (see example). - Omar E. Pol, Aug 21 2011
Sequence found by reading the line from 0, in the direction 0, 4, ..., in the square spiral whose vertices are the triangular numbers A000217. - Omar E. Pol, Sep 03 2011

Examples

			From _Omar E. Pol_, Aug 21 2011: (Start)
Illustration of initial terms as concentric squares:
.
.                           o o o o o o o o o o
.                           o                 o
.            o o o o o o    o   o o o o o o   o
.            o         o    o   o         o   o
.     o o    o   o o   o    o   o   o o   o   o
.     o o    o   o o   o    o   o   o o   o   o
.            o         o    o   o         o   o
.            o o o o o o    o   o o o o o o   o
.                           o                 o
.                           o o o o o o o o o o
.
.      4          24                 60
.
(End)
		

Crossrefs

Programs

Formula

a(n) = A067239(n)/2, for n>0.
Sum_{n>0} 1/a(n) = log(2)/2.
a(n) = A000384(n)*4. - Omar E. Pol, Dec 11 2008
a(n) = 16*n + a(n-1) - 12 (with a(0)=0). - Vincenzo Librandi, Aug 08 2010
G.f.: 4*x*(1 + 3*x)/(1 - 3*x + 3*x^2 - x^3). - Colin Barker, Jan 04 2012
E.g.f.: 4*x*(2*x + 1)*exp(x). - G. C. Greubel, Jul 14 2017
a(n) = A046092(2n-1), for n > 0. - Bruce J. Nicholson, Sep 04 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/8 - log(2)/4. - Amiram Eldar, Mar 17 2022

Extensions

Edited by Don Reble, Nov 13 2005
Added zero, better definition, corrected offset and edited original formula. - Omar E. Pol, Dec 11 2008

A055461 Square decrescendo subsequences: triangle T(n,k) = (n-k)^2, n >= 1, 0 <= k < n.

Original entry on oeis.org

1, 4, 1, 9, 4, 1, 16, 9, 4, 1, 25, 16, 9, 4, 1, 36, 25, 16, 9, 4, 1, 49, 36, 25, 16, 9, 4, 1, 64, 49, 36, 25, 16, 9, 4, 1, 81, 64, 49, 36, 25, 16, 9, 4, 1, 100, 81, 64, 49, 36, 25, 16, 9, 4, 1, 121, 100, 81, 64, 49, 36, 25, 16, 9, 4, 1, 144, 121, 100, 81, 64, 49, 36, 25, 16, 9, 4, 1
Offset: 1

Views

Author

Henry Bottomley, Jun 26 2000

Keywords

Examples

			From _Omar E. Pol_, Jan 26 2014: (Start)
Triangle begins:
    1;
    4,  1;
    9,  4,  1;
   16,  9,  4,  1;
   25, 16,  9,  4,  1;
   36, 25, 16,  9,  4,  1;
   49, 36, 25, 16,  9,  4,  1;
   64, 49, 36, 25, 16,  9,  4,  1;
   81, 64, 49, 36, 25, 16,  9,  4,  1;
  100, 81, 64, 49, 36, 25, 16,  9,  4,  1;
  ...
For n = 7 the row sum is 49 + 36 + 25 + 16 + 9 + 4 + 1 = A000330(7) = 140.
The alternating row sum is 49 - 36 + 25 - 16 + 9 - 4 + 1 = A000217(7) = 28.
(End)
		

Crossrefs

Cf. A000217 (alternating row sums), A000330 (row sums).

Programs

  • Magma
    [(n-k)^2: k in [0..n-1], n in [1..15]]; // G. C. Greubel, Jan 31 2024
    
  • Maple
    for n from 1 to 10 do
      seq((n-k)^2, k=0..n-1)
    od; # Robert Israel, Jan 18 2018
  • Mathematica
    Table[Range[n,1,-1]^2,{n,20}]//Flatten (* Harvey P. Dale, Apr 17 2020 *)
  • SageMath
    flatten([[(n-k)^2 for k in range(n)] for n in range(1,16)]) # G. C. Greubel, Jan 31 2024

Formula

a(n) = A004736(n)^2.
Sum_{k=0..n-1} T(n, k) = A000330(n) (row sums). - Michel Marcus, Dec 31 2012
G.f. as triangle: x*(1+x)/((1-x*y)*(1-x)^3). - Robert Israel, Jan 18 2018
Sum_{k=0..n-1} (-1)^k*T(n, k) = A000217(n) (alternating row sums). - Omar E. Pol, Jan 24 2014
From G. C. Greubel, Jan 31 2024: (Start)
T(2*n-1, n-1) = A000290(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A000292(n).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = A194274(n).
Sum_{k=0..floor(n/2)} T(n, k) = A129371(n). (End)

A187093 a(0)=0, a(1)=a(2)=1; thereafter, a(n+1) = n^2 - a(n-1).

Original entry on oeis.org

0, 1, 1, 3, 8, 13, 17, 23, 32, 41, 49, 59, 72, 85, 97, 111, 128, 145, 161, 179, 200, 221, 241, 263, 288, 313, 337, 363, 392, 421, 449, 479, 512, 545, 577, 611, 648, 685, 721, 759, 800, 841, 881, 923, 968, 1013, 1057, 1103, 1152, 1201, 1249, 1299, 1352, 1405, 1457
Offset: 0

Views

Author

Benjamin Coinsin, Mar 04 2011

Keywords

Comments

The original definition was equivalent to: Let S(n) = sum_{i=0..n} a(i), then n^2+a(n)-S(n+1) = S(n-2). This in turn simplifies to the present definition.

Crossrefs

Programs

  • Maple
    A000034 := proc(n) op(1+(n mod 2),[1,2]) ; end proc:
    A187093 := proc(n) (n^2-1+(-1)^floor(n/2)*A000034(n))/2 ;end proc: # R. J. Mathar
  • Mathematica
    LinearRecurrence[{3, -4, 4, -3, 1}, {0, 1, 1, 3, 8}, 60] (* Jean-François Alcover, Mar 30 2020 *)
    Join[{0},RecurrenceTable[{a[1]==a[2]==1,a[n+1]==n^2-a[n-1]},a,{n,60}]] (* Harvey P. Dale, Jan 05 2023 *)
  • PARI
    a(n) = (n^2-1+(-1)^(n\2)*(1 + (n % 2)))/2; \\ Michel Marcus, Sep 11 2016
  • Python
    print(0, end=',')       # a(-1)=0
    prpr = prev = 1         # a(0)=a(1)=1
    for n in range(2, 77):
        print(prpr, end=',')
        curr = n*n - prpr   # a(n) = n^2 - a(n-2)
        prpr = prev
        prev = curr
    # from Alex Ratushnyak, Aug 05 2012
    

Formula

a(n) = (n^2 - 1 + (-1)^floor(n/2) * A000034(n))/2.
G.f.: x*(-1+2*x+x^3-4*x^2) / ( (x^2+1)*(x-1)^3 ).
a(2^(n+1)) = A081654(n). - Anton Zakharov, Sep 13 2016

Extensions

Edited by N. J. A. Sloane, Mar 09 2011
More terms from Alex Ratushnyak, Aug 05 2012

A194273 Concentric triangular numbers (see Comments lines for definition).

Original entry on oeis.org

0, 1, 3, 6, 9, 12, 15, 19, 24, 30, 36, 42, 48, 55, 63, 72, 81, 90, 99, 109, 120, 132, 144, 156, 168, 181, 195, 210, 225, 240, 255, 271, 288, 306, 324, 342, 360, 379, 399, 420, 441, 462, 483, 505, 528, 552, 576, 600, 624, 649, 675, 702, 729, 756, 783, 811
Offset: 0

Views

Author

Omar E. Pol, Aug 20 2011

Keywords

Comments

This can be interpreted as a cellular automaton on the infinite hexagonal net. The sequence gives the number of cells "ON" in the structure after n-th stage. A194272 gives the first differences. For a definition without words see the illustration of initial terms in the example section. For other concentric polygonal numbers see A194274, A194275 and A032528.
Also, row sums of an infinite square array T(n,k) in which column k lists 6*k-1 zeros followed by the numbers A008486 (see example).

Examples

			Using the numbers A008486 we can write:
0, 1, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36,...
0, 0, 0, 0, 0,  0,  0,  1,  3,  6,  9, 12, 15, 18,...
0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  1,...
And so on.
=========================================================
The sums of the columns give this sequence:
0, 1, 3, 6, 9, 12, 15, 19, 24, 30, 36, 42, 48, 55,...
...
Illustration of initial terms:
.                                              o
.                                 o           o o
.                      o         o o         o   o
.             o       o o       o   o       o     o
.      o     o o     o   o     o     o     o       o
. o   o o   o o o   o o o o   o o o o o   o o o o o o
.
. 1    3      6        9          12           15
.
.                                           o
.                        o                 o o
.       o               o o               o   o
.      o o             o   o             o     o
.     o   o           o     o           o   o   o
.    o     o         o   o   o         o   o o   o
.   o   o   o       o   o o   o       o   o o o   o
.  o         o     o           o     o             o
. o o o o o o o   o o o o o o o o   o o o o o o o o o
.
.       19               24                 30
		

Crossrefs

Formula

G.f.: x/(1-3*x+3*x^2-3*x^4+3*x^5-x^6) = x/((1-x)^3*(1+x)*(1-x+x^2)).

A215097 a(n) = n^3 - a(n-2) for n >= 2 and a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 8, 26, 56, 99, 160, 244, 352, 485, 648, 846, 1080, 1351, 1664, 2024, 2432, 2889, 3400, 3970, 4600, 5291, 6048, 6876, 7776, 8749, 9800, 10934, 12152, 13455, 14848, 16336, 17920, 19601, 21384, 23274, 25272, 27379, 29600, 31940, 34400, 36981, 39688, 42526
Offset: 0

Views

Author

Alex Ratushnyak, Aug 03 2012

Keywords

Crossrefs

Cf. A000217 (n^2 - a(n-1)).
Cf. A125577 (n^2 - a(n-1) with a(0)=1).
Cf. A011934 (n^3 - a(n-1)).
Cf. A153026 (n^3 - a(n-1) with a(1)=0).
Cf. A194274 (n^2 - a(n-2)).
Cf. A187093 (n^2 - a(n-2) with a(0)=a(1)=1, a(-1)=0).
Cf. A107386 ((n-2)^2 - a(n-1) with a(0)=0, a(1)=a(2)=1, a(3)=2).
Cf. A206481 ((n-1)^3 - a(n-2)).

Programs

  • Mathematica
    RecurrenceTable[{a[0] == 0, a[1] == 1, a[n] == n^3 - a[n - 2]}, a[n], {n, 0, 43}] (* Bruno Berselli, Aug 07 2012 *)
  • Python
    prpr = 0
    prev = 1
    for n in range(2,77):
        print(prpr, end=',')
        curr = n*n*n - prpr
        prpr = prev
        prev = curr

Formula

G.f.: (x+4*x^2+x^3)/((-1+x)^4*(1+x^2)). - David Scambler, Aug 06 2012
a(n) = (n*(n^2-3)-(1-(-1)^n)*i^(n+1))/2, where i=sqrt(-1). - Bruno Berselli, Aug 07 2012

A215099 a(0)=0, a(1)=1, a(n) = least k>a(n-1) such that k+a(n-2) is prime.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 8, 10, 11, 13, 18, 24, 25, 29, 34, 38, 39, 41, 44, 48, 53, 55, 56, 58, 71, 73, 78, 84, 85, 89, 94, 102, 103, 109, 120, 124, 131, 133, 138, 144, 145, 149, 162, 164, 169, 173, 178, 180, 181, 187, 192, 196, 197, 201
Offset: 0

Views

Author

Alex Ratushnyak, Aug 03 2012

Keywords

Comments

For n>0 and (n mod 4)<2, a(n) is odd.
Same definition, but k+a(n-2) is a
Fibonacci number: A006498 except first two terms,
Lucas number: A000045 except first two terms,
Pell number: A089928(n-1),
Jacobsthal number: A215095,
factorial: A215096,
square: A194274,
cube: A215097,
triangular number: A011848(n+2),
oblong number: A215098.
Example of a related sequence definition: a(0)=0, a(1)=1, a(n) = least k>a(n-1) such that k+a(n-2) is a cube.

Crossrefs

Cf. A062042: a(1) = 2, a(n) = least k>a(n-1) such that k+a(n-1) is a prime.

Programs

  • PARI
    first(n) = my(res = vector(n, i, i-1), k); for(x=3, n, k=res[x-1]+1; while(!isprime(k+res[x-2]), k++); res[x]=k); res \\ Iain Fox, Apr 22 2019 (corrected by Iain Fox, Apr 25 2019)
  • Python
    from sympy import prime
    prpr = 0
    prev = 1
    for n in range(77):
        print(prpr, end=', ')
        b = c = 0
        while c<=prev:
            c = prime(b+1) - prpr
            b+=1
        prpr = prev
        prev = c
    

A215095 a(0)=0, a(1)=1, a(n) = least k>a(n-1) such that k+a(n-2) is a Jacobsthal number.

Original entry on oeis.org

0, 1, 3, 4, 8, 17, 35, 68, 136, 273, 547, 1092, 2184, 4369, 8739, 17476, 34952, 69905, 139811, 279620, 559240, 1118481, 2236963, 4473924, 8947848, 17895697, 35791395, 71582788, 143165576, 286331153, 572662307, 1145324612, 2290649224, 4581298449, 9162596899
Offset: 0

Views

Author

Alex Ratushnyak, Aug 03 2012

Keywords

Comments

Same definition, but k+a(n-2) is a
Fibonacci number: A006498 except first two terms,
Lucas number: A000045 except first two terms,
Pell number: A089928(n-1),
factorial: A215096,
square: A194274,
cube: A215097,
triangular number: A011848(n+2),
oblong number: A215098,
prime number: A215099.
Example of a related sequence definition: a(0)=0, a(1)=1, a(n) = least k>a(n-1) such that k+a(n-2) is a cube.

Crossrefs

Programs

  • Python
    prpr = 0
    prev = 1
    jac = [0]*10000
    for n in range(10000):
        jac[n] = prpr
        curr = prpr*2 + prev
        prpr = prev
        prev = curr
    prpr, prev = 0, 1
    for n in range(1, 44):
        print(prpr, end=', ')
        b = c = 0
        while c<=prev:
            c = jac[b] - prpr
            b+=1
        prpr = prev
        prev = c

Formula

Conjecture: G.f. (x+2*x^2)/(1-x-x^2-x^3-2*x^4). - David Scambler, Aug 06 2012

A363518 Concentric square numbers on the faces of an n X n X n cube.

Original entry on oeis.org

1, 8, 20, 32, 50, 80, 116, 152, 194, 248, 308, 368, 434, 512, 596, 680, 770, 872, 980, 1088, 1202, 1328, 1460, 1592, 1730, 1880, 2036, 2192, 2354, 2528, 2708, 2888, 3074, 3272, 3476, 3680, 3890, 4112, 4340, 4568, 4802, 5048, 5300, 5552, 5810, 6080, 6356, 6632, 6914, 7208, 7508, 7808
Offset: 1

Views

Author

Nicolay Avilov, Jun 07 2023

Keywords

Comments

a(n) is the number of colored cubes in the outer layer of a cube made up of n^3 unit cubes. The cubes are painted in such a way that concentric square numbers are obtained on each face of the n X n X n cube.

Examples

			a(3) = 6*8 - 12*1 - 2*8 = 20;
a(5) = 6*17 - 12*3 - 2*8 = 50.
		

Crossrefs

Cf. A194274.

Programs

  • Mathematica
    Join[{1},LinearRecurrence[{3,-4,4,-3,1},{8,20,32,50,80},51]] (* Stefano Spezia, Jun 08 2023 *)
  • Python
    def A363518(n): return 6*((3*n>>2)+(n*(n+2)+1>>1)-(3*n+1>>2))-12*n+8 if n>1 else 1 # Chai Wah Wu, Jul 15 2023

Formula

a(n) = 6*A194274 - 12*n + 8, where n>1.
From Stefano Spezia, Jun 08 2023: (Start)
G.f.: (1 + 5*x + 5*x^4 + x^5)/((1 - x)^3*(1 + x^2)).
a(n) = 3*a(n-1) - 4*a(n-2) + 4*a(n-3)- 3*a(n-4) + a(n-5) for n > 6. (End)

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

Original entry on oeis.org

0, 1, 4, 9, 16, 21, 28, 33, 40, 45, 52, 57, 64, 69, 76, 81, 88, 93, 100, 105, 112, 117, 124, 129, 136, 141, 148, 153, 160, 165, 172, 177, 184, 189, 196, 201, 208, 213, 220, 225, 232, 237, 244, 249, 256, 261, 268, 273, 280, 285, 292, 297, 304, 309, 316, 321, 328
Offset: 0

Views

Author

Stefano Spezia, Feb 25 2023

Keywords

Comments

The sequence gives the number of "ON" cells in the cellular automaton on a quadrant of a square grid after the n-th stage, where the "ON" cells lie only on the perimeter and the two diagonals of the square.

Examples

			Illustrations for n = 1..8:
      o          o o          o o o
                 o o          o o o
                              o o o
  a(1) = 1    a(2) = 4      a(3) = 9
   o o o o    o o o o o    o o o o o o
   o o o o    o o   o o    o o     o o
   o o o o    o   o   o    o   o o   o
   o o o o    o o   o o    o   o o   o
              o o o o o    o o     o o
                           o o o o o o
  a(4) = 16   a(5) = 21     a(6) = 28
   o o o o o o o       o o o o o o o o
   o o       o o       o o         o o
   o   o   o   o       o   o     o   o
   o     o     o       o     o o     o
   o   o   o   o       o     o o     o
   o o       o o       o   o     o   o
   o o o o o o o       o o         o o
                       o o o o o o o o
     a(7) = 33            a(8) = 40
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,1,-1},{0,1,4,9,16},57]

Formula

a(n) = a(n-1) + a(n-2) - a(n-3) for n > 4.
a(0) = 0, a(1) = 1, a(n) = 6*n - 8 for n even, and a(n) = 6*n - 9 for n odd.
E.g.f.: 4*(x + 2) + (6*x - 8)*cosh(x) + (6*x - 9)*sinh(x).
a(2*n) = A017569(n-1) = 4*A016777(n-1).
a(2*n+1) = A017629(n-1).
Showing 1-10 of 10 results.