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

A349593 Square array read by downward diagonals: for n >= 0, k >= 1, T(n,k) is the period of {binomial(N,n) mod k: N in Z}.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 4, 1, 1, 4, 3, 4, 1, 1, 5, 8, 9, 8, 1, 1, 6, 5, 8, 9, 8, 1, 1, 7, 12, 5, 16, 9, 8, 1, 1, 8, 7, 36, 5, 16, 9, 8, 1, 1, 9, 16, 7, 72, 25, 16, 9, 16, 1, 1, 10, 9, 16, 7, 72, 25, 16, 9, 16, 1, 1, 11, 20, 27, 32, 7, 72, 25, 32, 27, 16, 1
Offset: 0

Views

Author

Jianing Song, Nov 27 2021

Keywords

Comments

Since binomial(N,n) is defined for all integers N, there is no need to assume that N >= n.
Let Q(N) = 1 if k | binomial(N,n), 0 otherwise. Then T(n,k) is also the period of {Q(N): N in Z}.
By the formula given below, the n-th row is identical to the (n-1)th row if and only if n is not a power of a prime, i.e., n is in A024619. - Jianing Song, Jul 03 2025

Examples

			Rows 0..10:
  1,  1,  1,  1,  1,   1,  1,  1,  1,   1, ...
  1,  2,  3,  4,  5,   6,  7,  8,  9,  10, ...
  1,  4,  3,  8,  5,  12,  7, 16,  9,  20, ...
  1,  4,  9,  8,  5,  36,  7, 16, 27,  20, ...
  1,  8,  9, 16,  5,  72,  7, 32, 27,  40, ...
  1,  8,  9, 16, 25,  72,  7, 32, 27, 200, ...
  1,  8,  9, 16, 25,  72,  7, 32, 27, 200, ...
  1,  8,  9, 16, 25,  72, 49, 32, 27, 200, ...
  1, 16,  9, 32, 25, 144, 49, 64, 27, 400, ...
  1, 16, 27, 32, 25, 432, 49, 64, 81, 400, ...
  1, 16, 27, 32, 25, 432, 49, 64, 81, 400, ...
Example showing that T(4,4) = 16: for N == 0, 1, ..., 15 (mod 16), binomial(N,4) == {0, 0, 0, 0, 1, 1, 3, 3, 2, 2, 2, 2, 3, 3, 1, 1} (mod 4).
Example showing that T(3,10) = 20: for N == 0, 1, ..., 19 (mod 20), binomial(N,3) == {0, 0, 0, 1, 4, 0, 0, 5, 6, 4, 0, 5, 0, 6, 4, 5, 0, 0, 6, 9} (mod 10).
		

Crossrefs

Cf. A022998 (row n = 2), A385555 (row n = 3), A385556 (row n = 4), A385557 (rows n = 5 and 6), A385558 (row n = 7), A385559 (row n = 8), A385560 (rows n = 9 and 10).
Cf. A062383 (2nd column), A064235 (3rd column if offset 0), A385552 (5th column), A385553 (6th column), A385554 (10th column).
Cf. A349221.

Programs

  • Mathematica
    A349593[n_, k_] := If[n == 0 || k == 1, 1, k*Product[p^Floor[Log[p, n]], {p, FactorInteger[k][[All, 1]]}]];
    Table[A349593[k - 1, n - k + 2], {n, 0, 15}, {k, n + 1}] (* Paolo Xausa, Jul 07 2025 *)
  • PARI
    T(n,k) = if(n==0, 1, my(r=1, f=factor(k)); for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]); r *= p^(logint(n,p)+e)); return(r))

Formula

The n-th row is multiplicative with T(n,p^e) = 1 if n = 0, p^(e+floor(log(n)/log(p))) otherwise. In other words, for n > 0, T(n,k) = k * Product_{prime p|k} p^(floor(log(n)/log(p))). See my pdf file for a proof.

A385555 Period of {binomial(N,3) mod n: N in Z}.

Original entry on oeis.org

1, 4, 9, 8, 5, 36, 7, 16, 27, 20, 11, 72, 13, 28, 45, 32, 17, 108, 19, 40, 63, 44, 23, 144, 25, 52, 81, 56, 29, 180, 31, 64, 99, 68, 35, 216, 37, 76, 117, 80, 41, 252, 43, 88, 135, 92, 47, 288, 49, 100, 153, 104, 53, 324, 55, 112, 171, 116, 59, 360
Offset: 1

