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

A007310 Numbers congruent to 1 or 5 mod 6.

Original entry on oeis.org

1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35, 37, 41, 43, 47, 49, 53, 55, 59, 61, 65, 67, 71, 73, 77, 79, 83, 85, 89, 91, 95, 97, 101, 103, 107, 109, 113, 115, 119, 121, 125, 127, 131, 133, 137, 139, 143, 145, 149, 151, 155, 157, 161, 163, 167, 169, 173, 175
Offset: 1

Views

Author

C. Christofferson (Magpie56(AT)aol.com)

Keywords

Comments

Numbers n such that phi(4n) = phi(3n). - Benoit Cloitre, Aug 06 2003
Or, numbers relatively prime to 2 and 3, or coprime to 6, or having only prime factors >= 5; also known as 5-rough numbers. (Edited by M. F. Hasler, Nov 01 2014: merged with comments from Zak Seidov, Apr 26 2007 and Michael B. Porter, Oct 09 2009)
Apart from initial term(s), dimension of the space of weight 2n cuspidal newforms for Gamma_0( 38 ).
Numbers k such that k mod 2 = 1 and (k+1) mod 3 <> 1. - Klaus Brockhaus, Jun 15 2004
Also numbers n such that the sum of the squares of the first n integers is divisible by n, or A000330(n) = n*(n+1)*(2*n+1)/6 is divisible by n. - Alexander Adamchuk, Jan 04 2007
Numbers n such that the sum of squares of n consecutive integers is divisible by n, because A000330(m+n) - A000330(m) = n*(n+1)*(2*n+1)/6 + n*(m^2+n*m+m) is divisible by n independent of m. - Kaupo Palo, Dec 10 2016
A126759(a(n)) = n + 1. - Reinhard Zumkeller, Jun 16 2008
Terms of this sequence (starting from the second term) are equal to the result of the expression sqrt(4!*(k+1) + 1) - but only when this expression yields integral values (that is when the parameter k takes values, which are terms of A144065). - Alexander R. Povolotsky, Sep 09 2008
For n > 1: a(n) is prime if and only if A075743(n-2) = 1; a(2*n-1) = A016969(n-1), a(2*n) = A016921(n-1). - Reinhard Zumkeller, Oct 02 2008
A156543 is a subsequence. - Reinhard Zumkeller, Feb 10 2009
Numbers n such that ChebyshevT(x, x/2) is not an integer (is integer/2). - Artur Jasinski, Feb 13 2010
If 12*k + 1 is a perfect square (k = 0, 2, 4, 10, 14, 24, 30, 44, ... = A152749) then the square root of 12*k + 1 = a(n). - Gary Detlefs, Feb 22 2010
A089128(a(n)) = 1. Complement of A047229(n+1) for n >= 1. See A164576 for corresponding values A175485(a(n)). - Jaroslav Krizek, May 28 2010
Cf. property described by Gary Detlefs in A113801 and in Comment: more generally, these numbers are of the form (2*h*n+(h-4)*(-1)^n-h)/4 (with h, n natural numbers), therefore ((2*h*n+(h-4)*(-1)^n-h)/4)^2-1 == 0 (mod h); in this case, a(n)^2 - 1 == 0 (mod 6). Also a(n)^2 - 1 == 0 (mod 12). - Bruno Berselli, Nov 05 2010 - Nov 17 2010
Numbers n such that ( Sum_{k = 1..n} k^14 ) mod n = 0. (Conjectured) - Gary Detlefs, Dec 27 2011
From Peter Bala, May 02 2018: (Start)
The above conjecture is true. Apply Ireland and Rosen, Proposition 15.2.2. with m = 14 to obtain the congruence 6*( Sum_{k = 1..n} k^14 )/n = 7 (mod n), true for all n >= 1. Suppose n is coprime to 6, then 6 is a unit in Z/nZ, and it follows from the congruence that ( Sum_{k = 1..n} k^14 )/n is an integer. On the other hand, if either 2 divides n or 3 divides n then the congruence shows that ( Sum_{k = 1..n} k^14 )/n cannot be integral. (End)
A126759(a(n)) = n and A126759(m) < n for m < a(n). - Reinhard Zumkeller, May 23 2013
(a(n-1)^2 - 1)/24 = A001318(n), the generalized pentagonal numbers. - Richard R. Forberg, May 30 2013
Numbers k for which A001580(k) is divisible by 3. - Bruno Berselli, Jun 18 2014
Numbers n such that sigma(n) + sigma(2n) = sigma(3n). - Jahangeer Kholdi and Farideh Firoozbakht, Aug 15 2014
a(n) are values of k such that Sum_{m = 1..k-1} m*(k-m)/k is an integer. Sums for those k are given by A062717. Also see Detlefs formula below based on A062717. - Richard R. Forberg, Feb 16 2015
a(n) are exactly those positive integers m such that the sequence b(n) = n*(n + m)*(n + 2*m)/6 is integral, and also such that the sequence c(n) = n*(n + m)*(n + 2*m)*(n + 3*m)/24 is integral. Cf. A007775. - Peter Bala, Nov 13 2015
Along with 2, these are the numbers k such that the k-th Fibonacci number is coprime to every Lucas number. - Clark Kimberling, Jun 21 2016
This sequence is the Engel expansion of 1F2(1; 5/6, 7/6; 1/36) + 1F2(1; 7/6, 11/6; 1/36)/5. - Benedict W. J. Irwin, Dec 16 2016
The sequence a(n), n >= 4 is generated by the successor of the pair of polygonal numbers {P_s(4) + 1, P_(2*s - 1)(3) + 1}, s >= 3. - Ralf Steiner, May 25 2018
The asymptotic density of this sequence is 1/3. - Amiram Eldar, Oct 18 2020
Also, the only vertices in the odd Collatz tree A088975 that are branch values to other odd nodes t == 1 (mod 2) of A005408. - Heinz Ebert, Apr 14 2021
From Flávio V. Fernandes, Aug 01 2021: (Start)
For any two terms j and k, the product j*k is also a term (the same property as p^n and smooth numbers).
From a(2) to a(phi(A033845(n))), or a((A033845(n))/3), the terms are the totatives of the A033845(n) itself. (End)
Also orders n for which cyclic and semicyclic diagonal Latin squares exist (see A123565 and A342990). - Eduard I. Vatutin, Jul 11 2023
If k is in the sequence, then k*2^m + 3 is also in the sequence, for all m > 0. - Jules Beauchamp, Aug 29 2024

