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

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

A221918 Triangle of denominators of sum of two unit fractions: 1/n + 1/m, n >= m >= 1.

Original entry on oeis.org

1, 2, 1, 3, 6, 3, 4, 4, 12, 2, 5, 10, 15, 20, 5, 6, 3, 2, 12, 30, 3, 7, 14, 21, 28, 35, 42, 7, 8, 8, 24, 8, 40, 24, 56, 4, 9, 18, 9, 36, 45, 18, 63, 72, 9, 10, 5, 30, 20, 10, 15, 70, 40, 90, 5, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 11, 12, 12, 12, 3, 60, 4, 84, 24, 36, 60, 132, 6
Offset: 1

Views

Author

Wolfdieter Lang, Feb 21 2013

Keywords

Comments

The corresponding triangle of numerators is A221919.
The law for the electrical resistance in a parallel circuit with two resistors R1 and R2 is 1/R = 1/R1 + 1/R2. Here we take 1/R(n,m) = 1/n + 1/m, with n >= m> =1, and R(n,m) = a(n,m)/A221919(n,m).
The reduced mass mu in a two body problem with masses m1 and m2 is given by 1/mu = 1/m1 + 1/m2.
The radius R of the twin circles of Archimedes' arbelos with the radii of the two small half-circles r1 and r2 is given by 1/R = 1/r1 +1/r2. The large half-circle has radius r = r1 + r2. See, e.g., the Bankoff reference (according to which one should speak of a triple of such radius R circles). There are much more such radius R circles. See the Arbelos references given by Schoch, especially reference [3].
The columns give A000027, A145979(n-2), A221920, A221921, A222463 for m = 1, 2, ..., 5.
This and the companion entry resulted from a remark on the twin circles in Archimedes' arbelos in the Strick reference, p. 13, and the obvious question about their radii and centers. See the MathWorld link, also for more references.
The rationals R(n,m) = a(n,m)/A221919(n,m) (in lowest terms) equal H(n,m)/2, where H(n,m) = A227041(n,m)/A227042(n,m) is the harmonic mean of m and n. - Wolfdieter Lang, Jul 02 2013

Examples

			The triangle a(n,m) begins:
n\m    1    2    3    4    5    6   7   8   9   10   11  12 ...
1:     1
2:     2    1
3:     3    6    3
4:     4    4   12    2
5:     5   10   15   20    5
6:     6    3    2   12   30    3
7:     7   14   21   28   35   42   7
8:     8    8   24    8   40   24  56   4
9:     9   18    9   36   45   18  63  72   9
10:   10    5   30   20   10   15  70  40  90    5
11:   11   22   33   44   55   66  77  88  99  110   11
12:   12   12   12    3   60    4  84  24  36   60  132   6
...
a(n,1) = n because 1/R(n,1) =  1/n +1/1 = (n+1)/n, hence a(n,1) = denominator(1/n +1/1/) = n =  numerator(R(n,1)).
a(5,3) = denominator(1/5 + 1/3) = denominator(8/15 ) = 15.
a(6,3) = denominator(1/6 + 1/3) = denominator(9/18 ) = denominator(1/2) = 2.
The triangle of rationals R(n,m) = n*m/(n+m) = a(n,m)/A221919(n,m) given by 1/R(n,m) = 1/n + 1/m starts:
n\m    1    2      3     4      5     6     7     8     9   10
1:    1/2
2:    2/3    1
3:    3/4   6/5   3/2
4:    4/5   4/3  12/7    2
5:    5/6  10/7  15/8   20/9   5/2
6:    6/7   3/2    2    12/5  30/11   3
7:    7/8  14/9  21/10  28/11 35/12 42/13  7/2
8:    8/9   8/5  24/11   8/3  40/13 24/7  56/15   4
9:   9/10  18/11  9/4   36/13 45/14 18/5  63/16 72/17  9/2
10:  10/11  5/3  30/13  20/7  10/3  15/4  70/17 40/9  90/19  5
...
		

References

  • L. Bankoff, Are the Twin Circles of Archimedes Really Twins?, Mathematics Mag. 47,4 (1974) 214-218.
  • H. K. Strick, Geschichten aus der Mathematik, Spektrum der Wissenschaft - Spezial 2/2009.

Crossrefs

Cf. A221919 (companion).

