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.

A042968 Numbers not divisible by 4.

This page as a plain text file.
%I A042968 #135 Apr 13 2025 15:39:15
%S A042968 1,2,3,5,6,7,9,10,11,13,14,15,17,18,19,21,22,23,25,26,27,29,30,31,33,
%T A042968 34,35,37,38,39,41,42,43,45,46,47,49,50,51,53,54,55,57,58,59,61,62,63,
%U A042968 65,66,67,69,70,71,73,74,75,77,78,79,81,82,83,85,86,87,89,90,91,93,94,95,97,98,99,101,102
%N A042968 Numbers not divisible by 4.
%C A042968 Equivalently, numbers whose square part is odd. Cf. A028982. - _Peter Munn_, Jul 14 2020
%C A042968 More generally the sequence of numbers not divisible by some fixed integer m >= 2 is given by a(n,m) = 1 + n + floor(n/(m-1)). - _Benoit Cloitre_, Jul 11 2009
%C A042968 Also a(n,m) = floor((m*n-1)/(m-1)) [with offset 1]. - _Gary Detlefs_, May 14 2011
%C A042968 Numbers not having more even than odd divisors: A048272(a(n)) >= 0. - _Reinhard Zumkeller_, Jan 21 2012
%C A042968 Extending the comments of _Benoit Cloitre_ (Jul 11 2009) and _Gary Detlefs_ (May 14 2011), the g.f. is A(m,x) = (1-x^m) / ((1-x^(m-1))*(1-x)^2) where m >= 2 is fixed. - _Werner Schulte_, Apr 26 2018
%H A042968 G. C. Greubel, <a href="/A042968/b042968.txt">Table of n, a(n) for n = 1..10000</a>
%H A042968 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).
%F A042968 a(n) = a(n-1) + a(n-3) - a(n-4).
%F A042968 a(n) = a(n-3) + 4, with a(1) = 1.
%F A042968 G.f.: x * (1+x) * (1+x^2) / ( (1+x+x^2)*(1-x)^2 ). - _Michael Somos_, Jan 12 2000
%F A042968 A064680(A064680(a(n))) = a(n). - _Reinhard Zumkeller_, Oct 19 2001
%F A042968 Nearest integer to (Sum_{k>n} 1/k^4)/(Sum_{k>n} 1/k^5). - _Benoit Cloitre_, Jun 12 2003
%F A042968 a(n) = n + 1 + floor(n/3). - _Benoit Cloitre_, Jul 11 2009
%F A042968 a(n) = floor((4*n+3)/3). - _Gary Detlefs_, May 14 2011
%F A042968 A214546(a(n)) >= 0 for n > 0. - _Reinhard Zumkeller_, Jul 20 2012
%F A042968 a(n) = 2*n - ceiling(2*n/3) + 1. - _Arkadiusz Wesolowski_, Sep 21 2012
%F A042968 Sum_{k=0..n} a(n) = A071619(n+1). - _L. Edson Jeffery_, Jul 30 2014
%F A042968 The g.f. A(x) satisfies x*A(x)^2 = (B(x)/x)^2 + (B(x)/x), where B(x) is the o.g.f. of A042965. - _Peter Bala_, Apr 12 2017
%F A042968 a(n) = (12*n + 6 + 3*cos(2*n*Pi/3) + sqrt(3)*sin(2*n*Pi/3))/9. - _Wesley Ivan Hurt_, Sep 30 2017
%F A042968 Euler transform of length 4 sequence [2, 0, 1, -1]. - _Michael Somos_, Jun 17 2018
%F A042968 a(n) = -a(-1-n) for all n in Z. - _Michael Somos_, Jun 17 2018
%F A042968 E.g.f.: (2/3)*exp(x)*(1 + 2*x) + (1/9)*exp(-x/2)*(3*cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2)). - _Stefano Spezia_, Nov 16 2019
%F A042968 a(n) = (12*n + 6 + w^(2*n)*(w + 2) - w^n*(w - 1))/9 where w = (-1 + sqrt(-3))/2. - _Guenther Schrack_, Jun 07 2021
%F A042968 Sum_{n>=1} (-1)^(n+1)/a(n) = (2*sqrt(2)-1)*Pi/8. - _Amiram Eldar_, Dec 05 2021
%e A042968 G.f. = 1 + 2*x + 3*x^2 + 5*x^3 + 6*x^4 + 7*x^5 + 9*x^6 + 10*x^7 + 11*x^8 + ... - _Michael Somos_, Jun 17 2018
%p A042968 seq(n+floor((n-1)/3), n=1..80); # _Muniru A Asiru_, Feb 17 2019
%t A042968 Select[Table[n,{n,200}], Mod[#,4] != 0&] (* _Vladimir Joseph Stephan Orlovsky_, Feb 18 2011 *)
%t A042968 LinearRecurrence[{1,0,1,-1},{1,2,3,5},80]  (* or *) Drop[Range[110],{4,-1,4}] (* _Harvey P. Dale_, Jan 07 2023 *)
%o A042968 (PARI) {a(n) = 1 + n + n\3};
%o A042968 (Haskell)
%o A042968 a042968 = (`div` 3) . (subtract 1) . (* 4)
%o A042968 a042968_list = filter ((/= 0) . (`mod` 4)) [1..]
%o A042968 -- _Reinhard Zumkeller_, Sep 02 2012
%o A042968 (Magma) [n+1+Floor(n/3): n in [0..80]]; // _Vincenzo Librandi_, Aug 03 2015
%o A042968 (Sage) [1+n+floor(n/3) for n in (0..80)] # _G. C. Greubel_, Feb 17 2019
%o A042968 (Python)
%o A042968 def A042968(n): return n+(n-1)//3 # _Chai Wah Wu_, Apr 13 2025
%Y A042968 Cf. A001651, A001935, A028982, A070048, A042965, A064680.
%Y A042968 Cf. A071619 (partial sums); A008586 (complement).
%Y A042968 Numbers that are congruent to {k0,k1,k2} mod 4: A004772, A004773, A042965, a(n).
%K A042968 nonn,easy
%O A042968 1,2
%A A042968 _N. J. A. Sloane_, Dec 11 1999
%E A042968 Edited by _Peter Munn_, Nov 16 2019
%E A042968 I restored my original (1999) definition and offset, which in the intervening 21 years had been lost. - _N. J. A. Sloane_, Jun 12 2021