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.

A016825 Positive integers congruent to 2 (mod 4): a(n) = 4*n+2, for n >= 0.

Original entry on oeis.org

2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82, 86, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234
Offset: 0

Views

Author

Keywords

Comments

Twice the odd numbers, also called singly even numbers.
Numbers having equal numbers of odd and even divisors: A001227(a(n)) = A000005(2*a(n)). - Reinhard Zumkeller, Dec 28 2003
Continued fraction for coth(1/2) = (e+1)/(e-1). The continued fraction for tanh(1/2) = (e-1)/(e+1) would be a(0) = 0, a(n) = A016825(n-1), n >= 1.
No solutions to a(n) = b^2 - c^2. - Henry Bottomley, Jan 13 2001
Sequence gives m such that 8 is the largest power of 2 dividing A003629(k)^m-1 for any k. - Benoit Cloitre, Apr 05 2002
k such that Sum_{d|k} (-1)^d = A048272(k) = 0. - Benoit Cloitre, Apr 15 2002
Also k such that Sum_{d|k} phi(d)*mu(k/d) = A007431(k) = 0. - Benoit Cloitre, Apr 15 2002
Also k such that Sum_{d|k} (d/A000005(d))*mu(k/d) = 0, k such that Sum_{d|k}(A000005(d)/d)*mu(k/d) = 0. - Benoit Cloitre, Apr 19 2002
Solutions to phi(x) = phi(x/2); primorial numbers are here. - Labos Elemer, Dec 16 2002
Together with 1, numbers that are not the leg of a primitive Pythagorean triangle. - Lekraj Beedassy, Nov 25 2003
For n > 0: complement of A107750 and A023416(a(n)-1) = A023416(a(n)) <> A023416(a(n)+1). - Reinhard Zumkeller, May 23 2005
Also the minimal value of Sum_{i=1..n+2} (p(i) - p(i+1))^2, where p(n+3) = p(1), as p ranges over all permutations of {1,2,...,n+2} (see the Mihai reference). Example: a(2)=10 because the values of the sum for the permutations of {1,2,3,4} are 10 (8 times), 12 (8 times) and 18 (8 times). - Emeric Deutsch, Jul 30 2005
Except for a(n)=2, numbers having 4 as an anti-divisor. - Alexandre Wajnberg, Oct 02 2005
A139391(a(n)) = A006370(a(n)) = A005408(n). - Reinhard Zumkeller, Apr 17 2008
Also a(n) = (n-1) + n + (n+1) + (n+2), so a(n) and -a(n) are all the integers that are sums of four consecutive integers. - Rick L. Shepherd, Mar 21 2009
The denominator in Pi/8 = 1/2 - 1/6 + 1/10 - 1/14 + 1/18 - 1/22 + .... - Mohammad K. Azarian, Oct 13 2011
This sequence gives the positive zeros of i^x + 1 = 0, x real, where i^x = exp(i*x*Pi/2). - Ilya Gutkovskiy, Aug 08 2015
Numbers k such that Sum_{j=1..k} j^3 is not a multiple of k. - Chai Wah Wu, Aug 23 2017
Numbers k such that Lucas(k) is a multiple of 3. - Bruno Berselli, Oct 17 2017
Also numbers k such that t^k == -1 (mod 5), where t is a term of A047221. - Bruno Berselli, Dec 28 2017
The even numbers form a ring, and these are the primes in that ring. Note that unique factorization into primes does not hold, since 60 = 2*30 = 6*10. - N. J. A. Sloane, Nov 11 2019
Also numbers ending with 10 in base 2. - John Keith, May 09 2022

Examples

			0.4621171572600097585023184... = 0 + 1/(2 + 1/(6 + 1/(10 + 1/(14 + ...)))), i.e., c.f. for tanh(1/2).
2.1639534137386528487700040... = 2 + 1/(6 + 1/(10 + 1/(14 + 1/(18 + ...)))), i.e., c.f. for coth(1/2).
		

