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 20 results. Next

A276317 a(n) = b(n)/c(n) where b(n) = smallest positive k such that (2*k)^2 + 2*n - 1 is prime and c(n) = gcd(n,3) = A109007(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 4, 1, 2, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 4, 2, 2, 1, 2, 1, 4, 1, 1, 1, 1, 5, 2, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 5, 2, 1, 1, 3, 2, 2, 3, 1, 1, 1, 1
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 29 2016

Keywords

Examples

			a(1) = b(1)/c(1) = 1/1 = 1 because b(1) = (2*1)^2 + 2*1 - 1 = 5 and 5 is prime, c(1) = gcd(1,3) + A109007(1) = 1,
a(2) = b(2)/c(2) = 1/1 = 1 because b(2) = (2*1)^2 + 2*2 - 1 = 7 and 7 is prime, c(2) = gcd(2,3) + A109007(2) = 1,
a(3) = b(3)/c(3) = 3/3 = 1 because b(2) = (2*3)^2 + 2*3 - 1 = 41 and 41 is prime, c(3) = gcd(3,3) + A109007(3) = 3.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 1; While[! PrimeQ[(2 k)^2 + 2 n - 1], k++]; k/GCD[n, 3], {n, 97}] (* Michael De Vlieger, Aug 31 2016 *)

A026741 a(n) = n if n odd, n/2 if n even.

Original entry on oeis.org

0, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38
Offset: 0

Views

Author

J. Carl Bellinger (carlb(AT)ctron.com)

Keywords

Comments

