login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A047255 Numbers that are congruent to {1, 2, 3, 5} mod 6. 7
1, 2, 3, 5, 7, 8, 9, 11, 13, 14, 15, 17, 19, 20, 21, 23, 25, 26, 27, 29, 31, 32, 33, 35, 37, 38, 39, 41, 43, 44, 45, 47, 49, 50, 51, 53, 55, 56, 57, 59, 61, 62, 63, 65, 67, 68, 69, 71, 73, 74, 75, 77, 79, 80, 81, 83, 85, 86, 87, 89, 91, 92, 93, 95, 97, 98, 99, 101, 103, 104 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Each element is coprime to preceding two elements. - Amarnath Murthy, Jun 12 2001

The sequence is the interleaving of A047241 with A016789. - Guenther Schrack, Feb 16 2019

LINKS

Guenther Schrack, Table of n, a(n) for n = 1..10012

Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).

FORMULA

a(n) = {n | n == 1, 2, 3, 5 (mod 6)}.

G.f.: x*(1 + x^2 + x^3) / ((1+x^2)*(1-x)^2). - R. J. Mathar, Oct 08 2011

From Wesley Ivan Hurt, May 20 2016: (Start)

a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4), for n>4.

a(n) = (6*n - 4 + i^(1-n) + i^(n-1))/4, where i = sqrt(-1).

a(2*n) = A016789(n-1) for n>0, a(2*n-1) = A047241(n). (End)

E.g.f.: (2 + sin(x) + (3*x - 2)*exp(x))/2. - Ilya Gutkovskiy, May 21 2016

a(1-n) = - A047251(n). - Wesley Ivan Hurt, May 21 2016

From Guenther Schrack, Feb 16 2019: (Start)

a(n) = (6*n - 4 + (1 - (-1)^n)*(-1)^(n*(n-1)/2))/4.

a(n) = a(n-4) + 6, a(1)=1, a(2)=2, a(3)=3, a(4)=5, for n > 4.

a(n) = A047237(n) + 1. (End)

EXAMPLE

After 21 and 23 the next term is 25 as 24 has a common divisor with 21.

MAPLE

A047255:=n->(6*n-4+I^(1-n)+I^(n-1))/4: seq(A047255(n), n=1..100); # Wesley Ivan Hurt, May 20 2016

MATHEMATICA

Select[Range[100], MemberQ[{1, 2, 3, 5}, Mod[#, 6]] &]

LinearRecurrence[{2, -2, 2, -1}, {1, 2, 3, 5}, 100] (* Harvey P. Dale, May 14 2020 *)

PROG

(Haskell)

a047255 n = a047255_list !! (n-1)

a047255_list = 1 : 2 : 3 : 5 : map (+ 6) a047255_list

-- Reinhard Zumkeller, Jan 17 2014

(MAGMA) [n : n in [0..100] | n mod 6 in [1, 2, 3, 5]]; // Wesley Ivan Hurt, May 21 2016

(PARI) a(n)=([0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1; -1, 2, -2, 2]^(n-1)*[1; 2; 3; 5])[1, 1] \\ Charles R Greathouse IV, Feb 11 2017

(Sage) a=(x*(1+x^2+x^3)/((1+x^2)*(1-x)^2)).series(x, 80).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 16 2019

CROSSREFS

Cf. A007310, A016789, A047228, A047237, A047241, A047251, A047261, A047273, A062062, A062063.

Complement: A047233

Sequence in context: A244016 A186042 A039019 * A062062 A256133 A078643

Adjacent sequences:  A047252 A047253 A047254 * A047256 A047257 A047258

KEYWORD

nonn,nice,easy

AUTHOR

N. J. A. Sloane

EXTENSIONS

More terms from Larry Reeves (larryr(AT)acm.org), Jun 15 2001

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 29 02:27 EDT 2021. Contains 346340 sequences. (Running on oeis4.)