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.

A005044 Alcuin's sequence: expansion of x^3/((1-x^2)*(1-x^3)*(1-x^4)).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 1, 2, 1, 3, 2, 4, 3, 5, 4, 7, 5, 8, 7, 10, 8, 12, 10, 14, 12, 16, 14, 19, 16, 21, 19, 24, 21, 27, 24, 30, 27, 33, 30, 37, 33, 40, 37, 44, 40, 48, 44, 52, 48, 56, 52, 61, 56, 65, 61, 70, 65, 75, 70, 80, 75, 85, 80, 91, 85, 96, 91, 102, 96, 108, 102, 114, 108, 120
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of triangles with integer sides and perimeter n.
Also a(n) is the number of triangles with distinct integer sides and perimeter n+6, i.e., number of triples (a, b, c) such that 1 < a < b < c < a+b, a+b+c = n+6. - Roger Cuculière
With a different offset (i.e., without the three leading zeros, as in A266755), the number of ways in which n empty casks, n casks half-full of wine and n full casks can be distributed to 3 persons in such a way that each one gets the same number of casks and the same amount of wine [Alcuin]. E.g., for n=2 one can give 2 people one full and one empty and the 3rd gets two half-full. (Comment corrected by Franklin T. Adams-Watters, Oct 23 2006)
For m >= 2, the sequence {a(n) mod m} is periodic with period 12*m. - Martin J. Erickson (erickson(AT)truman.edu), Jun 06 2008
Number of partitions of n into parts 2, 3, and 4, with at least one part 3. - Joerg Arndt, Feb 03 2013
For several values of p and q the sequence (A005044(n+p) - A005044(n-q)) leads to known sequences, see the crossrefs. - Johannes W. Meijer, Oct 12 2013
For n>=3, number of partitions of n-3 into parts 2, 3, and 4. - David Neil McGrath, Aug 30 2014
Also, a(n) is the number of partitions mu of n of length 3 such that mu_1-mu_2 is even and mu_2-mu_3 is even (see below example). - John M. Campbell, Jan 29 2016
For n > 1, number of triangles with odd side lengths and perimeter 2*n-3. - Wesley Ivan Hurt, May 13 2019
Number of partitions of n+1 into 4 parts whose largest two parts are equal. - Wesley Ivan Hurt, Jan 06 2021
For n>=3, number of weak partitions of n-3 (that is, allowing parts of size 0) into three parts with no part exceeding (n-3)/2. Also, number of weak partitions of n-3 into three parts, all of the same parity as n-3. - Kevin Long, Feb 20 2021
Also, a(n) is the number of incongruent acute triangles formed from the vertices of a regular n-gon. - Frank M Jackson, Nov 04 2022

Examples

			There are 4 triangles of perimeter 11, with sides 1,5,5; 2,4,5; 3,3,5; 3,4,4. So a(11) = 4.
G.f. = x^3 + x^5 + x^6 + 2*x^7 + x^8 + 3*x^9 + 2*x^10 + 4*x^11 + 3*x^12 + ...
From _John M. Campbell_, Jan 29 2016: (Start)
Letting n = 15, there are a(n)=7 partitions mu |- 15 of length 3 such that mu_1-mu_2 is even and mu_2-mu_3 is even:
(13,1,1) |- 15
(11,3,1) |- 15
(9,5,1) |- 15
(9,3,3) |- 15
(7,7,1) |- 15
(7,5,3) |- 15
(5,5,5) |- 15
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 74, Problem 7.
  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. Wiley, NY, Chap.10, Section 10.2, Problems 5 and 6, pp. 451-2.
  • D. Olivastro: Ancient Puzzles. Classic Brainteasers and Other Timeless Mathematical Games of the Last 10 Centuries. New York: Bantam Books, 1993. See p. 158.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. M. Yaglom and I. M. Yaglom: Challenging Mathematical Problems with Elementary Solutions. Vol. I. Combinatorial Analysis and Probability Theory. New York: Dover Publications, Inc., 1987, p. 8, #30 (First published: San Francisco: Holden-Day, Inc., 1964)

Crossrefs

See A266755 for a version without the three leading zeros.
Both bisections give (essentially) A001399.
(See the comments.) Cf. A008615 (p=1, q=3, offset=0), A008624 (3, 3, 0), A008679 (3, -1, 0), A026922 (1, 5, 1), A028242 (5, 7, 0), A030451 (6, 6, 0), A051274 (3, 5, 0), A052938 (8, 4, 0), A059169 (0, 6, 1), A106466 (5, 4, 0), A130722 (2, 7, 0)
Cf. this sequence (k=3), A288165 (k=4), A288166 (k=5).
Number of k-gons that can be formed with perimeter n: this sequence (k=3), A062890 (k=4), A069906 (k=5), A069907 (k=6), A288253 (k=7), A288254 (k=8), A288255 (k=9), A288256 (k=10).