References

  • H. Bass, Mathematics, Mathematicians and Mathematics Education, Bull. Amer. Math. Soc. (N.S.) 42 (2004), no. 4, 417-430.
  • Arthur Beiser, Concepts of Modern Physics, 2nd Ed., McGraw-Hill, 1973.
  • J. R. Goldman, The Queen of Mathematics, 1998, p. 70.
  • Granino A. Korn and Theresa M. Korn, Mathematical Handbook for Scientists and Engineers, McGraw-Hill Book Company, New York (1968).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 262, 278.

Crossrefs

First differences of A001105.
Cf. A160327 (decimal expansion).
Subsequence of A042963.
Essentially the complement of A042965.

Programs

Formula

a(n) = 4*n + 2, for n >= 0.
a(n) = 2*A005408(n). - Lekraj Beedassy, Nov 28 2003
a(n) = A118413(n+1,2) for n>1. - Reinhard Zumkeller, Apr 27 2006
From Michael Somos, Apr 11 2007: (Start)
G.f.: 2*(1+x)/(1-x)^2.
E.g.f.: 2*(1+2*x)*exp(x).
a(n) = a(n-1) + 4.
a(-1-n) = -a(n). (End)
a(n) = 8*n - a(n-1) for n > 0, a(0)=2. - Vincenzo Librandi, Nov 20 2010
From Reinhard Zumkeller, Jun 11 2012, Jun 30 2012 and Jul 20 2012: (Start)
A080736(a(n)) = 0.
A007814(a(n)) = 1;
A037227(a(n)) = 3.
A214546(a(n)) = 0. (End)
a(n) = T(n+2) - T(n-2) where T(n) = n*(n+1)/2 = A000217(n). In general, if M(k,n) = 2*k*n + k, then M(k,n) = T(n+k) - T(n-k). - Charlie Marion, Feb 24 2020
From Amiram Eldar, Nov 22 2024: (Start)
Product_{n>=1} (1 - (-1)^n/a(n)) = 1/sqrt(2-sqrt(2)) (A285871).
Product_{n>=1} (1 + (-1)^n/a(n)) = sqrt(1-1/sqrt(2)) (A154739). (End)

A008586 Multiples of 4.

Original entry on oeis.org

0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228
Offset: 0

Views

Author

Keywords

Comments

Apart from initial term(s), dimension of the space of weight 2n cusp forms for Gamma_0( 14 ).
A000466(n), a(n) and A053755(n) are Pythagorean triples. - Zak Seidov, Jan 16 2007
If X is an n-set and Y and Z disjoint 2-subsets of X then a(n-3) is equal to the number of 3-subsets of X intersecting both Y and Z. - Milan Janjic, Aug 26 2007
Number of n-permutations (n>=1) of 5 objects u, v, z, x, y with repetition allowed, containing n-1 u's. Example: if n=1 then n-1 = zero (0) u, a(1)=4 because we have v, z, x, y. If n=2 then n-1 = one (1) u, a(2)=8 because we have vu, zu, xu, yu, uv, uz, ux, uy. A038231 formatted as a triangular array: diagonal: 4, 8, 12, 16, 20, 24, 28, 32, ... - Zerinvary Lajos, Aug 06 2008
For n > 0: numbers having more even than odd divisors: A048272(a(n)) < 0. - Reinhard Zumkeller, Jan 21 2012
A214546(a(n)) < 0 for n > 0. - Reinhard Zumkeller, Jul 20 2012
A090418(a(n)) = 0 for n > 0. - Reinhard Zumkeller, Aug 06 2012
Terms are the differences of consecutive centered square numbers (A001844). - Mihir Mathur, Apr 02 2013
a(n)*Pi = nonnegative zeros of the cycloid generated by a circle of radius 2 rolling along the positive x-axis from zero. - Wesley Ivan Hurt, Jul 01 2013
Apart from the initial term, number of vertices of minimal path on an n-dimensional cubic lattice (n>1) of side length 2, until a self-avoiding walk gets stuck. A004767 + 1. - Matthew Lehman, Dec 23 2013
The number of orbits of Aut(Z^7) as function of the infinity norm n of the representative lattice point of the orbit, when the cardinality of the orbit is equal to 2688. - Philippe A.J.G. Chevalier, Dec 29 2015
First differences of A001844. - Robert Price, May 13 2016
Numbers k such that Fibonacci(k) is a multiple of 3 (A033888). - Bruno Berselli, Oct 17 2017