Views

Author

Jianing Song, Jul 03 2025

Keywords

Examples

			For N == 0, 1, ..., 26 (mod 27), binomial(N,3) == {0, 0, 0, 1, 4, 1, 2, 8, 2, 3, 3, 3, 4, 7, 4, 5, 2, 5, 6, 6, 6, 7, 1, 7, 8, 5, 8} (mod 4).
		

Crossrefs

Row n = 3 of A349593. A022998, A385556, A385557, A385558, A385559, and A385560 are respectively rows n = 2, 4, 5-6, 7, 8, and 9-10.
Cf. A089128.

Programs

  • Mathematica
    A385555[n_] := If[n == 1, 1, n*Product[p^Floor[Log[p, 3]], {p, FactorInteger[n][[All, 1]]}]];
    Array[A385555, 100] (* Paolo Xausa, Jul 07 2025 *)
    a[n_] := n * GCD[n, 6]; Array[a, 100] (* Amiram Eldar, Jul 07 2025 *)
  • PARI
    a(n, {choices=3}) = my(r=1, f=factor(n)); for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]); r *= p^(logint(choices, p)+e)); return(r)

Formula

Multiplicative with a(2^e) = 2^(e+1), a(3^e) = 3^(e+1), and a(p^e) = p^e for primes p >= 5.
From Amiram Eldar, Jul 07 2025: (Start)
a(n) = n * gcd(6, n) = n * A089128(n).
Dirichlet g.f.: zeta(s-1) * (1 + 1/2*(s-1)) * (1 + 2/3*(s-1)).
Sum_{k=1..n} a(k) ~ (5/4) * n^2. (End)

A385556 Period of {binomial(N,4) mod n: N in Z}.

Original entry on oeis.org

1, 8, 9, 16, 5, 72, 7, 32, 27, 40, 11, 144, 13, 56, 45, 64, 17, 216, 19, 80, 63, 88, 23, 288, 25, 104, 81, 112, 29, 360, 31, 128, 99, 136, 35, 432, 37, 152, 117, 160, 41, 504, 43, 176, 135, 184, 47, 576, 49, 200, 153, 208, 53, 648, 55, 224, 171, 232, 59, 720
Offset: 1

Views

Author

Jianing Song, Jul 03 2025

Keywords

Examples

			For N == 0, 1, ..., 31 (mod 32), binomial(N,4) == {0, 0, 0, 0, 1, 5, 7, 3, 6, 6, 2, 2, 7, 3, 1, 5, 4, 4, 4, 4, 5, 1, 3, 7, 2, 2, 6, 6, 3, 7, 5, 1} (mod 8).
		

Crossrefs

Row n = 4 of A349593. A022998, A385555, A385557, A385558, A385559, and A385560 are respectively rows n = 2, 3, 5-6, 7, 8, and 9-10.

Programs

  • Mathematica
    A385556[n_] := If[n == 1, 1, n*Product[p^Floor[Log[p, 4]], {p, FactorInteger[n][[All, 1]]}]];
    Array[A385556, 100] (* Paolo Xausa, Jul 07 2025 *)
    a[n_] := n * GCD[n, 6] * (2 - Mod[n, 2]); Array[a, 100] (* Amiram Eldar, Jul 07 2025 *)
  • PARI
    a(n, {choices=4}) = my(r=1, f=factor(n)); for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]); r *= p^(logint(choices, p)+e)); return(r)

Formula

Multiplicative with a(2^e) = 2^(e+2), a(3^e) = 3^(e+1), and a(p^e) = p^e for primes p >= 5.
From Amiram Eldar, Jul 07 2025: (Start)
a(n) = n * gcd(6, n) * (2 - (n mod 2)) = n * A089128(n) * A000034(n-1).
Dirichlet g.f.: zeta(s-1) * (1 + 3/2*(s-1)) * (1 + 2/3*(s-1)).
Sum_{k=1..n} a(k) ~ (25/12) * n^2. (End)

A385557 Period of {binomial(N,5) mod n: N in Z}. Also, period of {binomial(N,6) mod n: N in Z}.

Original entry on oeis.org

