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.
%I A042965 #186 Feb 10 2025 11:18:10 %S A042965 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, %T A042965 33,35,36,37,39,40,41,43,44,45,47,48,49,51,52,53,55,56,57,59,60,61,63, %U A042965 64,65,67,68,69,71,72,73,75,76,77,79,80,81,83,84,85,87,88,89,91,92 %N A042965 Nonnegative integers not congruent to 2 mod 4. %C A042965 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_ %C A042965 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 %C A042965 Numbers n such that Kronecker(4,n) == mu(gcd(4,n)). - _Jon Perry_, Sep 17 2002 %C A042965 Count, sieving out numbers of the form 2*(2*n+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 %C A042965 For n>1, equals union of A020883 and A020884. - _Lekraj Beedassy_, Sep 28 2004 %C A042965 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 %C A042965 With offset 0 starting (1, 3, 4,...) = INVERT transform of A009531 starting (1, 2, -1, -4, 1, 6,...) with offset 0. %C A042965 Apparently these are the regular numbers modulo 4 [Haukkanan & Toth]. - _R. J. Mathar_, Oct 07 2011 %C A042965 Numbers of the form x*y in nonnegative integers x,y with x+y even. - _Michael Somos_, May 18 2013 %C A042965 Convolution of A106510 with A000027. - _L. Edson Jeffery_, Jan 24 2015 %C A042965 Numbers that are the sum of zero or more consecutive odd positive numbers. - _Gionata Neri_, Sep 01 2015 %C A042965 Numbers that are congruent to {0, 1, 3} mod 4. - _Wesley Ivan Hurt_, Jun 10 2016 %C A042965 Nonnegative integers of the form (2+(3*m-2)/4^j)/3, j,m >= 0. - _L. Edson Jeffery_, Jan 02 2017 %C A042965 This is { x^2 - y^2; x >= y >= 0 }; with the restriction x > y one gets the same set without zero; with the restriction x > 0 (i.e., differences of two nonzero squares) one gets the set without 1. An odd number 2n-1 = n^2 - (n-1)^2, a number 4n = (n+1)^2 - (n-1)^2. - _M. F. Hasler_, May 08 2018 %D A042965 R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section D9. %D A042965 J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 83. %H A042965 Ray Chandler, <a href="/A042965/b042965.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from T. D. Noe) %H A042965 Pentti Haukkanen and László Tóth, <a href="http://dx.doi.org/10.1007/s11139-011-9327-9">An analogue of Ramanujan's sum with respect to regular integers (mod r)</a>, Ramanujan J., Vol. 27, No. 1 (2012), pp. 71-88. %H A042965 Ron Knott, <a href="http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Pythag/pythag.html">Pythagorean Triples and Online Calculators</a>. %H A042965 N. J. A. Sloane et al., <a href="https://oeis.org/wiki/Binary_Quadratic_Forms_and_OEIS">Binary Quadratic Forms and OEIS</a> (Index to related sequences, programs, references). %H A042965 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1). %F A042965 Recurrence: a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. %F A042965 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 %F A042965 G.f.: A(x) = 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 %F A042965 a(n) = floor((4*n-3)/3). - _Gary Detlefs_, May 14 2011 %F A042965 A214546(a(n)) != 0. - _Reinhard Zumkeller_, Jul 20 2012 %F A042965 From _Michael Somos_, May 18 2013: (Start) %F A042965 Euler transform of length 3 sequence [3, -2, 1]. %F A042965 a(2-n) = -a(n). (End) %F A042965 From _Wesley Ivan Hurt_, Jun 10 2016: (Start) %F A042965 a(n) = (12*n-12+3*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9. %F A042965 a(3k) = 4k-1, a(3k-1) = 4k-3, a(3k-2) = 4k-4. (End) %F A042965 a(n) = round((4*n-4)/3). - _Mats Granvik_, Sep 24 2016 %F A042965 The g.f. A(x) satisfies (A(x)/x)^2 + A(x)/x = x*B(x)^2, where B(x) is the o.g.f. of A042968. - _Peter Bala_, Apr 12 2017 %F A042965 Sum_{n>=2} (-1)^n/a(n) = log(sqrt(2)+2)/sqrt(2) - (sqrt(2)-1)*log(2)/4. - _Amiram Eldar_, Dec 05 2021 %F A042965 From _Peter Bala_, Aug 03 2022: (Start) %F A042965 a(n) = a(floor(n/2)) + a(1 + ceiling(n/2)) for n >= 2, with a(2) = 1 and a(3) = 3. %F A042965 a(2*n) = a(n) + a(n+1); a(2*n+1) = a(n) + a(n+2). Cf. A047222 and A006165. (End) %F A042965 E.g.f.: (9 + 12*exp(x)*(x - 1) + exp(-x/2)*(3*cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2)))/9. - _Stefano Spezia_, Apr 05 2023 %e A042965 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 + ... %p A042965 a_list := proc(len) local rec; rec := proc(n) option remember; %p A042965 ifelse(n <= 4, [0, 1, 3, 4][n], rec(n-1) + rec(n-3) - rec(n-4)) end: %p A042965 seq(rec(n), n=1..len) end: a_list(76); # _Peter Luschny_, Aug 06 2022 %t A042965 nn=100; Complement[Range[0,nn], Range[2,nn,4]] (* _Harvey P. Dale_, May 21 2011 *) %t A042965 f[n_]:=Floor[(4*n-3)/3]; Array[f,70] (* _Robert G. Wilson v_, Jun 26 2012 *) %t A042965 LinearRecurrence[{1, 0, 1, -1}, {0, 1, 3, 4}, 70] (* _L. Edson Jeffery_, Jan 21 2015 *) %t A042965 Select[Range[0, 100], ! MemberQ[{2}, Mod[#, 4]] &] (* _Vincenzo Librandi_, Sep 03 2015 *) %o A042965 (PARI) a(n)=(4*n-3)\3 \\ _Charles R Greathouse IV_, Jul 25 2011 %o A042965 (Haskell) %o A042965 a042965 = (`div` 3) . (subtract 3) . (* 4) %o A042965 a042965_list = 0 : 1 : 3 : map (+ 4) a042965_list %o A042965 -- _Reinhard Zumkeller_, Nov 09 2012 %o A042965 (Magma) [n: n in [0..100] | not n mod 4 in [2]]; // _Vincenzo Librandi_, Sep 03 2015 %o A042965 (Python) %o A042965 def A042965(n): return (n<<2)//3-1 # _Chai Wah Wu_, Feb 10 2025 %Y A042965 Cf. A001045, A006165, A009531, A020883, A020884, A047209, A047222, A214546, A143978, A042968. %Y A042965 Essentially the complement of A016825. %Y A042965 See A267958 for these numbers multiplied by 4. %K A042965 nonn,nice,easy %O A042965 1,3 %A A042965 _N. J. A. Sloane_ %E A042965 Edited by _N. J. A. Sloane_ at the suggestion of _Andrew S. Plewe_, Peter Pein and _Ralf Stephan_, Jun 17 2007 %E A042965 Typos fixed in _Gary Detlefs_'s formula and in PARI program by _Reinhard Zumkeller_, Nov 09 2012