Crossrefs

Number of orbits of Aut(Z^7) as function of the infinity norm A000579, A154286, A102860, A002412, A045943, A115067, A008585, A005843, A001477, A000217.

Programs

Formula

a(n) = A008574(n), n>0. - R. J. Mathar, Oct 28 2008
a(n) = Sum_{k>=0} A030308(n,k)*2^(k+2). - Philippe Deléham, Oct 17 2011
a(n+1) = A000290(n+2) - A000290(n). - Philippe Deléham, Mar 31 2013
G.f.: 4*x/(1-x)^2. - David Wilding, Jun 21 2014
E.g.f.: 4*x*exp(x). - Stefano Spezia, May 18 2021

A042965 Nonnegative integers not congruent to 2 mod 4.

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

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*(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
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
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
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

Examples

			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 + ...
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section D9.
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 83.

Crossrefs

Essentially the complement of A016825.
See A267958 for these numbers multiplied by 4.

Programs

  • 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
    
  • Maple
    a_list := proc(len) local rec; rec := proc(n) option remember;
    ifelse(n <= 4, [0, 1, 3, 4][n], rec(n-1) + rec(n-3) - rec(n-4)) end:
    seq(rec(n), n=1..len) end: a_list(76); # Peter Luschny, Aug 06 2022
  • 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 *)
  • PARI
    a(n)=(4*n-3)\3 \\ Charles R Greathouse IV, Jul 25 2011
    
  • Python
    def A042965(n): return (n<<2)//3-1 # Chai Wah Wu, Feb 10 2025

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.: 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
a(n) = floor((4*n-3)/3). - Gary Detlefs, May 14 2011
A214546(a(n)) != 0. - Reinhard Zumkeller, Jul 20 2012
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
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
Sum_{n>=2} (-1)^n/a(n) = log(sqrt(2)+2)/sqrt(2) - (sqrt(2)-1)*log(2)/4. - Amiram Eldar, Dec 05 2021
From Peter Bala, Aug 03 2022: (Start)
a(n) = a(floor(n/2)) + a(1 + ceiling(n/2)) for n >= 2, with a(2) = 1 and a(3) = 3.
a(2*n) = a(n) + a(n+1); a(2*n+1) = a(n) + a(n+2). Cf. A047222 and A006165. (End)
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

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Peter Pein and Ralf Stephan, Jun 17 2007
Typos fixed in Gary Detlefs's formula and in PARI program by Reinhard Zumkeller, Nov 09 2012

A042968 Numbers not divisible by 4.

Original entry on oeis.org

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, 34, 35, 37, 38, 39, 41, 42, 43, 45, 46, 47, 49, 50, 51, 53, 54, 55, 57, 58, 59, 61, 62, 63, 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
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Comments

Equivalently, numbers whose square part is odd. Cf. A028982. - Peter Munn, Jul 14 2020
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
Also a(n,m) = floor((m*n-1)/(m-1)) [with offset 1]. - Gary Detlefs, May 14 2011
Numbers not having more even than odd divisors: A048272(a(n)) >= 0. - Reinhard Zumkeller, Jan 21 2012
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

Examples

			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
		

Crossrefs

Cf. A071619 (partial sums); A008586 (complement).
Numbers that are congruent to {k0,k1,k2} mod 4: A004772, A004773, A042965, a(n).