Examples

			G.f. = x + 5*x^2 + 7*x^3 + 11*x^4 + 13*x^5 + 17*x^6 + 19*x^7 + 23*x^8 + ...
		

References

  • K. Ireland and M. Rosen, A Classical Introduction to Modern Number Theory, Springer-Verlag, 1980.

Crossrefs

A005408 \ A016945. Union of A016921 and A016969; union of A038509 and A140475. Essentially the same as A038179. Complement of A047229. Subsequence of A186422.
Cf. A000330, A001580, A002194, A019670, A032528 (partial sums), A038509 (subsequence of composites), A047209, A047336, A047522, A056020, A084967, A090771, A091998, A144065, A175885-A175887.
For k-rough numbers with other values of k, see A000027, A005408, A007775, A008364-A008366, A166061, A166063.
Cf. A126760 (a left inverse).
Row 3 of A260717 (without the initial 1).
Cf. A105397 (first differences).

Programs

Formula

a(n) = (6*n + (-1)^n - 3)/2. - Antonio Esposito, Jan 18 2002
a(n) = a(n-1) + a(n-2) - a(n-3), n >= 4. - Roger L. Bagula
a(n) = 3*n - 1 - (n mod 2). - Zak Seidov, Jan 18 2006
a(1) = 1 then alternatively add 4 and 2. a(1) = 1, a(n) = a(n-1) + 3 + (-1)^n. - Zak Seidov, Mar 25 2006
1 + 1/5^2 + 1/7^2 + 1/11^2 + ... = Pi^2/9 [Jolley]. - Gary W. Adamson, Dec 20 2006
For n >= 3 a(n) = a(n-2) + 6. - Zak Seidov, Apr 18 2007
From R. J. Mathar, May 23 2008: (Start)
Expand (x+x^5)/(1-x^6) = x + x^5 + x^7 + x^11 + x^13 + ...
O.g.f.: x*(1+4*x+x^2)/((1+x)*(1-x)^2). (End)
a(n) = 6*floor(n/2) - 1 + 2*(n mod 2). - Reinhard Zumkeller, Oct 02 2008
1 + 1/5 - 1/7 - 1/11 + + - - ... = Pi/3 = A019670 [Jolley eq (315)]. - Jaume Oliver Lafont, Oct 23 2009
a(n) = ( 6*A062717(n)+1 )^(1/2). - Gary Detlefs, Feb 22 2010
a(n) = 6*A000217(n-1) + 1 - 2*Sum_{i=1..n-1} a(i), with n > 1. - Bruno Berselli, Nov 05 2010
a(n) = 6*n - a(n-1) - 6 for n>1, a(1) = 1. - Vincenzo Librandi, Nov 18 2010
Sum_{n >= 1} (-1)^(n+1)/a(n) = A093766 [Jolley eq (84)]. - R. J. Mathar, Mar 24 2011
a(n) = 6*floor(n/2) + (-1)^(n+1). - Gary Detlefs, Dec 29 2011
a(n) = 3*n + ((n+1) mod 2) - 2. - Gary Detlefs, Jan 08 2012
a(n) = 2*n + 1 + 2*floor((n-2)/2) = 2*n - 1 + 2*floor(n/2), leading to the o.g.f. given by R. J. Mathar above. - Wolfdieter Lang, Jan 20 2012
1 - 1/5 + 1/7 - 1/11 + - ... = Pi*sqrt(3)/6 = A093766 (L. Euler). - Philippe Deléham, Mar 09 2013
1 - 1/5^3 + 1/7^3 - 1/11^3 + - ... = Pi^3*sqrt(3)/54 (L. Euler). - Philippe Deléham, Mar 09 2013
gcd(a(n), 6) = 1. - Reinhard Zumkeller, Nov 14 2013
a(n) = sqrt(6*n*(3*n + (-1)^n - 3)-3*(-1)^n + 5)/sqrt(2). - Alexander R. Povolotsky, May 16 2014
a(n) = 3*n + 6/(9*n mod 6 - 6). - Mikk Heidemaa, Feb 05 2016
From Mikk Heidemaa, Feb 11 2016: (Start)
a(n) = 2*floor(3*n/2) - 1.
a(n) = A047238(n+1) - 1. (suggested by Michel Marcus) (End)
E.g.f.: (2 + (6*x - 3)*exp(x) + exp(-x))/2. - Ilya Gutkovskiy, Jun 18 2016
From Bruno Berselli, Apr 27 2017: (Start)
a(k*n) = k*a(n) + (4*k + (-1)^k - 3)/2 for k>0 and odd n, a(k*n) = k*a(n) + k - 1 for even n. Some special cases:
k=2: a(2*n) = 2*a(n) + 3 for odd n, a(2*n) = 2*a(n) + 1 for even n;
k=3: a(3*n) = 3*a(n) + 4 for odd n, a(3*n) = 3*a(n) + 2 for even n;
k=4: a(4*n) = 4*a(n) + 7 for odd n, a(4*n) = 4*a(n) + 3 for even n;
k=5: a(5*n) = 5*a(n) + 8 for odd n, a(5*n) = 5*a(n) + 4 for even n, etc. (End)
From Antti Karttunen, May 20 2017: (Start)
a(A273669(n)) = 5*a(n) = A084967(n).
a((5*n)-3) = A255413(n).
A126760(a(n)) = n. (End)
a(2*m) = 6*m - 1, m >= 1; a(2*m + 1) = 6*m + 1, m >= 0. - Ralf Steiner, May 17 2018
From Amiram Eldar, Nov 22 2024: (Start)
Product_{n>=1} (1 - (-1)^n/a(n)) = sqrt(3) (A002194).
Product_{n>=2} (1 + (-1)^n/a(n)) = Pi/3 (A019670). (End)

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

