A007310 Numbers congruent to 1 or 5 mod 6.
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
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.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Andreas Enge, William Hart, and Fredrik Johansson, Short addition sequences for theta functions, arXiv:1608.06810 [math.NT], 2016-2018.
- B. W. J. Irwin, Constants Whose Engel Expansions are the k-rough Numbers.
- L. B. W. Jolley, Summation of Series, Dover, 1961
- Cedric A. B. Smith, Prime factors and recurring duodecimals, Math. Gaz. 59 (408) (1975) 106-109.
- William A. Stein's The Modular Forms Database, PARI-readable dimension tables for Gamma_0(N).
- Eric Weisstein's World of Mathematics, Rough Number.
- Eric Weisstein's World of Mathematics, Pi Formulas. [_Jaume Oliver Lafont_, Oct 23 2009]
- Index entries for sequences related to smooth numbers [_Michael B. Porter_, Oct 09 2009]
- Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
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
-
GAP
Filtered([1..150],n->n mod 6=1 or n mod 6=5); # Muniru A Asiru, Dec 19 2018
-
Haskell
a007310 n = a007310_list !! (n-1) a007310_list = 1 : 5 : map (+ 6) a007310_list -- Reinhard Zumkeller, Jan 07 2012
-
Magma
[n: n in [1..250] | n mod 6 in [1, 5]]; // Vincenzo Librandi, Feb 12 2016
-
Maple
seq(seq(6*i+j,j=[1,5]),i=0..100); # Robert Israel, Sep 08 2014
-
Mathematica
Select[Range[200], MemberQ[{1, 5}, Mod[#, 6]] &] (* Harvey P. Dale, Aug 27 2013 *) a[n_] := (6 n + (-1)^n - 3)/2; a[rem156, 60] (* Robert G. Wilson v, May 26 2014 from a suggestion by N. J. A. Sloane *) Flatten[Table[6n + {1, 5}, {n, 0, 24}]] (* Alonso del Arte, Feb 06 2016 *) Table[2*Floor[3*n/2] - 1, {n, 1000}] (* Mikk Heidemaa, Feb 11 2016 *)
-
PARI
isA007310(n) = gcd(n,6)==1 \\ Michael B. Porter, Oct 09 2009
-
PARI
A007310(n)=n\2*6-(-1)^n \\ M. F. Hasler, Oct 31 2014
-
PARI
\\ given an element from the sequence, find the next term in the sequence. nxt(n) = n + 9/2 - (n%6)/2 \\ David A. Corneth, Nov 01 2016
-
Python
def A007310(n): return (n+(n>>1)<<1)-1 # Chai Wah Wu, Oct 10 2023
-
Sage
[i for i in range(150) if gcd(6,i) == 1] # Zerinvary Lajos, Apr 21 2009
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((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)
Comments