a(n) is the size of largest conjugacy class in D_2n, the dihedral group with 2n elements. - Sharon Sela (sharonsela(AT)hotmail.com), May 14 2002
a(n+1) is the composition length of the n-th symmetric power of the natural representation of a finite subgroup of SL(2,C) of type D_4 (quaternion group). - Paul Boddington, Oct 23 2003
For n > 1, a(n) is the greatest common divisor of all permutations of {0, 1, ..., n} treated as base n + 1 integers. - David Scambler, Nov 08 2006 (see the Mathematics Stack Exchange link below).
From Dimitrios Choussos (choussos(AT)yahoo.de), May 11 2009: (Start)
Sequence A075888 and the above sequence are fitting together.
First 2 entries of this sequence have to be taken out.
In some cases two three or more sequenced entries of this sequence have to be added together to get the next entry of A075888.
Example: Sequences begin with 1, 3, 2, 5, 3, 7, 4, 9 (4 + 9 = 13, the next entry in A075888).
But it works out well up to primes around 50000 (haven't tested higher ones).
As A075888 gives a very regular graph. There seems to be a regularity in the primes. (End)
Starting with 1 = triangle A115359 * [1, 2, 3, ...]. - Gary W. Adamson, Nov 27 2009
From Gary W. Adamson, Dec 11 2009: (Start)
Let M be an infinite lower triangular matrix with (1, 1, 1, 0, 0, 0, ...) in every column, shifted down twice. This sequence starting with 1 = M * (1, 2, 3, ...)
M =
1;
1, 0;
1, 1, 0;
0, 1, 0, 0;
0, 1, 1, 0, 0;
0, 0, 1, 0, 0, 0;
0, 0, 1, 1, 0, 0, 0;
...
A026741 = M * (1, 2, 3, ...); but A002487 = lim_{n->infinity} M^n, a left-shifted vector considered as a sequence. (End)
A particular case of sequence for which a(n+3) = (a(n+2) * a(n+1)+q)/a(n) for every n > n0. Here n0 = 1 and q = -1. - Richard Choulet, Mar 01 2010
For n >= 2, a(n+1) is the smallest m such that s_n(2*m*(n-1))/(n-1) is even, where s_b(c) is the sum of digits of c in base b. - Vladimir Shevelev, May 02 2011
A001477 and A005408 interleaved. - Omar E. Pol, Aug 22 2011
Numerator of n/((n-1)*(n-2)). - Michael B. Porter, Mar 18 2012
Number of odd terms of n-th row in the triangles A162610 and A209297. - Reinhard Zumkeller, Jan 19 2013
For n >= 3, a(n) is the periodic of integer of spiral length ratio of spiral that have (n-1) circle centers. See illustration in links. - Kival Ngaokrajang, Dec 28 2013
This is the sequence of Lehmer numbers u_n(sqrt(R), Q) with the parameters R = 4 and Q = 1. It is a strong divisibility sequence, that is, gcd(a(n), a(m)) = a(gcd(n, m)) for all natural numbers n and m. Cf. A005013 and A108412. - Peter Bala, Apr 18 2014
The sequence of convergents of the 2-periodic continued fraction [0; 1, -4, 1, -4, ...] = 1/(1 - 1/(4 - 1/(1 - 1/(4 - ...)))) = 2 begins [0/1, 1/1, 4/3, 3/2, 8/5, 5/3, 12/7, ...]. The present sequence is the sequence of denominators; the sequence of numerators of the continued fraction convergents [0, 1, 4, 3, 8, 5, 12, ...] is A022998, also a strong divisibility sequence. - Peter Bala, May 19 2014
For n >= 3, (a(n-2)/a(n))*Pi = vertex angle of a regular n-gon. See illustration in links. - Kival Ngaokrajang, Jul 17 2014
For n > 1, the numerator of the harmonic mean of the first n triangular numbers. - Colin Barker, Nov 13 2014
The difference sequence is a permutation of the integers. - Clark Kimberling, Apr 19 2015
From Timothy Hopper, Feb 26 2017: (Start)
Given the function a(n, p) = n/p if n mod p = 0, else n, then a possible formula is: a(n, p) = n*(1 + (p-1)*((n^(p-1)) mod p))/p, p prime, (n^(p-1)) mod p = 1, n not divisible by p. (Fermat's Little Theorem). Examples: p = 2; a(n), p = 3; A051176(n), p = 5; A060791(n), p = 7; A106608(n).
Conjecture: lcm(n, p) = p*a(n, p), gcd(n, p) = n/a(n, p). (End)
Let r(n) = (a(n+1) + 1)/a(n+1) if n mod 2 = 1, a(n+1)/(a(n+1) + 2) otherwise; then lim_{k->oo} 2^(k+2) * Product_{n=0..k} r(n)^(k-n) = Pi. - Dimitris Valianatos, Mar 22 2021
Number of integers k from 1 to n such that gcd(n,k) is odd. - Amiram Eldar, May 18 2025

Examples

			G.f. = x + x^2 + 3*x^3 + 2*x^4 + 5*x^5 + 3*x^6 + 7*x^7 + 4*x^8 + ...
		

References

  • David Wells, Prime Numbers: The Most Mysterious Figures in Math. Hoboken, New Jersey: John Wiley & Sons (2005), p. 53.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, 2nd Ed. Penguin (1997), p. 79.

Crossrefs

Signed version is in A030640. Partial sums give A001318.
Cf. A051176, A060819, A060791, A060789 for n / gcd(n, k) with k = 3..6. See also A106608 thru A106612 (k = 7 thru 11), A051724 (k = 12), A106614 thru A106621 (k = 13 thru 20).
Cf. A013942.
Cf. A227042 (first column). Cf. A005013 and A108412.

Programs

  • Haskell
    import Data.List (transpose)
    a026741 n = a026741_list !! n
    a026741_list = concat $ transpose [[0..], [1,3..]]
    -- Reinhard Zumkeller, Dec 12 2011
    
  • Magma
    [2*n/(3+(-1)^n): n in [0..70]]; // Vincenzo Librandi, Aug 14 2011
    
  • Maple
    A026741 := proc(n) if type(n,'odd') then n; else n/2; end if; end proc: seq(A026741(n), n=0..76); # R. J. Mathar, Jan 22 2011
  • Mathematica
    Numerator[Abs[Table[Det[DiagonalMatrix[Table[1/i^2 - 1, {i, 1, n - 1}]] + 1], {n, 20}]]] (* Alexander Adamchuk, Jun 02 2006 *)
    halfMax = 40; Riffle[Range[0, halfMax], Range[1, 2halfMax + 1, 2]] (* Harvey P. Dale, Mar 27 2011 *)
    a[ n_] := Numerator[n / 2]; (* Michael Somos, Jan 20 2017 *)
    Array[If[EvenQ[#],#/2,#]&,80,0] (* Harvey P. Dale, Jul 08 2023 *)
  • PARI
    a(n) = numerator(n/2) \\ Rick L. Shepherd, Sep 12 2007
    
  • Python
    def A026741(n): return n if n % 2 else n//2 # Chai Wah Wu, Apr 02 2021
  • Sage
    [lcm(n, 2) / 2 for n in range(77)] # Zerinvary Lajos, Jun 07 2009
    

Formula

G.f.: x*(1 + x + x^2)/(1-x^2)^2. - Len Smiley, Apr 30 2001
a(n) = 2*a(n-2) - a*(n-4) for n >= 4.
a(n) = n * 2^((n mod 2) - 1). - Reinhard Zumkeller, Oct 16 2001
a(n) = 2*n/(3 + (-1)^n). - Benoit Cloitre, Mar 24 2002
Multiplicative with a(2^e) = 2^(e-1) and a(p^e) = p^e, p > 2. - Vladeta Jovovic, Apr 05 2002
a(n) = n / gcd(n, 2). a(n)/A045896(n) = n/((n+1)*(n+2)).
For n > 0, a(n) = denominator of Sum_{i=1..n-1} 2/(i*(i+1)), numerator=A022998. - Reinhard Zumkeller, Apr 21 2012, Jul 25 2002 [thanks to Phil Carmody who noticed an error]
For n > 1, a(n) = GCD of the n-th and (n-1)-th triangular numbers (A000217). - Ross La Haye, Sep 13 2003
Euler transform of finite sequence [1, 2, -1]. - Michael Somos, Jun 15 2005
G.f.: x * (1 - x^3) / ((1 - x) * (1 - x^2)^2) = Sum_{k>0} k * (x^k - x^(2*k)). - Michael Somos, Jun 15 2005
a(n+3) + a(n+2) = 3 + a(n+1) + a(n). a(n+3) * a(n) = - 1 + a(n+2) * a(n+1). a(n) = -a(-n) for all n in Z. - Michael Somos, Jun 15 2005
For n > 1, a(n) is the numerator of the average of 1, 2, ..., n - 1; i.e., numerator of A000217(n-1)/(n-1), with corresponding denominators [1, 2, 1, 2, ...] (A000034). - Rick L. Shepherd, Jun 05 2006
Equals A126988 * (1, -1, 0, 0, 0, ...). - Gary W. Adamson, Apr 17 2007
For n >= 1, a(n) = gcd(n,A000217(n)). - Rick L. Shepherd, Sep 12 2007
a(n) = numerator(n/(2*n-2)) for n >= 2; A022998(n-1) = denominator(n/(2*n-2)) for n >= 2. - Johannes W. Meijer, Jun 18 2009
a(n) = A167192(n+2, 2). - Reinhard Zumkeller, Oct 30 2009
a(n) = A106619(n) * A109012(n). - Paul Curtz, Apr 04 2011
From R. J. Mathar, Apr 18 2011: (Start)
a(n) = A109043(n)/2.
Dirichlet g.f.: zeta(s-1)*(1 - 1/2^s). (End)
a(n) = A001318(n) - A001318(n-1) for n > 0. - Jonathan Sondow, Jan 28 2013
a((2*n+1)*2^p - 1) = 2^p - 1 + n*A151821(p+1), p >= 0 and n >= 0. - Johannes W. Meijer, Feb 03 2013
a(n+1) = denominator(H(n, 1)), n >= 0, with H(n, 1) = 2*n/(n+1) the harmonic mean of n and 1. a(n+1) = A227042(n, 1). See the formula a(n) = n/gcd(n, 2) given above. - Wolfdieter Lang, Jul 04 2013
a(n) = numerator(n/2). - Wesley Ivan Hurt, Oct 02 2013
a(n) = numerator(1 - 2/(n+2)), n >= 0; a(n) = denominator(1 - 2/n), n >= 1. - Kival Ngaokrajang, Jul 17 2014
a(n) = Sum_{i = floor(n/2)..floor((n+1)/2)} i. - Wesley Ivan Hurt, Apr 27 2016
Euler transform of length 3 sequence [1, 2, -1]. - Michael Somos, Jan 20 2017
G.f.: x / (1 - x / (1 - 2*x / (1 + 7*x / (2 - 9*x / (7 - 4*x / (3 - 7*x / (2 + 3*x))))))). - Michael Somos, Jan 20 2017
From Peter Bala, Mar 24 2019: (Start)
a(n) = Sum_{d|n, n/d odd} phi(d), where phi(n) is the Euler totient function A000010.
O.g.f.: Sum_{n >= 1} phi(n)*x^n/(1 - x^(2*n)). (End)
a(n) = A256095(2*n,n). - Alois P. Heinz, Jan 21 2020
E.g.f.: x*(2*cosh(x) + sinh(x))/2. - Stefano Spezia, Apr 28 2023
From Ctibor O. Zizka, Oct 05 2023: (Start)
For k >= 0, a(k) = gcd(k + 1, k*(k + 1)/2).
If (k mod 4) = 0 or 2 then a(k) = (k + 1).
If (k mod 4) = 1 or 3 then a(k) = (k + 1)/2. (End)
Sum_{n=1..oo} 1/a(n)^2 = 7*Pi^2/24. - Stefano Spezia, Dec 02 2023
a(n)*a(n+1) = A000217(n). - Rémy Sigrist, Mar 19 2025

Extensions

Better description from Jud McCranie
Edited by Ralf Stephan, Jun 04 2003

A003989 Triangle T from the array A(x, y) = gcd(x,y), for x >= 1, y >= 1, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

For m < n, the maximal number of nonattacking queens that can be placed on the n by m rectangular toroidal chessboard is gcd(m,n), except in the case m=3, n=6.
The determinant of the matrix of the first n rows and columns is A001088(n). [Smith, Mansion] - Michael Somos, Jun 25 2012
Imagine a torus having regular polygonal cross-section of m sides. Now, break the torus and twist the free ends, preserving rotational symmetry, then reattach the ends. Let n be the number of faces passed in twisting the torus before reattaching it. For example, if n = m, then the torus has exactly one full twist. Do this for arbitrary m and n (m > 1, n > 0). Now, count the independent, closed paths on the surface of the resulting torus, where a path is "closed" if and only if it returns to its starting point after a finite number of times around the surface of the torus. Conjecture: this number is always gcd(m,n). NOTE: This figure constitutes a group with m and n the binary arguments and gcd(m,n) the resulting value. Twisting in the reverse direction is the inverse operation, and breaking & reattaching in place is the identity operation. - Jason Richardson-White, May 06 2013
Regarded as a triangle, table of gcd(n - k +1, k) for 1 <= k <= n. - Franklin T. Adams-Watters, Oct 09 2014
The n-th row of the triangle is 1,...,1, if and only if, n + 1 is prime. - Alexandra Hercilia Pereira Silva, Oct 03 2020

Examples

			The array A begins:
  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
  [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
  [1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1]
  [1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4]
  [1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1]
  [1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2]
  [1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 7, 1, 1]
  [1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 8]
  [1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1]
  [1, 2, 1, 2, 5, 2, 1, 2, 1, 10, 1, 2, 1, 2, 5, 2]
  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1]
  [1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4]
  ...
The triangle T begins:
  n\k 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 ...
  1:  1
  2:  1  1
  3:  1  2  1
  4:  1  1  1  1
  5:  1  2  3  2  1
  6:  1  1  1  1  1  1
  7:  1  2  1  4  1  2  1
  8:  1  1  3  1  1  3  1  1
  9:  1  2  1  2  5  2  1  2  1
 10:  1  1  1  1  1  1  1  1  1  1
 11:  1  2  3  4  1  6  1  4  3  2  1
 12:  1  1  1  1  1  1  1  1  1  1  1  1
 13:  1  2  1  2  1  2  7  2  1  2  1  2  1
 14:  1  1  3  1  5  3  1  1  3  5  1  3  1  1
 15:  1  2  1  4  1  2  1  8  1  2  1  4  1  2  1
 ...  - _Wolfdieter Lang_, May 12 2018
		

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, Addison-Wesley, 2nd ed., 1994, ch. 4.
  • D. E. Knuth, The Art of Computer Programming, Addison-Wesley, section 4.5.2.

Crossrefs

Rows, columns and diagonals: A089128, A109007, A109008, A109009, A109010, A109011, A109012, A109013, A109014, A109015.
A109004 is (0, 0) based.
Cf. also A091255 for GF(2)[X] polynomial analog.
A(x, y) = A075174(A004198(A075173(x), A075173(y))) = A075176(A004198(A075175(x), A075175(y))).
Antidiagonal sums are in A006579.

Programs

  • GAP
    Flat(List([1..15],n->List([1..n],k->Gcd(n-k+1,k)))); # Muniru A Asiru, Aug 26 2018
  • Maple
    a:=(n,k)->gcd(n-k+1,k): seq(seq(a(n,k),k=1..n),n=1..15); # Muniru A Asiru, Aug 26 2018
  • Mathematica
    Table[ GCD[x - y + 1, y], {x, 1, 15}, {y, 1, x}] // Flatten (* Jean-François Alcover, Dec 12 2012 *)
  • PARI
    {A(n, m) = gcd(n, m)}; /* Michael Somos, Jun 25 2012 */
    

Formula

Multiplicative in both parameters with a(p^e, m) = gcd(p^e, m). - David W. Wilson, Jun 12 2005
T(n, k) = A(n - k + 1, k) = gcd(n - k + 1, k), n >= 1, k = 1..n. See a comment above and the Mathematica program. - Wolfdieter Lang, May 12 2018
Dirichlet generating function: Sum_{n>=1} Sum_{k>=1} gcd(n, k)/n^s/k^c = zeta(s)*zeta(c)*zeta(s + c - 1)/zeta(s + c). - Mats Granvik, Feb 13 2021
The LU decomposition of this square array = A051731 * transpose(A054522) (see Johnson (2003) or Chamberland (2013), p. 1673). - Peter Bala, Oct 15 2023

A109004 Table of gcd(n, m) read by antidiagonals, n >= 0, m >= 0.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			Triangle starts:
  [ 0] [0]
  [ 1] [1, 1]
  [ 2] [2, 1, 2]
  [ 3] [3, 1, 1, 3]
  [ 4] [4, 1, 2, 1, 4]
  [ 5] [5, 1, 1, 1, 1, 5]
  [ 6] [6, 1, 2, 3, 2, 1, 6]
  [ 7] [7, 1, 1, 1, 1, 1, 1, 7]
  [ 8] [8, 1, 2, 1, 4, 1, 2, 1, 8]
  [ 9] [9, 1, 1, 3, 1, 1, 3, 1, 1, 9]
  [10] [10, 1, 2, 1, 2, 5, 2, 1, 2, 1, 10]
  [11] [11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11]
  [12] [12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12]
		

References

  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 1, p. 335.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, Addison-Wesley, 2nd ed., 1994, ch. 4.
  • D. E. Knuth, The Art of Computer Programming, Addison-Wesley, section 4. 5. 2

Crossrefs

Rows, columns and diagonals: A089128, A109007, A109008, A109009, A109010, A109011, A109012, A109013, A109014, A109015.
A003989 is (1, 1) based.

Programs

  • Mathematica
    a[n_, m_] := GCD[n, m]; Table[a[n - m, m], {n,0,10}, {m,0,n}]//Flatten (* G. C. Greubel, Jan 04 2018 *)
  • PARI
    {a(n, m) = gcd( n, m)}
    
  • PARI
    {a(n, m) = local(x); n = abs(n); m = abs(m); if( !m, n, -2 * sum( k=1, m, x = k * n / m; x - floor( x) - 1/2))} /* Michael Somos, May 22 2011 */
    
  • Python
    # Since 3.5 part of the math module. For a version using the binary GCD algorithm see the links.
    for n in range(13): print([math.gcd(n, k) for k in range(n + 1)])  # Peter Luschny, May 14 2025

Formula

a(n, m) = a(m, n) = a(m, n-m) = a(m, n mod m), n >= m.
a(n, m) = n + m - n*m + 2*Sum_{k=1..m-1} floor(k*n/m).
Multiplicative in both parameters with a(p^e, m) = gcd(p^e, m). - David W. Wilson, Jun 12 2005

A144437 Period 3: repeat [3, 3, 1].

Original entry on oeis.org

3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3
Offset: 1

Views

Author

Paul Curtz, Oct 05 2008

Keywords

Comments

The sequence is generated from numerators in the energy differences of the hydrogen spectrum: A005563(1), A061037(4), A061039(6), A061041(8), A061043(10), A061045(12), A061047(14), A061049(16), ...
Conjecture: a(n) is the separatix. See A045944.
Also the decimal expansion of the constant 3310/999. - R. J. Mathar, May 21 2009
Continued fraction expansion of A171417.
Greatest common divisor of (n+1)^2-1 and (n+1)^2+2. - Bruno Berselli, Mar 08 2017

Crossrefs

Numerators in the energy differences of the hydrogen spectrum: A005563(1), A061037(4), A061039(6), A061041(8), A061043(10), A061045(12), A061047(14), A061049(16), ...

Programs

Formula

a(n) = (7-4*cos(2*Pi*n/3))/3. - Jaume Oliver Lafont, Nov 23 2008
G.f.: x*(3 + 3*x + x^2)/((1 - x)*(1 + x + x^2)). - R. J. Mathar, May 21 2009
a(n) = 3/gcd(n,3). - Reinhard Zumkeller, Oct 30 2009
a(n) = denominator(n^k/3), where k>0 is an integer. - Enrique Pérez Herrero, Oct 05 2011
a(n) = gcd(T(n+1), T(2)) = A256095(n+1, 2), with the triangular numbers T = A000217, for n >= 1. - Wolfdieter Lang, Mar 17 2015
a(n) = a(n-3) for n>3; a(n) = A169609(n) for n>0. - Wesley Ivan Hurt, Jul 02 2016
E.g.f.: (1/3)*(7*exp(x) - 4*exp(-x/2)*cos(sqrt(3)*x/2) - 3). - G. C. Greubel, Aug 24 2017
From Nicolas Bělohoubek, Nov 11 2021: (Start)
a(n) = 9/(a(n-2)*a(n-1)).
a(n) = 7 - a(n-2) - a(n-1). See also A052901 or A069705. (End)

Extensions

Edited by R. J. Mathar, May 21 2009

A260686 Period 6 zigzag sequence, repeat [0, 1, 2, 3, 2, 1].

Original entry on oeis.org

0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1
Offset: 0

Views

Author

Wesley Ivan Hurt, Nov 15 2015

Keywords

Comments

Decimal expansion of 37/3003. - Elmo R. Oliveira, Mar 06 2024

Crossrefs

Period k zigzag sequences: A000035 (k=2), A007877 (k=4), this sequence (k=6), A266313 (k=8), A271751 (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).

Programs

  • Magma
    [1+(1-(-1)^n)/2-(-1)^Floor((n+1)/3): n in [0..100]]; // Bruno Berselli, Nov 16 2015
    
  • Magma
    &cat[[0,1,2,3,2,1]: n in [0..15]]; // Vincenzo Librandi, Nov 17 2015
  • Maple
    A260686:=n->[0, 1, 2, 3, 2, 1][(n mod 6)+1]: seq(A260686(n), n=0..100);
  • Mathematica
    CoefficientList[Series[(x + x^2 + x^3)/(1 - x + x^3 - x^4), {x, 0, 100}], x]
    Table[1 + (1 - (-1)^n)/2 - (-1)^Floor[(n + 1)/3], {n, 0, 100}] (* Bruno Berselli, Nov 16 2015 *)
    PadRight[{}, 120, {0, 1, 2, 3, 2, 1}] (* Vincenzo Librandi, Nov 17 2015 *)
  • PARI
    concat(0, Vec((x+x^2+x^3)/(1-x+x^3-x^4) + O(x^100))) \\ Altug Alkan, Nov 15 2015
    

Formula

G.f.: x*(1 + x + x^2) / (1 - x + x^3 - x^4).
a(n) = a(n-1) - a(n-3) + a(n-4) for n > 3.
a(n) = Sum_{i=1..n} (-1)^floor((i-1)/3) for n > 0.
a(n+1) = a(n) + A130151(n).
a(2n) = 2*A011655(n), a(2n+1) = A109007(n+2).
a(n) = 1 + (1 - (-1)^n)/2 - (-1)^floor((n+1)/3). - Bruno Berselli, Nov 16 2015
a(n) = sin(n*Pi/6)^2*(11+4*cos(n*Pi/3)+2*cos(2*n*Pi/3))/3. - Wesley Ivan Hurt, Jun 17 2016
a(n) = a(n-6) for n >= 6. - Wesley Ivan Hurt, Sep 07 2022
a(n) = sqrt(n^2 mod 12) = sqrt(A070435(n)). - Nicolas Bělohoubek, May 24 2024

A027692 a(n) = n^2 + n + 7.

Original entry on oeis.org

7, 9, 13, 19, 27, 37, 49, 63, 79, 97, 117, 139, 163, 189, 217, 247, 279, 313, 349, 387, 427, 469, 513, 559, 607, 657, 709, 763, 819, 877, 937, 999, 1063, 1129, 1197, 1267, 1339, 1413, 1489, 1567, 1647, 1729, 1813, 1899, 1987, 2077, 2169, 2263, 2359, 2457, 2557
Offset: 0

Views

Author

Keywords

Comments

Integers k for which the discriminant of x^3 - k*x - k is a square. - Jacob A. Siehler, Mar 14 2009
Integers k for which the Galois group of the polynomial x^3 - k*x - k over Q is a cyclic group of order 3. See Conrad, Corollary 2.5. - Peter Bala, Oct 17 2021
From Peter Bala, Nov 18 2021: (Start)
Integers k such that 4*k - 27 is a square.
Integers k for which the Galois group of the polynomial x^3 + k*(x + 1)^2 over Q is the cyclic group C_3 (apply Conrad, Corollary 2.5 and Uchida, Lemma 1).
For the primes in this list see A005471. (End)

Crossrefs

Cf. A002522, A005471 (subset of primes), A109007, A176271.

Programs

Formula

For n > 2: a(n) = A176271(n+1,4). - Reinhard Zumkeller, Apr 13 2010
a(n) = 2*n + a(n-1) (with a(0)=7). - Vincenzo Librandi, Aug 05 2010
G.f.: (-7 + 12*x - 7*x^2)/(x-1)^3. - R. J. Mathar, Feb 06 2011
a(n+1) = n^2 + 3*n + 9, see A005471. - R. J. Mathar, Jun 06 2019
a(n) mod 6 = A109007(n+2). - R. J. Mathar, Jun 06 2019
Sum_{n>=0} 1/a(n) = Pi*tanh(Pi*3*sqrt(3)/2)/(3*sqrt(3)). - Amiram Eldar, Jan 17 2021
From Elmo R. Oliveira, Oct 30 2024: (Start)
E.g.f.: exp(x)*(7 + 2*x + x^2).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. (End)

A109044 a(n) = lcm(n,3).

Original entry on oeis.org

0, 3, 6, 3, 12, 15, 6, 21, 24, 9, 30, 33, 12, 39, 42, 15, 48, 51, 18, 57, 60, 21, 66, 69, 24, 75, 78, 27, 84, 87, 30, 93, 96, 33, 102, 105, 36, 111, 114, 39, 120, 123, 42, 129, 132, 45, 138, 141, 48, 147, 150, 51, 156, 159, 54, 165, 168, 57, 174, 177, 60, 183, 186, 63
Offset: 0

Views

Author

Mitch Harris, Jun 18 2005

Keywords

Examples

			G.f. = 3*x + 6*x^2 + 3*x^3 + 12*x^4 + 15*x^5 + 6*x^6 + 21*x^7 + 24*x^8 + ...
		

Crossrefs

Cf. A051176, A099837, A109007 (gcd(n,3)), A109042.

Programs

Formula

a(n) = 3*n/gcd(n,3) = 3*n/A109007(n).
From Bruno Berselli, Mar 11 2011: (Start)
G.f.: 3*x*(1+2*x+x^2+2*x^3+x^4)/(1-x^3)^2.
a(n) = 3*A051176(n);
a(n) = n*(7-2*A099837(n))/3 for n>0. (End)
From Wesley Ivan Hurt, Jul 24 2016: (Start)
a(n) = 2*a(n-3) - a(n-6) for n>5.
a(n) = 9*n/(5 + 4*cos(2*n*Pi/3)).
If n mod 3 = 0 then 3*floor(n/3), else 3*n. (End)
a(n) = n*(1 + 2*((n^2) mod 3)). - Timothy Hopper, Feb 23 2017
From Michael Somos, Mar 04 2017: (Start)
G.f.: 3 * x / (1 - x)^2 - 6 * x^3 / (1 - x^3)^2. -
a(n) = a(-n) for all n in Z. (End)
Sum_{k=1..n} a(k) ~ (7/6) * n^2. - Amiram Eldar, Nov 26 2022
Sum_{n>=1} (-1)^(n+1)/a(n) = 5*log(2)/9. - Amiram Eldar, Sep 08 2023

A109012 a(n) = gcd(n,9).

Original entry on oeis.org

9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1
Offset: 0

Views

Author

Keywords

Comments

Start with positive integer n. At each step, either (a) multiply by any positive integer or (b) remove all zeros from the number. a(n) is the smallest number that can be reached by this process. - David W. Wilson, Nov 01 2005
From Martin Fuller, Jul 09 2007: (Start)
Also the minimal positive difference between numbers whose digit sum is a multiple of n. Proof:
Construction: Pick a positive number that does not end with 9, and has a digit sum n-a(n). To form the lower number, append 9 until the digit sum is a multiple of n. This is always possible since the difference is gcd(n,9). Add a(n) to form the higher number, which will have digit sum n.
E.g., n=12: prefix=18, lower=18999, higher=19002, difference=3.
Minimality: All numbers are a multiple of a(n) if their digit sum is a multiple of n. Hence the minimal difference is at least a(n). (End)

Crossrefs

Programs

Formula

a(n) = 1 + 2*[3|n] + 6*[9|n], where [x|y] = 1 when x divides y, 0 otherwise.
a(n) = a(n-9).
Multiplicative with a(p^e, 9) = gcd(p^e, 9). - David W. Wilson, Jun 12 2005
G.f.: (-9 - x - x^2 - 3*x^3 - x^4 - x^5 - 3*x^6 - x^7 - x^8) / ((x-1)*(1 + x + x^2)*(x^6 + x^3 + 1)). - R. J. Mathar, Apr 04 2011
Dirichlet g.f.: (1+2/3^s+6/9^s)*zeta(s). - R. J. Mathar, Apr 04 2011

A178255 Decimal expansion of (3+sqrt(17))/2.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, May 24 2010

Keywords

Comments

Continued fraction expansion of (3+sqrt(17))/2 is A109007.
a(n) = A082486(n) for n > 1.
The rectangle R whose shape (i.e., length/width) is (3+sqrt(17))/2 can be partitioned into rectangles of shapes 3 and 3/2 in a manner that matches the periodic continued fraction [3, 3/2, 3, 3/2, ...]. R can also be partitioned into squares so as to match the periodic continued fraction [3, 1, 1, 3, 1, 1,...]. For details, see A188635. - Clark Kimberling, May 07 2011
The positive eigenvalue of the real symmetric 2 X 2 matrix M defined by M(i,j) = max(i,j) = [(1 2), (2 2)] is (3+sqrt(17))/2, while the negative one is (3-sqrt(17))/2. For a generalization, see A085984. - Bernard Schott, Apr 13 2020
A quadratic integer with minimal polynomial x^2 - 3x - 2. - Charles R Greathouse IV, Apr 14 2020
The positive root of x^2 - 3^x - 2. The negative root is -(-3 + sqrt(17))/2 = -0.56155... - Wolfdieter Lang, Dec 10 2022

Examples

			(3+sqrt(17))/2 = 3.56155281280883027491...
		

Crossrefs

Cf. A082486 (decimal expansion of (5+sqrt(17))/2), A010473 (decimal expansion of sqrt(17)), A109007 (repeat 3, 1, 1), A085984.

Programs

  • Mathematica
    FromContinuedFraction[{3, 3/2, {3, 3/2}}]
    ContinuedFraction[%, 100] (* [3,1,1,3,1,1,...] *)
    RealDigits[N[%%, 120]]    (* A178255 *)
    N[%%%, 40]
    (* Clark Kimberling, May 07 2011 *)
  • PARI
    (3+sqrt(17))/2 \\ Charles R Greathouse IV, Apr 14 2020
Showing 1-10 of 20 results. Next