login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A042965 Nonnegative integers not congruent to 2 mod 4. 52
0, 1, 3, 4, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19, 20, 21, 23, 24, 25, 27, 28, 29, 31, 32, 33, 35, 36, 37, 39, 40, 41, 43, 44, 45, 47, 48, 49, 51, 52, 53, 55, 56, 57, 59, 60, 61, 63, 64, 65, 67, 68, 69, 71, 72, 73, 75, 76, 77, 79, 80, 81, 83, 84, 85, 87, 88, 89, 91, 92 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, (A, B) = 1, A <= B); sequence (starting at 3) gives values of AUB, sorted and duplicates removed. Values of AUBUC give same sequence. - David W. Wilson

These are the nonnegative integers that can be written as a difference of two squares, i.e., n=x^2-y^2 for integers x,y. - Sharon Sela (sharonsela(AT)hotmail.com), Jan 25 2002. Equivalently, nonnegative numbers represented by the quadratic form x^2-y^2 of discriminant 4. The primes in this sequence are all the odd primes. - N. J. A. Sloane, May 30 2014

Numbers n such that Kronecker(4,n) == mu(gcd(4,n)). - Jon Perry, Sep 17 2002

Count, sieving out numbers of the form 2(2n+1) (A016825, "nombres pair-impairs"). A generalized Chebyshev transform of the Jacobsthal numbers: apply the transform g(x)->(1/(1+x^2))g(x/(1+x^2)) to the g.f. of A001045(n+2). Partial sums of 1,2,1,1,2,1,..... - Paul Barry, Apr 26 2005

For n>1, equals union of A020883 and A020884. - Lekraj Beedassy, Sep 28 2004

The sequence 1,1,3,4,5,... is the image of A001045(n+1) under the mapping g(x)->g(x/(1+x^2)). - Paul Barry, Jan 16 2005

With offset 0 starting (1, 3, 4,...) = INVERT transform of A009531 starting (1, 2, -1, -4, 1, 6,...) with offset 0.

Apparently these are the regular numbers modulo 4 [Haukkanan & Toth]. - R. J. Mathar, Oct 07 2011

A214546(a(n)) != 0. - Reinhard Zumkeller, Jul 20 2012

Numbers of the form x*y in nonnegative integers x,y with x+y even. - Michael Somos, May 18 2013

Convolution of A106510 with A000027. - L. Edson Jeffery, Jan 24 2015

Numbers that are the sum of zero or more consecutive odd positive numbers. - Gionata Neri, Sep 01 2015

Numbers that are congruent to {0, 1, 3} mod 4. - Wesley Ivan Hurt, Jun 10 2016

Nonnegative integers of the form (2+(3*m-2)/4^j)/3, j,m >= 0. - L. Edson Jeffery, Jan 02 2017

LINKS

T. D. Noe, Table of n, a(n) for n = 1..1000

P. Haukkanen, L. Toth, An analogue of Ramanujan's sum with respect to regular integers (mod r), Ramanujan J. 27 (2012), no. 1, 71-88.

Ron Knott, Pythagorean Triples and Online Calculators

N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)

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

FORMULA

Recurrence: a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.

a(n) = n - 1 + (3n-3-sqrt(3)*(1-2*cos(2*Pi*(n-1)/3))*sin(2*Pi*(n-1)/3))/9. Partial sums of the period-3 sequence 0, 1, 1, 2, 1, 1, 2, 1, 1, 2, ... (A101825). - Ralf Stephan, May 19 2013

G.f.: x^2*(1+x)^2/((1-x)^2*(1+x+x^2)); a(n)=Sum{k=0..floor(n/2)}, binomial(n-k-1, k)*A001045(n-2*k), n>0. - Paul Barry, Jan 16 2005, R. J. Mathar, Dec 09 2009

a(n) = floor((4*n-3)/3). - Gary Detlefs, May 14 2011

From Michael Somos, May 18 2013: (Start)

Euler transform of length 3 sequence [3, -2, 1].

a(2-n) = -a(n). (End)

From Wesley Ivan Hurt, Jun 10 2016: (Start)

a(n) = (12*n-12+3*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9.

a(3k) = 4k-1, a(3k-1) = 4k-3, a(3k-2) = 4k-4. (End)

a(n) = round((4*n-4)/3). - Mats Granvik, Sep 24 2016

EXAMPLE

G.f. = x^2 + 3*x^3 + 4*x^4 + 5*x^5 + 7*x^6 + 8*x^7 + 9*x^8 + 11*x^9 + 12*x^10 + ...

MAPLE

A042965:=n->(12*n-12+3*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9: seq(A042965(n), n=1..100); # Wesley Ivan Hurt, Jun 10 2016

MATHEMATICA

nn=100; Complement[Range[0, nn], Range[2, nn, 4]] (* Harvey P. Dale, May 21 2011 *)

f[n_]:=Floor[(4*n-3)/3]; Array[f, 70] (* Robert G. Wilson v, Jun 26 2012 *)

LinearRecurrence[{1, 0, 1, -1}, {0, 1, 3, 4}, 70] (* L. Edson Jeffery, Jan 21 2015 *)

Select[Range[0, 100], ! MemberQ[{2}, Mod[#, 4]] &] (* Vincenzo Librandi, Sep 03 2015 *)

PROG

(PARI) a(n)=(4*n-3)\3 \\ Charles R Greathouse IV, Jul 25 2011

(Haskell)

a042965 =  (`div` 3) . (subtract 3) . (* 4)

a042965_list = 0 : 1 : 3 : map (+ 4) a042965_list

-- Reinhard Zumkeller, Nov 09 2012

(MAGMA) [n: n in [0..100] | not n mod 4 in 2]; // Vincenzo Librandi, Sep 03 2015

CROSSREFS

Cf. A001045, A009531, A020883, A020884, A047209, A214546, A143978.

Essentially the complement of A016825.

See A267958 for these numbers multiplied by 4.

Sequence in context: A183147 A074227 A122906 * A260003 A005848 A187885

Adjacent sequences:  A042962 A042963 A042964 * A042966 A042967 A042968

KEYWORD

nonn,nice,easy

AUTHOR

N. J. A. Sloane

EXTENSIONS

Edited by N. J. A. Sloane at the suggestion of Andrew Plewe, Peter Pein and Ralf Stephan, Jun 17 2007

Typos fixed in Gary Detlefs' formula and in Pari program by Reinhard Zumkeller, Nov 09 2012

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified March 22 22:17 EDT 2017. Contains 283901 sequences.