1, 8, 9, 16, 25, 72, 7, 32, 27, 200, 11, 144, 13, 56, 225, 64, 17, 216, 19, 400, 63, 88, 23, 288, 125, 104, 81, 112, 29, 1800, 31, 128, 99, 136, 175, 432, 37, 152, 117, 800, 41, 504, 43, 176, 675, 184, 47, 576, 49, 1000, 153, 208, 53, 648, 275, 224, 171, 232, 59, 3600
Offset: 1

Views

Author

Jianing Song, Jul 03 2025

Keywords

Examples

			For N == 0, 1, ..., 71 (mod 72), binomial(N,5) == {0, 0, 0, 0, 0, 1, 0, 3, 2, 0, 0, 0, 0, 3, 4, 3, 0, 2, 0, 0, 0, 3, 0, 1, 0, 0, 2, 0, 0, 3, 0, 3, 4, 0, 0, 2, 0, 3, 0, 3, 0, 4, 0, 0, 2, 3, 0, 3, 0, 0, 4, 0, 0, 5, 0, 3, 0, 0, 0, 4, 0, 3, 2, 3, 0, 0, 0, 0, 4, 3, 0, 5} (mod 6), and binomial(N,6) == {0, 0, 0, 0, 0, 0, 1, 1, 4, 0, 0, 0, 0, 0, 3, 1, 4, 4, 0, 0, 0, 0, 3, 3, 4, 4, 4, 0, 0, 0, 3, 3, 0, 4, 4, 4, 0, 0, 3, 3, 0, 0, 4, 4, 4, 0, 3, 3, 0, 0, 0, 4, 4, 4, 3, 3, 0, 0, 0, 0, 4, 4, 1, 3, 0, 0, 0, 0, 0, 4, 1, 1} (mod 6).
		

Crossrefs

Rows n = 5 and 6 of A349593. A022998, A385555, A385556, A385558, A385559, and A385560 are respectively rows 2, 3, 4, 7, 8, and 9-10.

Programs

  • Mathematica
    A385557[n_] := If[n == 1, 1, n*Product[p^Floor[Log[p, 5]], {p, FactorInteger[n][[All, 1]]}]];
    Array[A385557, 100] (* Paolo Xausa, Jul 07 2025 *)
    a[n_] := n * GCD[n, 30] * (2 - Mod[n, 2]); Array[a, 100] (* Amiram Eldar, Jul 07 2025 *)
  • PARI
    a(n, {choices=5}) = my(r=1, f=factor(n)); for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]); r *= p^(logint(choices, p)+e)); return(r)

Formula

Multiplicative with a(2^e) = 2^(e+2), a(3^e) = 3^(e+1), a(5^e) = 5^(e+1), and a(p^e) = p^e for primes p >= 7.
From Amiram Eldar, Jul 07 2025: (Start)
a(n) = n * gcd(30, n) * (2 - (n mod 2)).
Dirichlet g.f.: zeta(s-1) * (1 + 3/2*(s-1)) * (1 + 2/3*(s-1)) * (1 + 4/5*(s-1)).
Sum_{k=1..n} a(k) ~ (15/4) * n^2. (End)

A385559 Period of {binomial(N,8) mod n: N in Z}.

Original entry on oeis.org

1, 16, 9, 32, 25, 144, 49, 64, 27, 400, 11, 288, 13, 784, 225, 128, 17, 432, 19, 800, 441, 176, 23, 576, 125, 208, 81, 1568, 29, 3600, 31, 256, 99, 272, 1225, 864, 37, 304, 117, 1600, 41, 7056, 43, 352, 675, 368, 47, 1152, 343, 2000, 153, 416, 53, 1296, 275, 3136, 171, 464, 59, 7200
Offset: 1

Views

Author

Jianing Song, Jul 03 2025

Keywords

Examples

			For N == 0, 1, ..., 63 (mod 64), binomial(N,8) == {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 5, 7, 7, 3, 3, 6, 6, 6, 6, 2, 2, 2, 2, 7, 7, 3, 3, 1, 1, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 1, 1, 3, 3, 7, 7, 2, 2, 2, 2, 6, 6, 6, 6, 3, 3, 7, 7, 5, 5, 1, 1} (mod 8).
		

Crossrefs

Row n = 8 of A349593. A022998, A385555, A385556, A385557, A385558, and A385560 are respectively rows 2, 3, 4, 5-6, 7, and 9-10.