Programs

  • Mathematica
    a[n_, m_] := Denominator[1/n + 1/m]; Table[a[n, m], {n, 1, 12}, {m, 1, n}] // Flatten  (* Jean-François Alcover, Feb 25 2013 *)

Formula

a(n,m) = denominator(1/n +1/m) = numerator(n*m/(n+m)), n >= m >= 1 and 0 otherwise.
a(n,m)/A221919(n,m) = R(n,m) = n*m/(n+m). 1/R(n,m) = 1/n + 1/m.

A227042 Triangle of denominators of harmonic mean of n and m, 1 <= m <= n.

Original entry on oeis.org

1, 3, 1, 2, 5, 1, 5, 3, 7, 1, 3, 7, 4, 9, 1, 7, 1, 1, 5, 11, 1, 4, 9, 5, 11, 6, 13, 1, 9, 5, 11, 3, 13, 7, 15, 1, 5, 11, 2, 13, 7, 5, 8, 17, 1, 11, 3, 13, 7, 3, 2, 17, 9, 19, 1, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 1
Offset: 1

Views

Author

Wolfdieter Lang, Jul 01 2013

Keywords

Comments

See the comments under A227041. a(n,m) gives the denominator of H(n,m) = 2*n*m/(n+m) in lowest terms.

Examples

			The triangle of denominators of H(n,m), called a(n,m) begins:
n\m  1   2   3   4   5    6    7    8    9   10  11 ...
1:   1
2:   3   1
3:   2   5   1
4:   5   3   7   1
5:   3   7   4   9   1
6:   7   1   1   5  11    1
7:   4   9   5  11   6   13    1
8;   9   5  11   3  13    7   15    1
9:   5  11   2  13   7    5    8   17    1
10: 11   3  13   7   3    2   17    9   19    1
11:  6  13   7  15   8   17    9   19   10   21   1
...
For the triangle of the rationals H(n,m) see the example section of A227041.
H(4,2) = denominator(16/6) = denominator(8/3) = 3 = 6/gcd(6,8) = 6/2.
		

Crossrefs

Cf. A227041, A026741 (column m=1), A000265 (m=2), A106619 (m=3), A227140(n+8) (m=4), A227108 (m=5), A221918/A221919.

Formula

a(n,m) = denominator(2*n*m/(n+m)), 1 <= m <= n.
a(n,m) = (n+m)/gcd(2*n*m, n+m) = (n+m)/gcd(n+m, 2*m^2), 1 <= m <= n.

A227107 Numerators of harmonic mean H(n,4), n >= 0.

Original entry on oeis.org

0, 8, 8, 24, 4, 40, 24, 56, 16, 72, 40, 88, 6, 104, 56, 120, 32, 136, 72, 152, 20, 168, 88, 184, 48, 200, 104, 216, 7, 232, 120, 248, 64, 264, 136, 280, 36, 296, 152, 312, 80, 328, 168, 344, 22, 360, 184, 376, 96, 392, 200, 408, 52, 424, 216
Offset: 0

Views

Author

Wolfdieter Lang, Jul 01 2013

Keywords

Comments

a(n) = numerator(H(n,4)) = numerator(8*n/(n+4)), n>=0, with H(n,4) the harmonic mean of n and 4.
The corresponding denominators are given in A000265(n+4), n >= 0.
a(n+4), n>=0, is the fourth column (m=4) of the triangle A227041.

Examples

			The rationals H(n,4) begin: 0, 8/5, 8/3, 24/7, 4, 40/9, 24/5, 56/11, 16/3, 72/13, 40/7, 88/15, 6, 104/17, 56/9, 120/19, ...
		

Crossrefs

Cf. A227041(n+4,4), A227140(n+8) (denominators), n >= 0.

Formula

a(n) = numerator(8*n/(n+4)), n >= 0.
a(n) = 8*n/gcd(n+4,8*n) = 8*n/gcd(n+4,32), n >= 0.

A227043 Numerator of harmonic mean H(n,2), n>= 0.

Original entry on oeis.org

0, 4, 2, 12, 8, 20, 3, 28, 16, 36, 10, 44, 24, 52, 7, 60, 32, 68, 18, 76, 40, 84, 11, 92, 48, 100, 26, 108, 56, 116, 15, 124, 64, 132, 34, 140, 72, 148, 19, 156, 80, 164, 42, 172, 88, 180, 23, 188, 96, 196, 50, 204, 104, 212, 27, 220, 112, 228, 58, 236, 120
Offset: 0

Views

Author