A047229 Numbers that are congruent to {0, 2, 3, 4} mod 6.

Original entry on oeis.org

0, 2, 3, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 26, 27, 28, 30, 32, 33, 34, 36, 38, 39, 40, 42, 44, 45, 46, 48, 50, 51, 52, 54, 56, 57, 58, 60, 62, 63, 64, 66, 68, 69, 70, 72, 74, 75, 76, 78, 80, 81, 82, 84
Offset: 1

Views

Author

Keywords

Comments

Appears to be the sequence of n such that n never divides 3^x-2^x for x>=0. - Benoit Cloitre, Aug 19 2002
Numbers divisible by 2 or 3. - Nick Hobson, Mar 13 2007
Numbers k such that average of squares of the first k positive integers is not integer. A089128(a(n)) > 1. For n >= 2, a(n) = complement of A007310. - Jaroslav Krizek, May 28 2010
Numbers k such that k*Fibonacci(k) is even. - Gary Detlefs, Oct 27 2011
Also numbers that have a divisor d with 2^1 <= d < 2^2 (see Ei definition p. 340 in Besicovitch article). - Michel Marcus, Oct 31 2013
Starting with 0, 2, a(n) is the smallest number greater than a(n-1) that is not relatively prime to a(n-2). - Franklin T. Adams-Watters, Dec 04 2014

