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.

A059030 Fourth main diagonal of A059026: a(n) = B(n+3,n) = lcm(n+3,n)/(n+3) + lcm(n+3,n)/n - 1 for all n >= 1.

Original entry on oeis.org

4, 6, 2, 10, 12, 4, 16, 18, 6, 22, 24, 8, 28, 30, 10, 34, 36, 12, 40, 42, 14, 46, 48, 16, 52, 54, 18, 58, 60, 20, 64, 66, 22, 70, 72, 24, 76, 78, 26, 82, 84, 28, 88, 90, 30, 94, 96, 32, 100, 102, 34, 106, 108, 36, 112, 114, 38, 118, 120, 40, 124, 126, 42, 130
Offset: 1

Views

Author

Asher Auel, Dec 15 2000

Keywords

Crossrefs

Programs

  • Maple
    B := (n,m) -> lcm(n,m)/n + lcm(n,m)/m - 1: seq(B(m+3,m),m=1..90);

Formula

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

A059031 Fifth main diagonal of A059026: a(n) = B(n+4,n) = lcm(n+4,n)/(n+4) + lcm(n+4,n)/n - 1 for all n >= 1.

Original entry on oeis.org

5, 3, 9, 2, 13, 7, 17, 4, 21, 11, 25, 6, 29, 15, 33, 8, 37, 19, 41, 10, 45, 23, 49, 12, 53, 27, 57, 14, 61, 31, 65, 16, 69, 35, 73, 18, 77, 39, 81, 20, 85, 43, 89, 22, 93, 47, 97, 24, 101, 51, 105, 26, 109, 55, 113, 28, 117, 59, 121, 30, 125, 63, 129, 32, 133, 67
Offset: 1

Views

Author

Asher Auel, Dec 15 2000

Keywords

Crossrefs

Programs

  • Maple
    B := (n,m) -> lcm(n,m)/n + lcm(n,m)/m - 1: seq(B(m+4,m),m=1..90);
  • Mathematica
    LinearRecurrence[{0,0,0,2,0,0,0,-1},{5,3,9,2,13,7,17,4},70] (* Harvey P. Dale, Aug 19 2019 *)

Formula

a(2n+1) = 4n+5, a(4n+2) = 4n+3, a(4n+4) = 4n+2. - Ralf Stephan, Jun 10 2005
G.f.: -x*(-5-3*x-9*x^2-2*x^3-3*x^4-x^5+x^6) / ( (x-1)^2*(1+x)^2*(x^2+1)^2 ). - R. J. Mathar, Sep 20 2011

A059028 Row sums of A059026: a(n) = Sum_{m=1..n} (lcm(n,m)/n + lcm(n,m)/m - 1).

Original entry on oeis.org

1, 3, 8, 13, 27, 26, 58, 57, 83, 85, 156, 104, 223, 180, 206, 241, 393, 257, 496, 327, 431, 478, 738, 428, 757, 681, 794, 682, 1191, 632, 1366, 993, 1133, 1195, 1320, 971, 1963, 1506, 1610, 1315, 2421, 1313, 2668, 1788, 1877, 2236, 3198, 1748, 3103
Offset: 1

Views

Author

Asher Auel, Dec 15 2000

Keywords

Crossrefs

Cf. A059026.

Programs

  • Mathematica
    Table[Sum[LCM[n,m]/n+LCM[n,m]/m-1,{m,n}],{n,50}] (* Harvey P. Dale, Dec 11 2016 *)

A022998 If n is odd then n, otherwise 2n.

Original entry on oeis.org

0, 1, 4, 3, 8, 5, 12, 7, 16, 9, 20, 11, 24, 13, 28, 15, 32, 17, 36, 19, 40, 21, 44, 23, 48, 25, 52, 27, 56, 29, 60, 31, 64, 33, 68, 35, 72, 37, 76, 39, 80, 41, 84, 43, 88, 45, 92, 47, 96, 49, 100, 51, 104, 53, 108, 55, 112, 57, 116, 59, 120, 61, 124, 63, 128, 65, 132, 67
Offset: 0

Views

Author

Keywords

Comments