Programs

  • Mathematica
    A385559[n_] := If[n == 1, 1, n*Product[p^Floor[Log[p, 8]], {p, FactorInteger[n][[All, 1]]}]];
    Array[A385559, 100] (* Paolo Xausa, Jul 07 2025 *)
    a[n_] := n * GCD[n, 210] * (4 - 3 * Mod[n, 2]); Array[a, 100] (* Amiram Eldar, Jul 07 2025 *)
  • PARI
    a(n, {choices=8}) = my(r=1, f=factor(n)); for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]); r *= p^(logint(choices, p)+e)); return(r)

Formula

Multiplicative with a(2^e) = 2^(e+3), a(3^e) = 3^(e+1), a(5^e) = 5^(e+1), a(7^e) = 7^(e+1), and a(p^e) = p^e for primes p >= 11.
From Amiram Eldar, Jul 07 2025: (Start)
a(n) = n * gcd(210, n) * (4 - 3 * (n mod 2)).
Dirichlet g.f.: zeta(s-1) * (1 + 7/2*(s-1)) * (1 + 2/3*(s-1)) * (1 + 4/5*(s-1)) * (1 + 6/7*(s-1)).
Sum_{k=1..n} a(k) ~ (351/28) * n^2. (End)

A385560 Period of {binomial(N,9) mod n: N in Z}. Also, period of {binomial(N,10) mod n: N in Z}.

Original entry on oeis.org

1, 16, 27, 32, 25, 432, 49, 64, 81, 400, 11, 864, 13, 784, 675, 128, 17, 1296, 19, 800, 1323, 176, 23, 1728, 125, 208, 243, 1568, 29, 10800, 31, 256, 297, 272, 1225, 2592, 37, 304, 351, 1600, 41, 21168, 43, 352, 2025, 368, 47, 3456, 343, 2000, 459, 416, 53, 3888, 275, 3136, 513, 464, 59, 21600
Offset: 1

Views

Author

Jianing Song, Jul 03 2025

Keywords

Examples

			For N == 0, 1, ..., 80 (mod 81), binomial(N,9) == {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 4, 4, 4, 1, 1, 1, 2, 2, 2, 8, 8, 8, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 7, 7, 7, 4, 4, 4, 5, 5, 5, 2, 2, 2, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 1, 1, 1, 7, 7, 7, 8, 8, 8, 5, 5, 5, 8, 8, 8} (mod 9), and binomial(N,10) == {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 7, 2, 6, 7, 8, 0, 2, 4, 6, 5, 4, 3, 5, 7, 0, 3, 6, 0, 3, 6, 0, 3, 6, 0, 4, 8, 3, 1, 8, 6, 1, 5, 0, 5, 1, 6, 8, 1, 3, 8, 4, 0, 6, 3, 0, 6, 3, 0, 6, 3, 0, 7, 5, 3, 4, 5, 6, 4, 2, 0, 8, 7, 6, 2, 7, 3, 2, 1} (mod 9).
		

Crossrefs

Rows n = 9 and 10 of A349593. A022998, A385555, A385556, A385557, A385558, and A385559 are respectively rows 2, 3, 4, 5-6, 7, and 8.

Programs

  • Mathematica
    A385560[n_] := If[n == 1, 1, n*Product[p^Floor[Log[p, 9]], {p, FactorInteger[n][[All, 1]]}]];
    Array[A385560, 100] (* Paolo Xausa, Jul 07 2025 *)
    a[n_] := n * GCD[n, 6] * GCD[n, 210] * (2 - Mod[n, 2]); Array[a, 100] (* Amiram Eldar, Jul 07 2025 *)
  • PARI
    a(n, {choices=10}) = my(r=1, f=factor(n)); for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]); r *= p^(logint(choices, p)+e)); return(r)

Formula

Multiplicative with a(2^e) = 2^(e+3), a(3^e) = 3^(e+2), a(5^e) = 5^(e+1), a(7^e) = 7^(e+1), and a(p^e) = p^e for primes p >= 11.
From Amiram Eldar, Jul 07 2025: (Start)
a(n) = n * gcd(6, n) * gcd(210, n) * (2 - (n mod 2)).
Dirichlet g.f.: zeta(s-1) * (1 + 7/2*(s-1)) * (1 + 8/3*(s-1)) * (1 + 4/5*(s-1)) * (1 + 6/7*(s-1)).
Sum_{k=1..n} a(k) ~ (3861/140) * n^2. (End)
Showing 1-7 of 7 results.