Crossrefs

Cf. A007310 (complement).
Union of A005843 and A008585.

Programs

  • Haskell
    a047229 n = a047229_list !! (n-1)
    a047229_list = filter ((`notElem` [1,5]) . (`mod` 6)) [0..]
    -- Reinhard Zumkeller, Jun 30 2012
    
  • Magma
    [ n : n in [0..150] | n mod 6 in [0, 2, 3, 4]] ; // Vincenzo Librandi, Jun 01 2011
    
  • Mathematica
    Select[Range[0,100],MemberQ[{0,2,3,4},Mod[#,6]]&] (* Harvey P. Dale, Aug 15 2011 *)
    a[ n_] := With[ {m = n - 1}, {2, 3, 4, 0}[[Mod[m, 4, 1]]] + Quotient[ m, 4] 6]; (* Michael Somos, Oct 05 2015 *)
  • PARI
    a(n)=(n-1)\4*6+[4,0,2,3][n%4+1] \\ Charles R Greathouse IV, Oct 28 2011
    
  • Python
    def A047229(n): return 3*(n-1>>1&-2)+(4,0,2,3)[n&3] # Chai Wah Wu, Nov 18 2024

Formula

a(n) = (6*(n-1) - (1+(-1)^n)*(-1)^(n*(1+(-1)^n)/4))/4; also a(n) = (6*(n-1) - (-i)^n - i^n)/4, where i is the imaginary unit. - Bruno Berselli, Nov 08 2010
G.f.: x^2*(2-x+2*x^2) / ( (x^2+1)*(x-1)^2 ). - R. J. Mathar, Oct 08 2011
a(n) = floor((6*n-5)/4) + floor((1/2)*cos((n+2)*Pi/2) + 1/2). - Gary Detlefs, Oct 28 2011 and corrected by Aleksey A. Solomein, Feb 08 2016
a(n) = a(n-1) + a(n-4) - a(n-5), n>4. - Gionata Neri, Apr 15 2015
a(n) = -a(2-n) for all n in Z. - Michael Somos, Oct 05 2015
a(n) = n + 2*floor((n-2)/4) + floor(f(n+2)/3), where f(n) = n mod 4. - Aleksey A. Solomein, Feb 08 2016
a(n) = (3*n - 3 - cos(n*Pi/2))/2. - Wesley Ivan Hurt, Oct 02 2017
Equals {0} union {A003586(j) * A007310(k) for j>1 and k>0}. - Flávio V. Fernandes, Jul 21 2021
Sum_{n>=2} (-1)^n/a(n) = log(3)/2 - log(2)/3. - Amiram Eldar, Dec 12 2021

A085099 Least natural number k such that k^2 + n is prime.

Original entry on oeis.org

1, 1, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 4, 1, 6, 7, 2, 9, 2, 1, 12, 1, 4, 3, 2, 3, 6, 1, 2, 3, 2, 1, 24, 1, 2, 3, 4, 1, 6, 5, 2, 3, 4, 1, 6, 5, 2, 9, 2, 1, 18, 1, 6, 3, 2, 3, 6, 1, 2, 9, 2, 1, 6, 1, 4, 3, 2, 5, 6, 1, 2, 3, 4, 1, 12, 5, 2
Offset: 1

Views

Author

Jason Earls, Aug 10 2003

Keywords

Comments

First values of k and n such that k > 100 are: k=114, n=6041; for k > 200: k=210, n=26171; for k > 300: k=357, n=218084; for k > 400: k=402, n=576239.
Additionally, for k > 500: k=585, n=3569114; for k > 600: k=630, n=3802301; for k > 700: k=744, n=24307841; for k > 800: k=855, n=25051934; for k > 900: k=1008, n=54168539. Other cases k > 900: k=945, n=74380946, k=915, n=89992964, k=939, n=118991066. - Zak Seidov, May 23 2007
It is easily proved that for n > 2, a(n) >= A089128(n+1). The first inequality is a(21) = 4. - Franklin T. Adams-Watters, May 16 2018

Crossrefs

Programs

  • Maple
    a:= proc(n) local d, t; d, t:= 1, n+1; while not
          isprime(t) do d:= d+2; t:= t+d od; (d+1)/2
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 04 2019
  • Mathematica
    Table[i = 1; While[! PrimeQ[i^2 + n], i++]; i, {n, 85}] (* Jayanta Basu, Apr 24 2013 *)
  • PARI
    a(n)=my(k); while(!isprime(k++^2+n),); k \\ Charles R Greathouse IV, Jul 17 2016

Formula

a(n) = sqrt(A059843(n) - n). - Zak Seidov, Nov 24 2011

A171182 Period 6: repeat [0, 1, 1, 1, 0, 2].

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Dec 04 2009, Dec 07 2009

Keywords

Comments

The number of divisors d of n of the form d=2 or 3. - Vladimir Shevelev, May 21 2010
a(n) = s(n+6), where s(k) is the number of partitions of k into distinct parts such that max(p) = 2 + min(p) for k >= 1, and (s(0)..s(6)) = (0,0,0,0,1,0,2). - Clark Kimberling, Apr 15 2014
Number of r X s integer-sided rectangles such that r < s, r + s = 2n, r | s and (s - r)/2 | s. - Wesley Ivan Hurt, Apr 24 2020
Number of positive integer solutions, (r,s,t), of the equation r^2 + t*s^2 = (n + 6)^2, where r + s = n + 6 and t < r <= s. For example, when n=6 we have the two solutions (4,8,2) and (6,6,3) since 4^2 + 2*8^2 = 12^2 and 6^2 + 3*6^2 = 12^2. - Wesley Ivan Hurt, Oct 04 2020

Crossrefs

Cf. A178142. - Vladimir Shevelev, May 21 2010
Cf. A115357.
Number of distinct prime factors <= p: this sequence (p=3), A178146 (p=5), A210679 (p=7).

Programs

Formula

a(n) = A115357(n-2) for n>1. - R. J. Mathar, Dec 09 2009
a(2) = 1, a(3) = 1, a(5) = 0, otherwise a(n) = a(n-2) + a(n-3) - a(n-5), where we put a(n) = 0, if n<0. - Vladimir Shevelev, May 21 2010
a(n) = floor(((n+1) mod 6)/3) + 2*floor(((n+5) mod 6)/5). - Gary Detlefs, Feb 15 2014
From Wesley Ivan Hurt, Aug 27 2014: (Start)
G.f.: (2+2*x+x^2)/(1+x-x^3-x^4).
a(n) + a(n-1) = a(n-3) + a(n-4) for n>4.
a(n) = (1 + floor((n-3)^2/2)) mod 3. (End)
a(n) = (5 + 3*cos(n*Pi) + 4*cos(2*n*Pi/3))/6. - Wesley Ivan Hurt, Jun 19 2016
From Amiram Eldar, Sep 16 2023: (Start)
Additive with a(p^e) = 1 if p <= 3, and 0 otherwise.
a(n) = A059841(n) + A079978(n).
a(n) = A001221(A089128(n)).
a(n) = A001221(A065331(n)). (End)

Extensions

Edited by Charles R Greathouse IV, Mar 23 2010

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)

A109047 a(n) = lcm(n, 6).

Original entry on oeis.org

0, 6, 6, 6, 12, 30, 6, 42, 24, 18, 30, 66, 12, 78, 42, 30, 48, 102, 18, 114, 60, 42, 66, 138, 24, 150, 78, 54, 84, 174, 30, 186, 96, 66, 102, 210, 36, 222, 114, 78, 120, 246, 42, 258, 132, 90, 138, 282, 48, 294, 150, 102, 156, 318, 54, 330, 168, 114, 174, 354
Offset: 0

Views

Author

Mitch Harris, Jun 18 2005

Keywords

Crossrefs

Programs

Formula

a(n) = n*6/gcd(n, 6).
From R. J. Mathar, Apr 18 2011: (Start)
a(n) = 2*a(n-6) - a(n-12) = 6*A060789(n) = 6*n/A089128(n).
G.f.: 6*x*(1+x+x^2+2*x^3+5*x^4+x^5+5*x^6+2*x^7+x^8+x^9+x^10) / ( (x-1)^2*(1+x)^2*(1+x+x^2)^2*(x^2-x+1)^2 ). (End)
Sum_{k=1..n} a(k) ~ (7/4) * n^2. - Amiram Eldar, Nov 26 2022

A175485 Numerators of averages of squares of the first n positive integers.

Original entry on oeis.org

1, 5, 14, 15, 11, 91, 20, 51, 95, 77, 46, 325, 63, 145, 248, 187, 105, 703, 130, 287, 473, 345, 188, 1225, 221, 477, 770, 551, 295, 1891, 336, 715, 1139, 805, 426, 2701, 475, 1001, 1580, 1107, 581, 3655, 638, 1335, 2093, 1457, 760, 4753, 825, 1717, 2678
Offset: 1

Views

Author

Jaroslav Krizek, May 27 2010

Keywords

Comments

See A089128(n) for n >= 1 - denominators of averages of squares of the first n positive integers.
Sqrt (a(n) / A089128(n)) for n >= 1 is harmonic mean of the first n positive integers.
For n = 337 holds: a(n) is square (= 38025 = 195^2) and simultaneously A089128(n) = 1, i.e. number k = 195 is quadratic mean (root mean square) of first 337 positive integers. There are other such numbers - see A084231 and A084232.

Examples

			a(10) = 11*21*2 / 6 = 77.
		

Crossrefs

Cf. A089128 (denominators), A000330, A089128.

Programs

  • Mathematica
    Module[{nn=60,sqs},sqs=Range[nn]^2;Table[Numerator[Mean[Take[sqs,n]]],{n,nn}]] (* Harvey P. Dale, Nov 06 2021 *)
  • PARI
    a(n)=(n+1)*(2*n+1)*gcd(n,6)/6 \\ Ralf Stephan, Sep 20 2013

Formula

a(n) = A000330(n) * A089128 / n = (n+1) * (2n+1) * GCD(6, n) / 6 for n >= 1.
G.f.: (x^17 + x^15 + 5*x^14 + 7*x^13 + 6*x^12 + 52*x^11 + 13*x^10 + 32*x^9 + 53*x^8 + 36*x^7 + 17*x^6 + 91*x^5 + 11*x^4 + 15*x^3 + 14*x^2 + 5*x + 1)/(1-x^6)^3. - Ralf Stephan, Sep 20 2013
Sum_{k=1..n} a(k) ~ (5/18)*n^3. - Amiram Eldar, Oct 07 2023

Extensions

More terms from Ralf Stephan, Sep 20 2013
Showing 1-10 of 18 results. Next