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

A045331 Primes congruent to {1, 2, 3} mod 6; or, -3 is a square mod p.

Original entry on oeis.org

2, 3, 7, 13, 19, 31, 37, 43, 61, 67, 73, 79, 97, 103, 109, 127, 139, 151, 157, 163, 181, 193, 199, 211, 223, 229, 241, 271, 277, 283, 307, 313, 331, 337, 349, 367, 373, 379, 397, 409, 421, 433, 439, 457, 463, 487, 499, 523, 541, 547, 571, 577, 601, 607, 613
Offset: 1

Views

Author

Keywords

Comments

-3 is a quadratic residue mod a prime p iff p is in this sequence.

Crossrefs

Apart from initial term, same as A007645; apart from initial two terms, same as A002476.
Subsequence of A047246.

Programs

  • Haskell
    a045331 n = a045331_list !! (n-1)
    a045331_list = filter ((< 4) . (`mod` 6)) a000040_list
    -- Reinhard Zumkeller, Jan 15 2013
  • Magma
    [p: p in PrimesUpTo(700) | p mod 6 in [1, 2, 3]]; // Vincenzo Librandi, Aug 08 2012
    
  • Mathematica
    Select[Prime[Range[200]],MemberQ[{1,2,3},Mod[#,6]]&]  (* Harvey P. Dale, Mar 31 2011 *)
    Join[{2,3},Select[Range[7,10^3,6],PrimeQ]] (* Zak Seidov, May 20 2011 *)
  • PARI
    select(n->n%6<5,primes(100)) \\ Charles R Greathouse IV, May 20 2011
    

Extensions

More terms from Henry Bottomley, Aug 10 2000

A047257 Numbers that are congruent to {4, 5} mod 6.

Original entry on oeis.org

4, 5, 10, 11, 16, 17, 22, 23, 28, 29, 34, 35, 40, 41, 46, 47, 52, 53, 58, 59, 64, 65, 70, 71, 76, 77, 82, 83, 88, 89, 94, 95, 100, 101, 106, 107, 112, 113, 118, 119, 124, 125, 130, 131, 136, 137, 142, 143, 148, 149
Offset: 1

Views

Author

Keywords

Comments

Equivalently, numbers m such that 2^m - m is divisible by 3. Indeed, for every prime p, there are infinitely many numbers m such that 2^m - m (A000325) is divisible by p, here are numbers m corresponding to p = 3. - Bernard Schott, Dec 10 2021
Numbers k for which A276076(k) and A276086(k) are multiples of nine. For a simple proof, consider the penultimate digit in the factorial and primorial base expansions of n, A007623 and A049345. - Antti Karttunen, Feb 08 2024

References

  • Michael Doob, The Canadian Mathematical Olympiad & L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society & Société Mathématique du Canada, Problem 4, 1983, page 158, 1993.

Crossrefs

Cf. A000325.
Similar with: A299174 (p = 2), this sequence (p = 3), A349767 (p = 5).

Programs

Formula

a(n) = 4 + 6*floor(n/2) + n mod 2.
a(n) = 6*n-a(n-1)-3, with a(1)=4. - Vincenzo Librandi, Aug 05 2010
G.f.: ( x*(4+x+x^2) ) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Oct 08 2011
a(n) = 3*n - (-1)^n. - Wesley Ivan Hurt, Mar 20 2015
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/(6*sqrt(3)) - log(2)/3. - Amiram Eldar, Dec 14 2021
E.g.f.: 1 + 3*x*exp(x) - exp(-x). - David Lovler, Aug 25 2022

A047247 Numbers that are congruent to {2, 3, 4, 5} (mod 6).

Original entry on oeis.org

2, 3, 4, 5, 8, 9, 10, 11, 14, 15, 16, 17, 20, 21, 22, 23, 26, 27, 28, 29, 32, 33, 34, 35, 38, 39, 40, 41, 44, 45, 46, 47, 50, 51, 52, 53, 56, 57, 58, 59, 62, 63, 64, 65, 68, 69, 70, 71, 74, 75, 76, 77, 80, 81, 82, 83, 86, 87, 88, 89, 92, 93, 94, 95, 98, 99
Offset: 1

Views

Author

Keywords

Comments

The sequence is the interleaving of A047235 with A047270. - Guenther Schrack, Feb 10 2019
Numbers k for which A276076(k) and A276086(k) are multiples of three. For a simple proof, consider the penultimate digit in the factorial and primorial base expansions of n, A007623 and A049345. - Antti Karttunen, Feb 08 2024

Crossrefs

Programs

  • Magma
    [n : n in [0..100] | n mod 6 in [2, 3, 4, 5]]; // Wesley Ivan Hurt, May 21 2016
    
  • Maple
    A047247:=n->(6*n-1-I^(2*n)-(1-I)*I^(-n)-(1+I)*I^n)/4: seq(A047247(n), n=1..100); # Wesley Ivan Hurt, May 21 2016
  • Mathematica
    Table[(6n-1-I^(2n)-(1-I)*I^(-n)-(1+I)*I^n)/4, {n, 80}] (* Wesley Ivan Hurt, May 21 2016 *)
    LinearRecurrence[{1,0,0,1,-1},{2,3,4,5,8},70] (* Harvey P. Dale, May 25 2024 *)
  • PARI
    my(x='x+O('x^70)); Vec(x*(2+x+x^2+x^3+x^4)/((1-x)*(1-x^4))) \\ G. C. Greubel, Feb 16 2019
    
  • Sage
    a=(x*(2+x+x^2+x^3+x^4)/((1-x)*(1-x^4))).series(x, 72).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 16 2019

Formula

G.f.: x*(2+x+x^2+x^3+x^4) / ( (1+x)*(1+x^2)*(1-x)^2 ). - R. J. Mathar, Oct 08 2011
From Wesley Ivan Hurt, May 21 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (6*n - 1 - i^(2*n) - (1-i)*i^(-n) - (1+i)*i^n)/4 where i = sqrt(-1).
a(2*n) = A047270(n), a(2*n-1) = A047235(n).
a(n) = A047227(n) + 1, a(1-n) = - A047227(n). (End)
From Guenther Schrack, Feb 10 2019: (Start)
a(n) = (6*n - 1 - (-1)^n -2*(-1)^(n*(n+1)/2))/4.
a(n) = a(n-4) + 6, a(1)=2, a(2)=3, a(3)=4, a(4)=5, for n > 4.
a(n) = A047227(n) + 1. a(n) = A047246(n) + 2. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(3)*Pi/12 - 2*log(2)/3 + log(3)/4. - Amiram Eldar, Dec 17 2021

Extensions

More terms from Wesley Ivan Hurt, May 21 2016

A047227 Numbers that are congruent to {1, 2, 3, 4} mod 6.

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 9, 10, 13, 14, 15, 16, 19, 20, 21, 22, 25, 26, 27, 28, 31, 32, 33, 34, 37, 38, 39, 40, 43, 44, 45, 46, 49, 50, 51, 52, 55, 56, 57, 58, 61, 62, 63, 64, 67, 68, 69, 70, 73, 74, 75, 76, 79, 80, 81, 82, 85, 86, 87, 88, 91, 92, 93, 94, 97, 98
Offset: 1

Views

Author

Keywords

Comments

a(k)^m is a term for k and m in N. - Jerzy R Borysowicz, Apr 18 2023

Crossrefs

Complement of A047264. Equals A203016 divided by 3.

Programs

  • Magma
    [n: n in [0..100] | n mod 6 in [1..4]]; // Vincenzo Librandi, Jan 06 2013
    
  • Maple
    A047227:=n->(6*n-5-I^(2*n)+(1+I)*I^(1-n)+(1-I)*I^(n-1))/4: seq(A047227(n), n=1..100); # Wesley Ivan Hurt, May 20 2016
  • Mathematica
    Complement[Range[100], Flatten[Table[{6n - 1, 6n}, {n, 0, 15}]]] (* Alonso del Arte, Jul 07 2011 *)
    Select[Range[100], MemberQ[{1, 2, 3, 4}, Mod[#, 6]]&] (* Vincenzo Librandi, Jan 06 2013 *)
  • PARI
    a(n)=([0,1,0,0,0; 0,0,1,0,0; 0,0,0,1,0; 0,0,0,0,1; -1,1,0,0,1]^(n-1)*[1;2;3;4;7])[1,1] \\ Charles R Greathouse IV, May 03 2023

Formula

From Johannes W. Meijer, Jul 07 2011: (Start)
a(n) = floor((n+2)/4) + floor((n+1)/4) + floor(n/4) + 2*floor((n-1)/4) + floor((n+3)/4).
G.f.: x*(1 + x + x^2 + x^3 + 2*x^4)/(x^5 - x^4 - x + 1). (End)
From Wesley Ivan Hurt, May 20 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (6n - 5 - i^(2n) + (1+i)*i^(1-n) + (1-i)*i^(n-1))/4 where i=sqrt(-1).
a(2n) = A047235(n), a(2n-1) = A047241(n). (End)
E.g.f.: (4 + sin(x) - cos(x) + (3*x - 2)*sinh(x) + 3*(x - 1)*cosh(x))/2. - Ilya Gutkovskiy, May 21 2016
From Wesley Ivan Hurt, May 21 2016: (Start)
a(n) = A047246(n) + 1.
a(n+2) - a(n+1) = A093148(n) for n>0.
a(1-n) = - A047247(n). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(3)*Pi/12 + 2*log(2)/3 - log(3)/4. - Amiram Eldar, Dec 17 2021

A047250 Numbers that are congruent to {0, 3, 4, 5} (mod 6).

Original entry on oeis.org

0, 3, 4, 5, 6, 9, 10, 11, 12, 15, 16, 17, 18, 21, 22, 23, 24, 27, 28, 29, 30, 33, 34, 35, 36, 39, 40, 41, 42, 45, 46, 47, 48, 51, 52, 53, 54, 57, 58, 59, 60, 63, 64, 65, 66, 69, 70, 71, 72, 75, 76, 77, 78, 81, 82, 83, 84, 87, 88, 89, 90, 93, 94, 95, 96, 99
Offset: 1

Views

Author

Keywords

Comments

The sequence is the interleaving of A047233 with A047270. - Guenther Schrack, Feb 15 2019

Crossrefs

Complement: A047239.

Programs

  • Magma
    [n : n in [0..150] | n mod 6 in [0, 3, 4, 5]]; // Wesley Ivan Hurt, Jun 02 2016
    
  • Maple
    A047250:=n->(6*n-3+I^(2*n)-(1+I)*I^(-n)-(1-I)*I^n)/4: seq(A047250(n), n=1..100); # Wesley Ivan Hurt, Jun 02 2016
  • Mathematica
    Select[Range[0,100], MemberQ[{0,3,4,5}, Mod[#,6]]&] (* or *) LinearRecurrence[{1,0,0,1,-1}, {0,3,4,5,6}, 60] (* Harvey P. Dale, Apr 01 2013 *)
  • PARI
    my(x='x+O('x^70)); concat([0], Vec(x^2*(3+x+x^2+x^3)/((1+x)*(1+x^2)*(1-x)^2))) \\ G. C. Greubel, Feb 16 2019
    
  • Sage
    a=(x^2*(3+x+x^2+x^3)/((1+x)*(1+x^2)*(1-x)^2)).series(x, 72).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 16 2019

Formula

G.f.: x^2*(3+x+x^2+x^3)/((1+x)*(1+x^2)*(1-x)^2). - R. J. Mathar, Oct 08 2011
From Wesley Ivan Hurt, Jun 02 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (6*n - 3 + i^(2*n) - (1+i)*i^(-n) - (1-i)*i^n)/4 where i=sqrt(-1).
a(2*k) = A047270(k), a(2*k-1) = A047233(k). (End)
E.g.f.: (2 - sin(x) - cos(x) + (3*x - 2)*sinh(x) + (3*x - 1)*cosh(x))/2. - Ilya Gutkovskiy, Jun 02 2016
From Guenther Schrack, Feb 15 2019: (Start)
a(n) = (6*n - 3 + (-1)^n - 2*(-1)^(n*(n-1)/2))/4.
a(n) = a(n-4) + 6, a(1)=0, a(2)=3, a(3)=4, a(4)=5, for n > 4.
a(-n) = -A047246(n+2). (End)
Sum_{n>=2} (-1)^n/a(n) = 2*log(2)/3 - Pi/(6*sqrt(3)). - Amiram Eldar, Dec 17 2021

A272574 a(n) = f(9, f(8, n)), where f(k,m) = floor(m*k/(k-1)).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 41, 42, 45, 46, 47, 48, 49, 50, 51, 54, 55, 56, 57, 58, 59, 60, 63, 64, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 77, 78, 81, 82, 83, 84, 85, 86, 87, 90
Offset: 0

Views

Author

Bruno Berselli, May 03 2016

Keywords

Comments

Also, numbers that are congruent to {0..6} mod 9.
The initial terms coincide with those of A037475 and A039111. First disagreement is after 60 (index 48): a(49) = 63, A037475(49) = 81 and A039111(50) = 71.

Crossrefs

Cf. A248375: f(9,n).
Cf. similar sequences with the formula f(k, f(k-1, n)): A008585 (k=3), A042948 (k=4), A047217 (k=5), A047246 (k=6), A047337 (k=7), A047602 (k=8), this sequence (k=9), A272576 (k=10).

Programs

  • Magma
    k:=9; f:=func; [f(k,f(k-1,n)): n in [0..70]];
    
  • Maple
    f := (k, m) -> floor(m*k/(k-1)):
    a := n -> f(9, f(8, n)):
    seq(a(n), n = 0..70); # Peter Luschny, May 03 2016
  • Mathematica
    f[k_, m_] := Floor[m*k/(k-1)];
    a[n_] := f[9, f[8, n]];
    Table[a[n], {n, 0, 70}] (* Jean-François Alcover, May 09 2016 *)
    CoefficientList[Series[x (1 + x + x^2 + x^3 + x^4 + x^5 + 3 x^6)/((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)), {x, 0, 70}], x] (* or *)
    Table[(63 n - 12 - 12 Mod[n, 7] + 2 Mod[-n - 1, 7])/49, {n, 0, 70}] (* Michael De Vlieger, Dec 25 2016 *)
    LinearRecurrence[{1,0,0,0,0,0,1,-1},{0,1,2,3,4,5,6,9},90] (* Harvey P. Dale, May 08 2018 *)
  • Sage
    f = lambda k, m: floor(m*k/(k-1))
    a = lambda n: f(9, f(8, n))
    [a(n) for n in range(71)] # Peter Luschny, May 03 2016

Formula

G.f.: x*(1 + x + x^2 + x^3 + x^4 + x^5 + 3*x^6)/((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)).
a(n) = a(n-1) + a(n-7) - a(n-8).
a(n) = (63*n - 12 - 12*(n mod 7) + 2*((-n-1) mod 7))/49. - Wesley Ivan Hurt, Dec 25 2016
Showing 1-6 of 6 results.