Programs

  • Haskell
    a005044 = p [2,3,4] . (subtract 3) where
    p _ 0 = 1
    p [] _ = 0
    p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Feb 28 2013
  • Maple
    A005044 := n-> floor((1/48)*(n^2+3*n+21+(-1)^(n-1)*3*n)): seq(A005044(n), n=0..73);
    A005044 := -1/(z**2+1)/(z**2+z+1)/(z+1)**2/(z-1)**3; # Simon Plouffe in his 1992 dissertation
  • Mathematica
    a[n_] := Round[If[EvenQ[n], n^2, (n + 3)^2]/48] (* Peter Bertok, Jan 09 2002 *)
    CoefficientList[Series[x^3/((1 - x^2)*(1 - x^3)*(1 - x^4)), {x, 0, 105}], x] (* Robert G. Wilson v, Jun 02 2004 *)
    me[n_] := Module[{i, j, sum = 0}, For[i = Ceiling[(n - 3)/3], i <= Floor[(n - 3)/2], i = i + 1, For[j = Ceiling[(n - i - 3)/2], j <= i, j = j + 1, sum = sum + 1] ]; Return[sum]; ] mine = Table[me[n], {n, 1, 11}]; (* Srikanth (sriperso(AT)gmail.com), Aug 02 2008 *)
    LinearRecurrence[{0,1,1,1,-1,-1,-1,0,1},{0,0,0,1,0,1,1,2,1},80] (* Harvey P. Dale, Sep 22 2014 *)
    Table[Length@Select[IntegerPartitions[n, {3}], Max[#]*180 < 90 n &], {n, 1, 100}] (* Frank M Jackson, Nov 04 2022 *)
  • PARI
    a(n) = round(n^2 / 12) - (n\2)^2 \ 4
    
  • PARI
    a(n) = (n^2 + 6*n * (n%2) + 24) \ 48
    
  • PARI
    a(n)=if(n%2,n+3,n)^2\/48 \\ Charles R Greathouse IV, May 02 2016
    
  • PARI
    concat(vector(3), Vec((x^3)/((1-x^2)*(1-x^3)*(1-x^4)) + O(x^70))) \\ Felix Fröhlich, Jun 07 2017
    

Formula

a(n) = a(n-6) + A059169(n) = A070093(n) + A070101(n) + A024155(n).
For odd indices we have a(2*n-3) = a(2*n). For even indices, a(2*n) = nearest integer to n^2/12 = A001399(n).
For all n, a(n) = round(n^2/12) - floor(n/4)*floor((n+2)/4) = a(-3-n) = A069905(n) - A002265(n)*A002265(n+2).
For n = 0..11 (mod 12), a(n) is respectively n^2/48, (n^2 + 6*n - 7)/48, (n^2 - 4)/48, (n^2 + 6*n + 21)/48, (n^2 - 16)/48, (n^2 + 6*n - 7)/48, (n^2 + 12)/48, (n^2 + 6*n + 5)/48, (n^2 - 16)/48, (n^2 + 6*n + 9)/48, (n^2 - 4)/48, (n^2 + 6*n + 5)/48.
Euler transform of length 4 sequence [ 0, 1, 1, 1]. - Michael Somos, Sep 04 2006
a(-3 - n) = a(n). - Michael Somos, Sep 04 2006
a(n) = sum(ceiling((n-3)/3) <= i <= floor((n-3)/2), sum(ceiling((n-i-3)/2) <= j <= i, 1 ) ) for n >= 1. - Srikanth K S, Aug 02 2008
a(n) = a(n-2) + a(n-3) + a(n-4) - a(n-5) - a(n-6) - a(n-7) + a(n-9) for n >= 9. - David Neil McGrath, Aug 30 2014
a(n+3) = a(n) if n is odd; a(n+3) = a(n) + floor(n/4) + 1 if n is even. Sketch of proof: There is an obvious injective map from perimeter-n triangles to perimeter-(n+3) triangles defined by f(a,b,c) = (a+1,b+1,c+1). It is easy to show f is surjective for odd n, while for n=2k the image of f is only missing the triangles (a,k+2-a,k+1) for 1 <= a <= floor(k/2)+1. - James East, May 01 2016
a(n) = round(n^2/48) if n is even; a(n) = round((n+3)^2/48) if n is odd. - James East, May 01 2016
a(n) = (6*n^2 + 18*n - 9*(-1)^n*(2*n + 3) - 36*sin(Pi*n/2) - 36*cos(Pi*n/2) + 64*cos(2*Pi*n/3) - 1)/288. - Ilya Gutkovskiy, May 01 2016
a(n) = A325691(n-3) + A000035(n) for n>=3. The bijection between partition(n,[2,3,4]) and not-over-half partition(n,3,n/2) + partition(n,2,n/2) can be built by a Ferrers(part)[0+3,1,2] map. And the last partition(n,2,n/2) is unique [n/2,n/2] if n is even, it is given by A000035. - Yuchun Ji, Sep 24 2020
a(4n+3) = a(4n) + n+1, a(4n+4) = a(4n+1) = A000212(n+1), a(4n+5) = a(4n+2) + n+1, a(4n+6) = a(4n+3) = A007980(n). - Yuchun Ji, Oct 10 2020
a(n)-a(n-4) = A008615(n-1). - R. J. Mathar, Jun 23 2021
a(n)-a(n-2) = A008679(n-3). - R. J. Mathar, Jun 23 2021

Extensions

Additional comments from Reinhard Zumkeller, May 11 2002
Yaglom reference and mod formulas from Antreas P. Hatzipolakis (xpolakis(AT)otenet.gr), May 27 2000
The reference to Alcuin of York (735-804) was provided by Hermann Kremer (hermann.kremer(AT)onlinehome.de), Jun 18 2004

A106465 Triangle read by rows, T(n, k) = 1 if n mod 2 = 1, otherwise (k + 1) mod 2.

Original entry on oeis.org

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

Views

Author

Paul Barry, May 03 2005

Keywords

Comments

Rows alternate between all 1's and alternating 1's and 0's. A 'mixed' sequence array: rows alternate between the rows of the sequence array for the all 1's sequence and the sequence array for the sequence 1,0,1,0,...
Column 2*k has g.f. x^(2*k)/(1-x); column 2*k+1 has g.f. x^(2*k+1)/(1-x^2).
Row sums are A029578(n+2). Antidiagonal sums are A106466.
This triangle is the Kronecker product of an infinite lower triangular matrix filled with 1's with a 2 X 2 lower triangular matrix of 1's. - Christopher Cormier, Sep 24 2017
From Peter Bala, Aug 21 2021: (Start)
Using the notation of Davenport et al.:
This is the double Riordan array ( 1/(1 - x); x/(1 + x), x*(1 + x) ).
The inverse array equals ( (1 - x)*(1 - x^2); x*(1 - x), x*(1 + x) ).
They are examples of double Riordan arrays of the form (g(x); x*f_1(x), x*f_2(x)), where f_1(x)*f_2(x) = 1. Arrays of this type form a group under matrix multiplication. For the group law see the Bala link. (End)

Examples

			The triangle begins:
  n\k| 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 ...
  ---+------------------------------------------------
   0 | 1
   1 | 1  1
   2 | 1  0  1
   3 | 1  1  1  1
   4 | 1  0  1  0  1
   5 | 1  1  1  1  1  1
   6 | 1  0  1  0  1  0  1
   7 | 1  1  1  1  1  1  1  1
   8 | 1  0  1  0  1  0  1  0  1
   9 | 1  1  1  1  1  1  1  1  1  1
  10 | 1  0  1  0  1  0  1  0  1  0  1
  11 | 1  1  1  1  1  1  1  1  1  1  1  1
  12 | 1  0  1  0  1  0  1  0  1  0  1  0  1
  13 | 1  1  1  1  1  1  1  1  1  1  1  1  1  1
  14 | 1  0  1  0  1  0  1  0  1  0  1  0  1  0  1
... Reformatted by _Wolfdieter Lang_, May 12 2018
Inverse array begins
  n\k|  0   1   2   3   4   5   6   7
  ---+-------------------------------
   0 |  1
   1 | -1   1
   2 | -1   0   1
   3 |  1  -1  -1   1
   4 |  0   0  -1   0   1
   5 |  0   0   1  -1  -1   1
   6 |  0   0   0   0  -1   0   1
   7 |  0   0   0   0   1  -1  -1  1
  ... - _Peter Bala_, Aug 21 2021
		

Crossrefs

Programs

  • Maple
    T := (n, k) -> if igcd(n - k + 1, k + 1) mod 2 = 0 then 0 else 1 fi:
    for n from 0 to 9 do seq(T(n, k), k = 0..n) od;
    # Alternative:
    T := (n, k) -> if n mod 2 = 1 then 1 else (k + 1) mod 2 fi:
    for n from 0 to 9 do seq(T(n, k), k = 0..n) od; # Peter Luschny, Dec 12 2022
  • Mathematica
    Table[Binomial[Mod[n, 2], Mod[k, 2]], {n, 0, 16}, {k, 0, n}] // Flatten (* Michael De Vlieger, Dec 12 2022 *)
  • Python
    def A106465row(n: int) -> list[int]:
      if n % 2 == 1:
          return [1] * (n + 1)
      return [1, 0] * (n // 2) + [1]
    for n in range(9): print(A106465row(n)) # Peter Luschny, Dec 12 2022

Formula

If gcd(n - k + 1, k + 1) mod 2 = 0 then T(n, k) = 0, otherwise T(n, k) = 1.
T(n, k) = A003989(n + 1, k + 1) mod 2.
T(n, k) = binomial(n mod 2, k mod 2). - Peter Luschny, Dec 12 2022

Extensions

Edited and new name by Peter Luschny, Dec 12 2022

A307707 Lexicographically earliest sequence of nonnegative integers in which, for all k >= 0, there are exactly k pairs of consecutive terms whose sum is k.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Apr 23 2019

Keywords

Comments

The old definition was "Lexicographically earliest sequence starting with a(1) = 0 such that a(n) is the number of pairs of contiguous terms whose sum is a(n)".
From Paul Curtz, Apr 27 2019: This can be written as a triangle:
0
1 1
1 2 1
2 2 2 2
2 3 2 3 2
3 3 3 3 3 3
3 4 3 4 3 4 3
...

Crossrefs

Cf. A002024.
Cf. also A007590, A057353, A106466 and A238410.
For other versions see A307720 and A378117.

Programs

  • Mathematica
    m = 107; a[1]=0;
    a24[n_] := Ceiling[(Sqrt[8n+1]-1)/2];
    Array[a, m] /. Solve[Table[a[n] + a[n+1] == a24[n], {n, 1, m-1}]][[1]] (* Jean-François Alcover, Jun 02 2019, after Rémy Sigrist's formula *)
  • PARI
    v=0; rem=wanted=1; for (n=1, 107, print1 (v", "); v=wanted-v; if (rem--==0, rem=wanted++)) \\ Rémy Sigrist, Apr 23 2019

Formula

a(n) + a(n+1) = A002024(n). - Rémy Sigrist, Apr 24 2019
Let t_m = m*(m+1)/2. Write n = t_m - i with m >= 1 and 0 <= i < m. Then a(n) = m/2 if m is even, or if m is odd, a(n) = (m-1)/2 + (i-1 mod 2). - N. J. A. Sloane, Nov 16 2024

Extensions

Definition clarified by Rémy Sigrist and N. J. A. Sloane, Nov 17 2024

A360501 Number of edges added at n-th generation of hexagonal graph constructed in first quadrant (see Comments for precise definition).

Original entry on oeis.org

0, 1, 1, 2, 4, 5, 6, 7, 8, 10, 10, 12, 12, 15, 14, 17, 16, 20, 18, 22, 20, 25, 22, 27, 24, 30, 26, 32, 28, 35, 30, 37, 32, 40, 34, 42, 36, 45, 38, 47, 40, 50, 42, 52, 44, 55, 46, 57, 48, 60, 50, 62, 52, 65, 54, 67, 56, 70, 58, 72, 60, 75, 62, 77, 64, 80, 66, 82, 68, 85, 70, 87, 72, 90
Offset: 0

Views

Author

N. J. A. Sloane, Feb 09 2023

Keywords

Comments

We build up a planar graph with hexagonal cells, based on the square grid. There are six kinds of edges.
A U edge is drawn from (x,y) to (x,y+1);
a U^{-1} edge is drawn from (x,y) to (x,y-1);
an L edge is drawn from (x,y) to (x-1,y+1);
an L^{-1} edge is drawn from (x,y) to (x+1,y-1);
an R edge is drawn from (x,y) to (x+1,y+1); and
an R^{-1} edge is drawn from (x,y) to (x-1,y-1).
The construction starts in generation 0 with a single node at the origin (see illustration). At generation 1 we draw a U line from the origin to (0,1).
The graph is then extended using the following rules.
Every U is followed by a pair of lines, L and R;
every L is followed by a U;
every L^{-1} is followed by a pair U^{-1} and R; and
every R is followed by a pair U and L^{-1}.
Lines that fall outside the first quadrant are ignored, and lines that would coincide with existing lines are ignored.
Lines of type U^{-1} and R^{-1} do not need to be followed by anything.
The node numbers in the illustration indicate at which generation the node is reached. This is also the graph distance from the origin.
The number of nodes that are added at the n-th generation, for n >= 0, is given by 1, 1, 1, 2, 4, 4, 5, 5, 7, 7, 8, 8, 10, 10, 11, 11, 13, 13, 14, 14, 16, 16, 17, 17, 19, 19, ..., with G.f. = (-x^7+x^6+x^4+x^3+1)/((1-x)*(1-x^4)). This is essentially A265428.
The total number of nodes after the n-th generation, for n >= 0, is 1, 2, 3, 5, 9, 13, 18, 23, 30, 37, 45, 53, 63, 73, 84, 95, 108, 121, 135, 149, 165, 181, 198, ... This is essentially A265429.
The number of hexagons that are added at the n-th generation, for n >= 0, is given by 0, 0, 0, 0, 0, 1, 1, 2, 1, 3, 2, 4, 2, 5, 3, 6, 3, 7, 4, 8, 4, 9, 5, 10, 5, 11, 6, 12, 6, 13, ..., with G.f. = x^5*(1+x+x^2)/((1-x^2)*(1-x^4)). This is essentially A106466.

Crossrefs

Cf. A360512 (partial sums), A106466, A265428, A265429.
Inspired by A182838.

Formula

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

A106464 Antidiagonal sums of number triangle A003989.

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 6, 6, 5, 11, 6, 9, 15, 12, 8, 18, 9, 21, 22, 15, 11, 32, 20, 18, 27, 31, 14, 45, 15, 32, 36, 24, 41, 57, 18, 27, 43, 60, 20, 66, 21, 51, 72, 33, 23, 84, 42, 60, 57, 61, 26, 81, 67, 88, 64, 42, 29, 135, 30, 45, 105
Offset: 0

Views

Author

Paul Barry, May 03 2005

Keywords

Comments

Consider the triangle T(n, k) = A003989(n, k) = gcd(n-k+1, k), n >= 1, k = 1..n. Then a(n) = Sum_{k=0..floor(n/2)} T(n-k+1, k+1), for n >= 0. - R. J. Mathar, May 11 2018 [adjusted to the definition of A003989. - Wolfdieter Lang, May 12 2018]

Crossrefs

Programs

  • GAP
    Flat(List([0..70],n->Sum([0..Int(n/2)],k->Gcd(n-2*k+1,k+1)))); # Muniru A Asiru, May 15 2018
  • Maple
    f:= n -> add(igcd(n-2*k+1,k+1),k=0..n/2):
    map(f, [$0..100]); # Robert Israel, May 11 2018
  • Mathematica
    Array[Sum[GCD[# - 2 k + 1, k + 1], {k, 0, Floor[#/2]}] &, 61, 0] (* Michael De Vlieger, May 14 2018 *)
  • PARI
    a(n) = sum(k=0, n\2, gcd(n-2*k+1, k+1)); \\ Michel Marcus, May 11 2018
    

Formula

a(n) = Sum_{k=0..floor(n/2)} gcd(n-2*k+1, k+1). [corrected by R. J. Mathar, May 11 2018]

Extensions

Name corrected by R. J. Mathar, May 11 2018

A130722 The twice repeated nonnegative integers at even indices, the non-repeated nonnegative integers at odd indices.

Original entry on oeis.org

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

Views

Author

Paul Curtz, Aug 16 2007

Keywords

Crossrefs

Programs

  • Maple
    a := n -> A005044(n+2) - A005044(n-7): A005044 := n -> floor((1/48)*(n^2 + 3*n + 21 + (-1)^(n-1)*3*n)): seq(a(n), n=0..79); # Johannes W. Meijer, Oct 08 2013
  • Mathematica
    Table[Sum[Sign[Mod[n - 2 i, 4]], {i, Floor[n/2]}], {n, 0, 100}] (* Wesley Ivan Hurt, Apr 10 2018 *)
  • PARI
    a(n) = if(n%2, n\2, n\4); \\ Altug Alkan, Apr 16 2018

Formula

a(2*n) = A004526(n) = floor(n/2). a(2*n+1) = A001477(n) = n.
O.g.f.: (x^2+x+1)*x^3/((x-1)^2*(1+x)^2*(1+x^2)). - R. J. Mathar, Jul 07 2008
a(n) = A005044(n+2) - A005044(n-7). - Johannes W. Meijer, Oct 08 2013
a(n) = Sum_{i=1..floor(n/2)} sign((n-2i) mod 4). - Wesley Ivan Hurt, Apr 10 2018
a(n) = A106466(n-3) for n>=3. - Georg Fischer, Oct 07 2018

Extensions

Edited by R. J. Mathar, Jul 07 2008
Showing 1-6 of 6 results.