Also for n > 0: numerator of Sum_{i=1..n} 2/(i*(i+1)), denominator=A026741. - Reinhard Zumkeller, Jul 25 2002
For n > 2: a(n) = gcd(A143051((n-1)^2), A143051(1+(n-1)^2)) = A050873(A000290(n-1), A002522(n-1)). - Reinhard Zumkeller, Jul 20 2008
Partial sums give the generalized octagonal numbers A001082. - Omar E. Pol, Sep 10 2011
Multiples of 4 and odd numbers interleaved. - Omar E. Pol, Sep 25 2011
The Pisano period lengths modulo m appear to be A066043(m). - R. J. Mathar, Oct 08 2011
The partial sums a(n)/A026741(n+1) given by R. Zumkeller in a comment above are 2*n/(n+1) (telescopic sum), and thus converge to 2. - Wolfdieter Lang, Apr 09 2013
a(n) = numerator(H(n,1)), where H(n,1) = 2*n/(n+1) is the harmonic mean of 1 and n. a(n) = 2*n/gcd(2n, n+1) = 2*n/gcd(n+1,2). a(n) = A227041(n,1), n>=1. - Wolfdieter Lang, Jul 04 2013
a(n) = numerator of the mean (2n/(n+1), after reduction), of the compositions of n; denominator is given by A001792(n-1). - Clark Kimberling, Mar 11 2014
A strong divisibility sequence, that is, gcd(a(n), a(m)) = a(gcd(n,m)) for all natural numbers n and m. The sequence of convergents of the 2-periodic continued fraction [0; 1, -4, 1, -4, ...] = 1/(1 - 1/(4 - 1/(1 - 1/(4 - ...)))) begins [0/1, 1/1, 4/3, 3/2, 8/5, 5/3, 12/7, ...]. The present sequence is the sequence of numerators. The sequence of denominators of the continued fraction convergents [1, 1, 3, 2, 5, 3, 7, ...] is A026741, also a strong divisibility sequence. Cf. A203976. - Peter Bala, May 19 2014
a(n) is also the length of the n-th line segment of a rectangular spiral on the infinite square grid. The vertices of the spiral are the generalized octagonal numbers. - Omar E. Pol, Jul 27 2018
a(n) is the number of petals of the Rhodonea curve r = a*cos(n*theta) or r = a*sin(n*theta). - Matt Westwood, Nov 19 2019

Crossrefs

Column 4 of A195151. - Omar E. Pol, Sep 25 2011
Cf. A000034, A001082 (partial sums).
Cf. A227041 (first column). - Wolfdieter Lang, Jul 04 2013
Row 2 of A349593. A385555, A385556, A385557, A385558, A385559, and A385560 are respectively rows 3, 4, 5-6, 7, 8, and 9-10.

Programs

  • Haskell
    a022998 n = a000034 (n + 1) * n
    a022998_list = zipWith (*) [0..] $ tail a000034_list
    -- Reinhard Zumkeller, Mar 31 2012
    
  • Magma
    [((-1)^n+3)*n/2: n in [0..70]]; // Vincenzo Librandi, Sep 17 2011
    
  • Maple
    A022998 := proc(n) if type(n,'odd') then n ; else 2*n; end if; end proc: # R. J. Mathar, Mar 10 2011
  • Mathematica
    Table[n (3 + (-1)^n)/2, {n, 0, 100}] (* Wesley Ivan Hurt, Dec 13 2013 *)
    Table[If[OddQ[n],n,2n],{n,0,150}] (* or *) Riffle[ 2*Range[ 0,150,2], Range[ 1,150,2]] (* Harvey P. Dale, Feb 06 2017 *)
  • PARI
    a(n)=if(n%2,n,2*n)
    
  • Python
    def A022998(n): return n if n&1 else n<<1 # Chai Wah Wu, Mar 05 2024
  • SageMath
    [n*(1+((n+1)%2)) for n in (0..80)] # G. C. Greubel, Jul 31 2022
    

Formula

Denominator of (n+1)*(n-1)*(2*n+1)/(2*n) (for n > 0).
a(n+1) = lcm(n, n+2)/n + lcm(n, n+2)/(n+2) for all n >= 1. - Asher Auel, Dec 15 2000
Multiplicative with a(2^e) = 2^(e+1), a(p^e) = p^e, p > 2.
G.f. x*(1 + 4*x + x^2)/(1-x^2)^2. - Ralf Stephan, Jun 10 2003
a(n) = 3*n/2 + n*(-1)^n/2 = n*(3 + (-1)^n)/2. - Paul Barry, Sep 04 2003
a(n) = A059029(n-1) + 1 = A043547(n+2) - 2.
a(n)*a(n+3) = -4 + a(n+1)*a(n+2).
a(n) = n*(((n+1) mod 2) + 1) = n^2 + 2*n - 2*n*floor((n+1)/2). - William A. Tedeschi, Feb 29 2008
a(n) = denominator((n+1)/(2*n)) for n >= 1; A026741(n+1) = numerator((n+1)/(2*n)) for n >= 1. - Johannes W. Meijer, Jun 18 2009
a(n) = 2*a(n-2) - a(n-4).
Dirichlet g.f. zeta(s-1)*(1+2^(1-s)). - R. J. Mathar, Mar 10 2011
a(n) = n * (2 - n mod 2) = n * A000034(n+1). - Reinhard Zumkeller, Mar 31 2012
a(n) = floor(2*n/(1 + (n mod 2))). - Wesley Ivan Hurt, Dec 13 2013
From Ilya Gutkovskiy, Mar 16 2017: (Start)
E.g.f.: x*(2*sinh(x) + cosh(x)).
It appears that a(n) is the period of the sequence k*(k + 1)/2 mod n. (End) [This is correct; see A349593. - Jianing Song, Jul 03 2025]
a(n) = Sum_{d | n} A345082(d). - Peter Bala, Jan 13 2024