Programs

  • Haskell
    a042968 = (`div` 3) . (subtract 1) . (* 4)
    a042968_list = filter ((/= 0) . (`mod` 4)) [1..]
    -- Reinhard Zumkeller, Sep 02 2012
    
  • Magma
    [n+1+Floor(n/3): n in [0..80]]; // Vincenzo Librandi, Aug 03 2015
    
  • Maple
    seq(n+floor((n-1)/3), n=1..80); # Muniru A Asiru, Feb 17 2019
  • Mathematica
    Select[Table[n,{n,200}], Mod[#,4] != 0&] (* Vladimir Joseph Stephan Orlovsky, Feb 18 2011 *)
    LinearRecurrence[{1,0,1,-1},{1,2,3,5},80]  (* or *) Drop[Range[110],{4,-1,4}] (* Harvey P. Dale, Jan 07 2023 *)
  • PARI
    {a(n) = 1 + n + n\3};
    
  • Python
    def A042968(n): return n+(n-1)//3 # Chai Wah Wu, Apr 13 2025
  • Sage
    [1+n+floor(n/3) for n in (0..80)] # G. C. Greubel, Feb 17 2019
    

Formula

a(n) = a(n-1) + a(n-3) - a(n-4).
a(n) = a(n-3) + 4, with a(1) = 1.
G.f.: x * (1+x) * (1+x^2) / ( (1+x+x^2)*(1-x)^2 ). - Michael Somos, Jan 12 2000
A064680(A064680(a(n))) = a(n). - Reinhard Zumkeller, Oct 19 2001
Nearest integer to (Sum_{k>n} 1/k^4)/(Sum_{k>n} 1/k^5). - Benoit Cloitre, Jun 12 2003
a(n) = n + 1 + floor(n/3). - Benoit Cloitre, Jul 11 2009
a(n) = floor((4*n+3)/3). - Gary Detlefs, May 14 2011
A214546(a(n)) >= 0 for n > 0. - Reinhard Zumkeller, Jul 20 2012
a(n) = 2*n - ceiling(2*n/3) + 1. - Arkadiusz Wesolowski, Sep 21 2012
Sum_{k=0..n} a(n) = A071619(n+1). - L. Edson Jeffery, Jul 30 2014
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
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
Euler transform of length 4 sequence [2, 0, 1, -1]. - Michael Somos, Jun 17 2018
a(n) = -a(-1-n) for all n in Z. - Michael Somos, Jun 17 2018
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
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
Sum_{n>=1} (-1)^(n+1)/a(n) = (2*sqrt(2)-1)*Pi/8. - Amiram Eldar, Dec 05 2021

Extensions

Edited by Peter Munn, Nov 16 2019
I restored my original (1999) definition and offset, which in the intervening 21 years had been lost. - N. J. A. Sloane, Jun 12 2021

A004273 0 together with odd numbers.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131
Offset: 0

Views

Author

Keywords

Comments

Also continued fraction for tanh(1) (A073744 is decimal expansion). - Rick L. Shepherd, Aug 07 2002
From Jaroslav Krizek, May 28 2010: (Start)
For n >= 1, a(n) = numbers k such that arithmetic mean of the first k positive integers is an integer. A040001(a(n)) = 1. See A145051 and A040001.
For n >= 1, a(n) = corresponding values of antiharmonic means to numbers from A016777 (numbers k such that antiharmonic mean of the first k positive integers is an integer).
a(n) = A000330(A016777(n)) / A000217(A016777(n)) = A146535(A016777(n)+1). (End)
If the n-th prime is denoted by p(n) then it appears that a(j) = distinct, increasing values of (Sum of the quadratic non-residues of p(n) - Sum of the quadratic residues of p(n)) / p(n) for each j. - Christopher Hunt Gribble, Oct 05 2010
A214546(a(n)) > 0. - Reinhard Zumkeller, Jul 20 2012
Dimension of the space of weight 2n+2 cusp forms for Gamma_0(6).
The size of a maximal 2-degenerate graph of order n-1 (this class includes 2-trees and maximal outerplanar graphs (MOPs)). - Allan Bickle, Nov 14 2021
Numbers not considered even for the purpose of roulette. J. Lowell, Apr 29 2025

Examples

			G.f. = x + 3*x^2 + 5*x^3 + 7*x^4 + 9*x^5 + 11*x^6 + 13*x^7 + 15*x^8 + 17*x^9 + ...
		

Crossrefs

Cf. A110185, continued fraction expansion of 2*tanh(1/2), and A204877, continued fraction expansion of 3*tanh(1/3). [Bruno Berselli, Jan 26 2012]
Cf. A005408.

Programs

Formula

G.f.: x*(1+x)/(-1+x)^2. - R. J. Mathar, Nov 18 2007
a(n) = lodumo_2(A057427(n)). - Philippe Deléham, Apr 26 2009
Euler transform of length 2 sequence [3, -1]. - Michael Somos, Jul 03 2014
a(n) = (4*n - 1 - (-1)^(2^n))/2. - Luce ETIENNE, Jul 11 2015

A140472 a(n) = a(n - a(n-1)) + a(floor(n/2)).

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 4, 4, 8, 5, 6, 6, 8, 7, 8, 8, 16, 9, 10, 10, 12, 11, 12, 12, 16, 13, 14, 14, 16, 15, 16, 16, 32, 17, 18, 18, 20, 19, 20, 20, 24, 21, 22, 22, 24, 23, 24, 24, 32, 25, 26, 26, 28, 27, 28, 28, 32, 29, 30, 30, 32, 31, 32, 32, 64, 33, 34, 34, 36, 35, 36, 36, 40, 37, 38
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Jun 28 2008

Keywords

Comments

From M. F. Hasler, Oct 20 2019: (Start)
The sequence A285326/2 is characterized by a(2n) = 2*a(n) (n >= 0) and a(2n-1) = n (n >= 1). This implies the property defining this sequence: If n = 2k, then n - a(n-1) = 2k - a(2k-1) = 2k - k = k, so a(n - a(n-1)) + a(floor(n/2)) = a(k) + a(k) = 2*a(k) = a(2k) = a(n). If n = 2k-1, then n - a(n-1) = 2k-1 - a(2k-2) = 2k-1 - 2*a(k-1), whence a(n - a(n-1)) + a(floor(n/2)) = a(2(k - a(k-1)) - 1) + a(k-1) = k - a(k-1) + a(k-1) = k = a(2k-1) = a(n). Thus, A285326/2 satisfies the definition of this sequence.
The sequence is equal to itself multiplied by 2 and interleaved with the positive integers. (This is equivalent to the above characterization.)
The sequence repeats the pattern [A, B, C, C] where in the n-th occurrence C = 2n, B = C - 1, A = C if n is even, A = C + 2 if n == 3 (mod 4), and A = 16*a((n-1)/4) otherwise. This yields a simpler formula for all terms except for indices which are multiples of 16. (End)

Crossrefs

Cf. A214546 (first differences).
Same as A109168, if a(0) = 0 is omitted. - M. F. Hasler, Oct 19 2019

Programs

  • Haskell
    a140472 n = a140472_list !! n
    a140472_list = 0 : 1 : h 2 1 where
      h x y = z : h (x + 1) z where z = a140472 (x - y) + a140472 (x `div` 2)
    -- Reinhard Zumkeller, Jul 20 2012
    
  • Magma
    I:=[1,2]; [0] cat [n le 2 select I[n] else Self(n-Self(n-1))+Self(Floor((n) div 2)):n in [1..75]]; // Marius A. Burtea, Aug 16 2019
    
  • Mathematica
    a[0] = 0; a[1] = 1;
    a[n_] := a[n] = a[n - a[n - 1]] + a[Floor[n/2]];
    Table[a[n], {n, 0, 200}]
  • PARI
    a(n)=(n+bitand(n,-n))\2 \\ M. F. Hasler, Oct 19 2019

Formula

a(0) = 0; a(1) = a(2) = 1; a(n) = a(n - a(n-1)) + a(floor(n/2)).
a(n) = (n+A006519(n))/2 for n > 0 (conjectured). - Jon Maiga, Aug 16 2019
a(n) = A285326(n)/2, equivalent to the above: see comments for the proof. - M. F. Hasler, Oct 19 2019

Extensions

Offset corrected by Reinhard Zumkeller, Jul 20 2012
Showing 1-6 of 6 results.