Wolfdieter Lang, Jul 01 2013

Keywords

Comments

a(n) = numerator(H(n,2)) = numerator(4*n/(n+2)), n>=0, with H(n,2) the harmonic mean of n and 2.
The corresponding denominator is given in A000265(n+2), n>= 0.
a(n+2), n>=0, is the second column (m=2) of the triangle A227041.

Examples

			The rationals H(n,2) begin:
0, 4/3, 2, 12/5, 8/3, 20/7, 3, 28/9, 16/5, 36/11, 10/3, 44/13, 24/7, 52/15, 7/2, 60/17, ...
		

Crossrefs

Cf. A227041(n+2,2), A000265(n+2) (denominator), n >= 0.

Formula

a(n) = numerator(4*n/(n+2)), n >= 0.
a(n) = 4*n/gcd(n+2,4*n) = 4*n/gcd(n+2,8), n >= 0.

A227106 Numerators of harmonic mean H(n,3), n >= 0.

Original entry on oeis.org

0, 3, 12, 3, 24, 15, 4, 21, 48, 9, 60, 33, 24, 39, 84, 5, 96, 51, 36, 57, 120, 21, 132, 69, 16, 75, 156, 27, 168, 87, 60, 93, 192, 11, 204, 105, 72, 111, 228, 39, 240, 123, 28, 129, 264, 45, 276, 141, 96, 147, 300, 17, 312, 159, 108, 165, 336, 57, 348, 177
Offset: 0

Views

Author

Wolfdieter Lang, Jul 01 2013

Keywords

Comments

a(n) = numerator(H(n,3)) = numerator(6*n/(n+3)), n>=0, with H(n,3) the harmonic mean of n and 3.
The corresponding denominators are given in A106619(n+3), n >= 0.
a(n+3), n>=0, is the third column (m=3) of the triangle A227041.

Examples

			The rationals H(n,3) begin: 0, 3/2, 12/5, 3, 24/7, 15/4, 4, 21/5, 48/11, 9/2, 60/13, 33/7, 24/5, 39/8, 84/17, 5, ...
		

Crossrefs

A227041(n+3,3), A106619(n+3) (denominator), n >= 0.

Programs

  • Mathematica
    Table[Numerator[HarmonicMean[{n,3}]],{n,0,60}] (* Harvey P. Dale, Jun 01 2017 *)

Formula

a(n) = numerator(6*n/(n+3)), n >= 0.
a(n) = 6*n/gcd(n+3,6*n) = 6*n/gcd(n+3,18), n >= 0.

A227109 Numerators of harmonic mean H(n, 5), n >= 0.

Original entry on oeis.org

0, 5, 20, 15, 40, 5, 60, 35, 80, 45, 20, 55, 120, 65, 140, 15, 160, 85, 180, 95, 8, 105, 220, 115, 240, 25, 260, 135, 280, 145, 60, 155, 320, 165, 340, 35, 360, 185, 380, 195, 80, 205, 420, 215, 440, 9, 460, 235, 480, 245, 100, 255, 520, 265, 540, 55, 560
Offset: 0

Views

Author

Wolfdieter Lang, Jul 01 2013

Keywords

Comments

a(n) = numerator(H(n, 5)) = numerator(10*n/(n+5)), n>=0, with H(n, 5) the harmonic mean of n and 5.
The corresponding denominator is given in A227108(n), n>= 0.
a(n+5), n>=0, is the fifth column (m=5) of the triangle A227041.

Examples

			The rationals H(n,5) begin: 0, 5/3, 20/7, 15/4, 40/9, 5, 60/11, 35/6, 80/13, 45/7, 20/3, 55/8, 120/17, 65/9, ...
		

Crossrefs

Cf. A227041(n+5,5), A227108 (denominator).

Programs

  • Magma
    [Numerator(10*n/(n+5)): n in [0..60]]; // Vincenzo Librandi, Nov 06 2016
  • Mathematica
    Table[Numerator[(10 n / (n + 5))], {n, 0, 60}] (* Vincenzo Librandi, Nov 06 2016 *)
  • PARI
    a(n) = numerator(10*n/(n+5)); \\ Michel Marcus, Nov 06 2016
    

Formula

a(n) = numerator(10*n/(n+5)), n >= 0.
a(n) = 10*n/gcd(n+5,10*n) = 10*n/gcd(n+5,50), n >= 0.
Showing 1-7 of 7 results.