Extensions

More terms from Michael Somos, Aug 07 2000

A059029 a(n) = n if n is even, 2*n + 1 if n is odd.

Original entry on oeis.org

0, 3, 2, 7, 4, 11, 6, 15, 8, 19, 10, 23, 12, 27, 14, 31, 16, 35, 18, 39, 20, 43, 22, 47, 24, 51, 26, 55, 28, 59, 30, 63, 32, 67, 34, 71, 36, 75, 38, 79, 40, 83, 42, 87, 44, 91, 46, 95, 48, 99, 50, 103, 52, 107, 54, 111, 56, 115, 58, 119, 60, 123, 62, 127, 64, 131, 66, 135
Offset: 0

Views

Author

Asher Auel, Dec 15 2000

Keywords

Comments

a(n-1) = n^k - 1 mod 2*n, n >= 1, for any k >= 2, also for k = n. - Wolfdieter Lang, Dec 21 2011

Crossrefs

a(n) = A022998(n+1) - 1 = A043547(n+3) - 3. Partial sums in A032438.

Programs

  • Magma
    [n+((n+1)/2)*(1-(-1)^n): n in [0..70]]; // Vincenzo Librandi, Aug 14 2011
  • Maple
    B := (n,m) -> lcm(n,m)/n + lcm(n,m)/m - 1: seq(B(m+2,m),m=1..90);
  • Mathematica
    Table[n +(n+1)*(1-(-1)^n)/2, {n,0,70}] (* G. C. Greubel, Nov 08 2018 *)
    Table[If[EvenQ[n],n,2n+1],{n,0,70}] (* or *) LinearRecurrence[{0,2,0,-1},{0,3,2,7},70] (* Harvey P. Dale, Jul 23 2025 *)
  • PARI
    a(n)=if(n%2,2*n+1,n)
    

Formula

G.f.: x*(x^2 + 2*x + 3)/(1 - x^2)^2. - Ralf Stephan, Jun 10 2003
Third main diagonal of A059026: a(n) = B(n+2, n) = lcm(n+2, n)/(n+2) + lcm(n+2, n)/n - 1 for all n >= 1.
a(2*n) + a(2*n+1) = A016945(n). - Paul Curtz, Aug 29 2008
E.g.f.: 2*x*cosh(x) + (1 + x)*sinh(x). - Franck Maminirina Ramaharo, Nov 08 2018

Extensions

New description from Ralf Stephan, Jun 10 2003

A289236 Square array a(p,q) read by antidiagonals: a(p,q) = the number of line segments that constitute the trajectory of a billiard ball on a pool table with dimensions p X q, before the ball reaches a corner.

Original entry on oeis.org

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

Views

Author

Luc Rousseau, Jun 28 2017

Keywords

Comments

The billiard game considered here is an idealized one: the pool table is a rectangle with vertices (0,0), (p,0), (p,q), (0, q); the ball is shrunk to a point and is launched from vertex (0,0) with initial velocity vector (1,1); collisions are supposed elastic and friction is supposed nonexistent, so that the ball can never stop on the table; when the ball bounces, the angle of reflection is equal to the angle of incidence; the ball can only exit through a vertex.
a(p,q) counts the line segments that constitute the trajectory.

Examples

			In a square-shaped pool table, the ball just crosses diagonally. a(p,p)=1.
In a pool table of dimensions 2 X 1, the ball bounces once and exits. a(2,1)=2.
The square array a(p,q) begins:
   1  2  3  4  5  6  7
   2  1  4  2  6  3  8
   3  4  1  6  7  2  9
   4  2  6  1  8  4 10
   5  6  7  8  1 10 11
   6  3  2  4 10  1 12
   7  8  9 10 11 12  1
		

Crossrefs

Cf. A059026 (the triangle version).

Programs

  • Java
    long a(long p, long q) {
    long i = 0, x = 0, y = 0, dx = +1, dy = +1, s = 1;
    while ((((x % p) != 0) || ((y % q) != 0)) || (i == 0)) {
    i ++; long xx = x + dx; long yy = y + dy;
    boolean xok = (0 <= xx) && (xx <= p);
    boolean yok = (0 <= yy) && (yy <= q);
    if (xok && yok) { x = xx; y = yy; }
    else { s ++;
    if (! xok) { dx = -dx; }
    if (! yok) { dy = -dy; }
    }} return s; }

Formula

a(p,q) = (p + q) / gcd(p, q) - 1.
Showing 1-6 of 6 results.