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-10 of 18 results. Next

A047461 Numbers that are congruent to {1, 4} mod 8.

Original entry on oeis.org

1, 4, 9, 12, 17, 20, 25, 28, 33, 36, 41, 44, 49, 52, 57, 60, 65, 68, 73, 76, 81, 84, 89, 92, 97, 100, 105, 108, 113, 116, 121, 124, 129, 132, 137, 140, 145, 148, 153, 156, 161, 164, 169, 172, 177, 180, 185, 188, 193, 196, 201, 204, 209, 212, 217, 220, 225, 228, 233
Offset: 1

Views

Author

Keywords

Comments

Maximal number of squares that can be covered by a queen on an n X n chessboard. - Reinhard Zumkeller, Dec 15 2008

Crossrefs

Programs

  • GAP
    Filtered([1..250], n->n mod 8=1 or n mod 8 =4); # Muniru A Asiru, Jul 23 2018
    
  • Magma
    [4*n-3 - ((n+1) mod 2): n in [1..70]]; // G. C. Greubel, Mar 15 2024
    
  • Maple
    seq(coeff(series(factorial(n)*((8-exp(-x)+(8*x-7)*exp(x))/2), x,n+1),x,n),n=1..60); # Muniru A Asiru, Jul 23 2018
  • Mathematica
    Flatten[(#+{1,4})&/@(8Range[0,30])] (* or *) LinearRecurrence[ {1,1,-1},{1,4,9},60] (* Harvey P. Dale, Jun 18 2013 *)
    CoefficientList[ Series[(4x^2 + 3x + 1)/((x + 1) (x - 1)^2), {x, 0, 58}], x] (* Robert G. Wilson v, Jul 24 2018 *)
  • Maxima
    makelist(4*n -(7 + (-1)^n)/2, n, 1, 100); /* Franck Maminirina Ramaharo, Jul 22 2018 */
    
  • Python
    def A047461(n): return (n-1<<2)|(n&1) # Chai Wah Wu, Mar 30 2024
  • SageMath
    [4*n-3 - ((n+1)%2) for n in range(1,71)] # G. C. Greubel, Mar 15 2024
    

Formula

From R. J. Mathar, Oct 29 2008: (Start)
G.f.: x*(1+3*x+4*x^2)/((1+x)*(1-x)^2).
a(n) = a(n-2) + 8.
a(n) + a(n+1) = A004770(n).
a(n+1) - a(n) = A010703(n). (End)
a(n) = 8*floor((n-1)/2) + 4 - 3*(n mod 2). - Reinhard Zumkeller, Dec 15 2008
a(n) = A153125(n,n). - Reinhard Zumkeller, Dec 20 2008
a(n) = 8*n - a(n-1) - 11 (with a(1)=1). - Vincenzo Librandi, Aug 06 2010
a(n) = 4*n - (7 + (-1)^n)/2. - Arkadiusz Wesolowski, Sep 18 2012
a(1)=1, a(2)=4, a(3)=9, a(n) = a(n-1) + a(n-2) - a(n-3). - Harvey P. Dale, Jun 18 2013
a(n) = 1 + A004526(n)*3 + A004526(n-1)*5. - Gregory R. Bryant, Apr 16 2014
From Franck Maminirina Ramaharo, Jul 22 2018: (Start)
a(n) = A047470(n) + 1.
E.g.f.: (8 - exp(-x) + (8*x - 7)*exp(x))/2. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+1)*Pi/16 + log(2)/4 + sqrt(2)*arccoth(sqrt(2))/8. - Amiram Eldar, Dec 11 2021

A045636 Numbers of the form p^2 + q^2, with p and q primes.

Original entry on oeis.org

8, 13, 18, 29, 34, 50, 53, 58, 74, 98, 125, 130, 146, 170, 173, 178, 194, 218, 242, 290, 293, 298, 314, 338, 365, 370, 386, 410, 458, 482, 530, 533, 538, 554, 578, 650, 698, 722, 818, 845, 850, 866, 890, 962, 965, 970, 986, 1010, 1058, 1082, 1130, 1202, 1250
Offset: 1

Views

Author

Keywords

Comments

A045698(a(n)) > 0. - Reinhard Zumkeller, Jul 29 2012
All terms greater than 8 are of the form 8k+2 or 8k+5 (A047617). - Giuseppe Melfi, Oct 06 2022

Examples

			18 belongs to the sequence because it can be written as 3^2 + 3^2.
		

Crossrefs

A214723 is a subsequence. Complement: A214879.
Cf. A214511 (least number having n orderless representations as p^2 + q^2).
Cf. A047617.

Programs

  • Haskell
    import Data.List (findIndices)
    a045636 n = a045636_list !! (n-1)
    a045636_list = findIndices (> 0) a045698_list
    -- Reinhard Zumkeller, Jul 29 2012
    
  • Mathematica
    q=13; imax=Prime[q]^2; Select[Union[Flatten[Table[Prime[x]^2+Prime[y]^2, {x,q}, {y,x}]]], #<=imax&] (* Vladimir Joseph Stephan Orlovsky, Apr 20 2011 *)
    With[{nn=60},Take[Union[Total/@(Tuples[Prime[Range[nn]],2]^2)],nn]] (* Harvey P. Dale, Jan 04 2014 *)
  • PARI
    list(lim)=my(p1=vector(primepi(sqrt(lim-4)),i,prime(i)^2), t, p2=List()); for(i=1,#p1, for(j=i,#p1, t=p1[i]+p1[j];if(t>lim, break, listput(p2,t)))); vecsort(Vec(p2),,8) \\ Charles R Greathouse IV, Jun 21 2012
    
  • Python
    from sympy import primerange
    def aupto(limit):
        primes = list(primerange(2, int((limit-4)**.5)+2))
        nums = [p*p + q*q for i, p in enumerate(primes) for q in primes[i:]]
        return sorted(set(k for k in nums if k <= limit))
    print(aupto(1251)) # Michael S. Branicky, Aug 13 2021

A047470 Numbers that are congruent to {0, 3} mod 8.

Original entry on oeis.org

0, 3, 8, 11, 16, 19, 24, 27, 32, 35, 40, 43, 48, 51, 56, 59, 64, 67, 72, 75, 80, 83, 88, 91, 96, 99, 104, 107, 112, 115, 120, 123, 128, 131, 136, 139, 144, 147, 152, 155, 160, 163, 168, 171, 176, 179, 184, 187, 192, 195, 200, 203, 208, 211, 216, 219, 224, 227, 232
Offset: 1

Views

Author

Keywords

Comments

Maximum number of squares attacked by a queen on an n X n chessboard. - Stewart Gordon, Mar 23 2001
Equivalently, maximum vertex degree in the n X n queen graph. - Eric W. Weisstein, Jun 20 2017
Number of squares attacked by a queen on a toroidal chessboard. - Diego Torres (torresvillarroel(AT)hotmail.com), May 19 2001
List of squared distances between points of diamond 'lattice' with minimal distance sqrt(3). - Arnold Neumaier (Arnold.Neumaier(AT)univie.ac.at), Aug 01 2003
Draw a figure-eight knot diagram on the plane and assign a list of nonnegative numbers at each crossing as follows. Start with 0 and choose a crossing on the knot. Pick a direction and walk around the knot, appending the following nonnegative number everytime a crossing is visited. Two series of sequences are obtained: this sequence, A047535, A047452, A047617 and A047615, A047461, A047452, A047398 (see example). - Franck Maminirina Ramaharo, Jul 22 2018

Examples

			From _Franck Maminirina Ramaharo_, Jul 22 2018: (Start)
Consider the following equivalent figure-eight knot diagrams:
+---------------------+           +-----------------n
|                     |           |                 |
|           +---------B-----+     |           w-----A---e
|           |         |     |     |           |     |   |
|     n-----C---+     |     |     |           |     |   |
|     |     |   |     |     | <=> |   +-------B-----s   |
|     |     +---D-----+     |     |   |       |         |
|     |         |           |     |   |       |         |
w-----A---------e           |     +---C-------D---------+
      |                     |         |       |
      s---------------------+         +-------+
Uppercases A,B,C,D denote crossings, and lowercases n,s,w,e denote directions. Due to symmetry and ambient isotopy, all possible sequences are obtained by starting from crossing A and choose either direction 'n' or 's'.
Direction 'n':
A: 0, 3,  8, 11, 16, 19, 24, 27, 32, 35, 40, ... (this sequence);
B: 4, 7, 12, 15, 20, 23, 28, 31, 36, 39, 44, ... A047535;
C: 1, 6,  9, 14, 17, 22, 25, 30, 33, 38, 41, ... A047452;
D: 2, 5, 10, 13, 18, 21, 26, 29, 34, 37, 42, ... A047617.
Direction 's':
A: 0, 5,  8, 13, 16, 21, 24, 29, 32, 37, 40, ... A047615;
B: 1, 4,  9, 12, 17, 20, 25, 28, 33, 36, 41, ... A047461;
C: 2, 7, 10, 15, 18, 23, 26, 31, 34, 39, 42, ... A047524;
D: 3, 6, 11, 14, 19, 22, 27, 30, 35, 38, 43, ... A047398.
(End)
		

Crossrefs

Programs

  • GAP
    a:=[0,3,8];; for n in [4..50] do a[n]:=a[n-1]+a[n-2]-a[n-3]; od; a; # Muniru A Asiru, Jul 23 2018
    
  • Maple
    a:=n->add(4+(-1)^j,j=1..n):seq(a(n),n=0..64); # Zerinvary Lajos, Dec 13 2008
  • Mathematica
    With[{c = 8 Range[0, 30]}, Sort[Join[c, c + 3]]] (* Harvey P. Dale, Oct 11 2011 *)
    Table[(8 n - 9 - (-1)^n)/2, {n, 20}] (* Eric W. Weisstein, Jun 20 2017 *)
    LinearRecurrence[{1, 1, -1}, {0, 3, 8}, 20] (* Eric W. Weisstein, Jun 20 2017 *)
    CoefficientList[Series[(x (3 + 5 x))/((-1 + x)^2 (1 + x)), {x, 0, 20}], x]  (* Eric W. Weisstein, Jun 20 2017 *)
  • PARI
    forstep(n=0,200,[3,5],print1(n", ")) \\ Charles R Greathouse IV, Oct 17 2011
    
  • Python
    def A047470(n): return (n-1<<2)-(n&1^1) # Chai Wah Wu, Mar 30 2024

Formula

a(n) = a(n-1) + 4 + (-1)^n.
a(n) = a(n-1) + a(n-2) - a(n-3).
a(n) = A042948(n) + A005843(n).
G.f.: (3x+5*x^2)/((1-x)*(1-x^2)).
a(n) = 8*n - a(n-1) - 13 (with a(1)=0). - Vincenzo Librandi, Aug 06 2010
a(n+1) = Sum_{k>=0} A030308(n,k)*A171497(k). - Philippe Deléham, Oct 17 2011
a(n) = 4*n -(9 + (-1)^n)/2. - Arkadiusz Wesolowski, Sep 18 2012
E.g.f: (10 - exp(-x) + (8*x - 9)*exp(x))/2. - Franck Maminirina Ramaharo, Jul 22 2018
Sum_{n>=2} (-1)^n/a(n) = (sqrt(2)-1)*Pi/16 + log(2)/2 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A047452 Numbers that are congruent to {1, 6} mod 8.

Original entry on oeis.org

1, 6, 9, 14, 17, 22, 25, 30, 33, 38, 41, 46, 49, 54, 57, 62, 65, 70, 73, 78, 81, 86, 89, 94, 97, 102, 105, 110, 113, 118, 121, 126, 129, 134, 137, 142, 145, 150, 153, 158, 161, 166, 169, 174, 177, 182, 185, 190
Offset: 1

Views

Author

Keywords

Comments

Except for 1, numbers whose binary reflected Gray code (A014550) ends with 01. - Amiram Eldar, May 17 2021

Crossrefs

Programs

  • GAP
    Filtered([0..250], n->n mod 8=1 or n mod 8=6); # Muniru A Asiru, Jul 24 2018
    
  • Maple
    seq(coeff(series(factorial(n)*((4+exp(-x)+(8*x-5)*exp(x))/2), x,n+1),x,n),n=1..60); # Muniru A Asiru, Jul 24 2018
  • Mathematica
    Table[(8 n - 5 + (-1)^n)/2, {n, 1, 100}] (* Franck Maminirina Ramaharo, Jul 23 2018 *)
    CoefficientList[ Series[(2x^2 + 5x + 1)/((x - 1)^2 (x + 1)), {x, 0, 50}], x] (* or *)
    LinearRecurrence[{1, 1, -1}, {1, 6, 9}, 51] (* Robert G. Wilson v, Jul 24 2018 *)
  • Maxima
    makelist((8*n - 5 + (-1)^n)/2, n, 1, 100); /* Franck Maminirina Ramaharo, Jul 23 2018 */
    
  • Python
    def A047452(n): return (n<<2)-2-(n&1) # Chai Wah Wu, Mar 30 2024

Formula

G.f.: x*(1+5*x+2*x^2) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Dec 07 2011
E.g.f.: (4 + exp(-x) + (8*x - 5)*exp(x))/2. - Ilya Gutkovskiy, May 25 2016
a(n) = A047615(n) + 1. - Franck Maminirina Ramaharo, Jul 23 2018
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+2)*Pi/16 + log(2)/8 + sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

A047524 Numbers that are congruent to {2, 7} mod 8.

Original entry on oeis.org

2, 7, 10, 15, 18, 23, 26, 31, 34, 39, 42, 47, 50, 55, 58, 63, 66, 71, 74, 79, 82, 87, 90, 95, 98, 103, 106, 111, 114, 119, 122, 127, 130, 135, 138, 143, 146, 151, 154, 159, 162, 167, 170, 175, 178, 183, 186, 191, 194, 199, 202, 207, 210, 215, 218, 223, 226, 231, 234
Offset: 1

Views

Author

Keywords

Comments

A195605 is a subsequence. - Bruno Berselli, Sep 21 2011

Crossrefs

Programs

  • GAP
    Filtered([0..250],n->n mod 8=2 or n mod 8=7); # Muniru A Asiru, Aug 06 2018
    
  • Maple
    seq(coeff(series(x*(2+5*x+x^2)/((1+x)*(1-x)^2), x,n+1),x,n),n=1..60); # Muniru A Asiru, Aug 06 2018
  • Mathematica
    Select[Range[300],MemberQ[{2,7},Mod[#,8]]&] (* or *)
    LinearRecurrence[ {1,1,-1},{2,7,10},60] (* Harvey P. Dale, Nov 05 2017 *)
    CoefficientList[ Series[(x^2 + 5x + 2)/((x - 1)^2 (x + 1)), {x, 0, 60}], x] (* Robert G. Wilson v, Aug 07 2018 *)
  • Maxima
    makelist(4*n - mod(n,2) - 1, n, 1, 100); /* Franck Maminirina Ramaharo, Aug 06 2018 */
    
  • PARI
    is(n) = #setintersect([n%8], [2, 7]) > 0 \\ Felix Fröhlich, Aug 06 2018
    
  • Python
    def A047524(n): return (n<<2)-1-(n&1) # Chai Wah Wu, Mar 30 2024

Formula

a(n) = 8*n - a(n-1) - 7, n > 1. - Vincenzo Librandi, Aug 06 2010
From R. J. Mathar, Mar 22 2011: (Start)
a(n) = 4*n - 3/2 + (-1)^n/2.
G.f.: x*(2+5*x+x^2) / ( (1+x)*(x-1)^2 ). (End)
From Franck Maminirina Ramaharo, Aug 06 2018: (Start)
a(n) = 4*n - (n mod 2) - 1.
a(n) = A047615(n) + 2.
a(2*n) = A004771(n-1).
a(2*n-1) = A017089(n-1).
E.g.f.: ((8*x - 3)*exp(x) + exp(-x) + 2)/2. (End)
a(n) = a(n-1) + a(n-2) - a(n-3). - Muniru A Asiru, Aug 06 2018
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+2)*Pi/16 - log(2)/8 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A047535 Numbers that are congruent to {4, 7} mod 8.

Original entry on oeis.org

4, 7, 12, 15, 20, 23, 28, 31, 36, 39, 44, 47, 52, 55, 60, 63, 68, 71, 76, 79, 84, 87, 92, 95, 100, 103, 108, 111, 116, 119, 124, 127, 132, 135, 140, 143, 148, 151, 156, 159, 164, 167, 172, 175, 180, 183, 188, 191, 196, 199, 204, 207, 212, 215, 220, 223, 228, 231
Offset: 1

Views

Author

Keywords

Comments

Union of A004771 and A017113.

Crossrefs

Programs

Formula

a(n) = 8*n - a(n-1) - 5 (with a(1)=4). - Vincenzo Librandi, Aug 06 2010
a(n) = 4*n -(1 + (-1)^n)/2. - Arkadiusz Wesolowski, Sep 18 2012
G.f.: x*(4+3*x+x^2) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Jul 10 2015
From Franck Maminirina Ramaharo, Jul 22 2018: (Start)
a(n) = A047470(n) + 4.
E.g.f.: (2 - exp(-x) + (8*x - 1)*exp(x))/2. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+1)*Pi/16 - log(2)/4 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

A047398 Numbers that are congruent to {3, 6} mod 8.

Original entry on oeis.org

3, 6, 11, 14, 19, 22, 27, 30, 35, 38, 43, 46, 51, 54, 59, 62, 67, 70, 75, 78, 83, 86, 91, 94, 99, 102, 107, 110, 115, 118, 123, 126, 131, 134, 139, 142, 147, 150, 155, 158, 163, 166, 171, 174, 179, 182, 187, 190, 195, 198, 203, 206, 211, 214, 219, 222, 227, 230
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

a(n) = 8*n - a(n-1) - 7, n > 1. - Vincenzo Librandi, Aug 05 2010
From R. J. Mathar, Dec 05 2011: (Start)
a(n) = 4*n - (3 + (-1)^n)/2.
G.f.: x*(3+3*x+2*x^2) / ( (1+x)*(x-1)^2 ). (End)
From Franck Maminirina Ramaharo, Aug 06 2018: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3), n > 3.
a(n) = 4*n + (n mod 2) - 2.
a(n) = A047470(n) + 3.
a(2*n) = A017137(n-1).
a(2*n-1) = A017101(n-1).
E.g.f.: ((8*x - 3)*exp(x) - exp(-x) + 4)/2. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(2)*Pi/16 + log(2)/8 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 18 2021

A047615 Numbers that are congruent to {0, 5} mod 8.

Original entry on oeis.org

0, 5, 8, 13, 16, 21, 24, 29, 32, 37, 40, 45, 48, 53, 56, 61, 64, 69, 72, 77, 80, 85, 88, 93, 96, 101, 104, 109, 112, 117, 120, 125, 128, 133, 136, 141, 144, 149, 152, 157, 160, 165, 168, 173, 176, 181, 184, 189, 192, 197, 200, 205, 208, 213, 216, 221, 224, 229, 232
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • GAP
    Filtered([0..250], n->n mod 8=0 or n mod 8=5); # Muniru A Asiru, Jul 23 2018
    
  • Magma
    [(8*n - 7 + (-1)^n)/2 : n in [1..50]]; // Wesley Ivan Hurt, Mar 26 2015
    
  • Maple
    a:=n->add(4-(-1)^j, j=1..n): seq(a(n), n=0..59); # Zerinvary Lajos, Dec 13 2008
  • Mathematica
    Table[(8 n - 7 + (-1)^n)/2, {n, 1, 40}] (* Wesley Ivan Hurt, Mar 26 2015 *)
    Rest@ CoefficientList[Series[x^2*(5 + 3 x)/((1 - x)^2*(1 + x)), {x, 0, 59}], x] (* Michael De Vlieger, Aug 25 2016 *)
    Rest@(Range[0, 60]! CoefficientList[ Series[(6 + Exp[-x] + (8 x - 7)*Exp[x])/2, {x, 0, 60}], x]) (* or *)
    LinearRecurrence[{1, 1, -1}, {0, 5, 8}, 60] (* Robert G. Wilson v, Jul 23 2018 *)
  • PARI
    forstep(n=0,200,[5,3],print1(n", ")) \\ Charles R Greathouse IV, Oct 17 2011
    
  • PARI
    concat(0, Vec(x^2*(5+3*x)/((1-x)^2*(1+x)) + O(x^100))) \\ Colin Barker, Aug 25 2016
    
  • Python
    def A047615(n): return (n<<2)-3-(n&1) # Chai Wah Wu, Mar 30 2024

Formula

a(n) = 8*n-a(n-1)-11 (with a(1)=0). - Vincenzo Librandi, Aug 06 2010
a(n+1) = Sum_{k>=0} A030308(n,k)*b(k) with b(0)=5 and b(k)=2^(k+2) for k>0. - Philippe Deléham, Oct 17 2011
From Wesley Ivan Hurt, Mar 26 2015: (Start)
a(n) = a(n-1)+a(n-2)-a(n-3).
a(n) = (8n - 7 + (-1)^n)/2. (End)
G.f.: x^2*(5+3*x) / ((1-x)^2*(1+x)). - Colin Barker, Aug 25 2016
From Franck Maminirina Ramaharo, Jul 23 2018: (Start)
a(n) = A047470(n) - (-1)^(n - 1) + 1.
E.g.f.: (6 + exp(-x) + (8*x - 7)*exp(x))/2. (End)
Sum_{n>=2} (-1)^n/a(n) = log(2)/2 - (sqrt(2)-1)*Pi/16 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 18 2021

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A080412 Exchange rightmost two binary digits of n > 1; a(0)=0, a(1)=2.

Original entry on oeis.org

0, 2, 1, 3, 4, 6, 5, 7, 8, 10, 9, 11, 12, 14, 13, 15, 16, 18, 17, 19, 20, 22, 21, 23, 24, 26, 25, 27, 28, 30, 29, 31, 32, 34, 33, 35, 36, 38, 37, 39, 40, 42, 41, 43, 44, 46, 45, 47, 48, 50, 49, 51, 52, 54, 53, 55, 56, 58, 57, 59, 60, 62, 61, 63, 64, 66, 65, 67, 68, 70, 69, 71, 72
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 17 2003

Keywords

Comments

Self-inverse permutation of the natural numbers: a(a(n)) = n.
Lodumo_2 of A021913. - Philippe Deléham, Apr 26 2009
The lodumo_m transformation of a list L is the list L' such that L'(n) is the smallest nonnegative integer not occurring earlier in L' and equal to L(n) (mod m). - M. F. Hasler, Dec 06 2010
From Franck Maminirina Ramaharo, Jul 20 2018: (Start)
Let
A: 0, 3, 8, 11, 16, 19, 24, 27, 32, 35, 40, 43, 48, 51, 56, 59, ... A047470
B: 1, 6, 9, 14, 17, 22, 25, 30, 33, 38, 41, 46, 49, 54, 57, 62, ... A047452
C: 2, 5, 10, 13, 18, 21, 26, 29, 34, 37, 42, 45, 50, 53, 58, 61, ... A047617
D: 4, 7, 12, 15, 20, 23, 28, 31, 36, 39, 44, 47, 52, 55, 60, 63, ... A047535.
Then the sequence is obtained by repeatedly picking terms from A,B,C,D according to the circuit A-C-B-A-D-B-C-D. The sequence begins:
A | C | B | A | D | B | C | D || A | C | B | A | D | ...
--+---+---+---+---+---+---+---++---+---+---+---+---+----
0 | 2 | 1 | 3 | 4 | 6 | 5 | 7 || 8 |10 | 9 |11 |12 | ...
(End)
The sequence is a permutation of the nonnegative integers partitioned into quadruples [4k, 4k+2, 4k+1, 4k+3] for k >= 0, i.e., the two interior terms of each quadruple are interchanged. - Guenther Schrack, Apr 22 2019

Examples

			a(20) = a('101'00') = '101'00' = 20; a(21) = a('101'01') = '101'10' = 22.
a(2) = a('10') = '01' = 1; a(3) = a('11') = '11' = 3.
		

Crossrefs

Programs

  • GAP
    a:=[0,2,1,3,4];; for n in [6..80] do a[n]:=a[n-1]+a[n-4]-a[n-5]; od; a; # Muniru A Asiru, Jul 27 2018
    
  • Magma
    R:=PowerSeriesRing(Integers(), 80); [0] cat Coefficients(R!( x*(2-x+2*x^2+x^3)/((1-x)*(1-x^4)) )); // G. C. Greubel, Apr 28 2019
    
  • Maple
    A080412:=n->n+1+(1+I)*(2*I-2-(1-I)*I^(2*n)+I^(-n)-I^(1+n))/4: seq(A080412(n), n=0..100); # Wesley Ivan Hurt, May 28 2016
  • Mathematica
    a[n_] := (bits = IntegerDigits[n, 2]; Join[Drop[bits, -2], {bits[[-1]], bits[[-2]]}] // FromDigits[#, 2]&); a[0]=0; a[1]=2; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Mar 11 2013 *)
    ertbd[n_]:=Module[{a,b},{a,b}=TakeDrop[IntegerDigits[n,2], IntegerLength[ n,2]-2];FromDigits[Join[a,Reverse[b]],2]]; Join[{0,2},Array[ertbd,80,2]] (* The program uses the TakeDrop function from Mathematica version 10 *) (* Harvey P. Dale, Jan 07 2016 *)
    CoefficientList[Series[x*(2-x+2*x^2+x^3)/((1-x)*(1-x^4)), {x,0,80}], x] (* G. C. Greubel, Apr 28 2019 *)
  • PARI
    my(x='x+O('x^80)); concat([0], Vec(x*(2-x+2*x^2+x^3)/((1-x)*(1-x^4)))) \\ G. C. Greubel, Apr 28 2019
    
  • Python
    def A080412(n): return (0,1,-1,0)[n&3]+n # Chai Wah Wu, Jan 18 2023
  • Sage
    (x*(2-x+2*x^2+x^3)/((1-x)*(1-x^4))).series(x, 80).coefficients(x, sparse=False) # G. C. Greubel, Apr 28 2019
    

Formula

a(n) = 4*floor(n/4) + a(n mod 4), for n > 3.
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 4. - Joerg Arndt, Mar 11 2013
a(n) = lod_2(A021913(n)). - Philippe Deléham, Apr 26 2009
From Wesley Ivan Hurt, May 28 2016: (Start)
a(n) = n + 1 + (1+i)*(2*i-2-(1-i)*i^(2*n) + i^(-n)-i^(1+n))/4 where i=sqrt(-1).
G.f.: x*(2-x+2*x^2+x^3) / ((1-x)^2*(1+x+x^2+x^3)). (End)
E.g.f.: (sin(x) + cos(x) + (2*x + 1)*sinh(x) + (2*x - 1)*cosh(x))/2. - Ilya Gutkovskiy, May 28 2016
From Guenther Schrack, Apr 23 2019: (Start)
a(n) = (2*n - (-1)^n + (-1)^(n*(n-1)/2))/2.
a(n) = a(n-4) + 4, a(0)=0, a(1)=2, a(2)=1, a(3)=3, for n > 3. (End)

Extensions

Typo in example fixed by Reinhard Zumkeller, Jul 06 2009

A047447 Numbers that are congruent to {2, 3, 5, 6} mod 8.

Original entry on oeis.org

2, 3, 5, 6, 10, 11, 13, 14, 18, 19, 21, 22, 26, 27, 29, 30, 34, 35, 37, 38, 42, 43, 45, 46, 50, 51, 53, 54, 58, 59, 61, 62, 66, 67, 69, 70, 74, 75, 77, 78, 82, 83, 85, 86, 90, 91, 93, 94, 98, 99, 101, 102, 106, 107, 109, 110, 114, 115, 117, 118, 122, 123
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n : n in [0..150] | n mod 8 in [2, 3, 5, 6]]; // Wesley Ivan Hurt, May 26 2016
  • Maple
    A047447:=n->(1+I)*(4*n-4*n*I+2*I-2-(1-I)*I^(2*n)+I^(1-n)-I^n)/4: seq(A047447(n), n=1..100); # Wesley Ivan Hurt, May 26 2016
  • Mathematica
    Table[(1+I)*(4n-4*n*I+2*I-2-(1-I)*I^(2n)+I^(1-n)-I^n)/4, {n, 80}] (* Wesley Ivan Hurt, May 26 2016 *)

Formula

G.f.: x*(2+x+2*x^2+x^3+2*x^4) / ( (1+x)*(x^2+1)*(x-1)^2 ). - R. J. Mathar, Dec 07 2011
From Wesley Ivan Hurt, May 26 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (1+i)*(4*n-4*n*i+2*i-2-(1-i)*i^(2*n)+i^(1-n)-i^n)/4 where i=sqrt(-1).
a(2k) = A047398(k), a(2k-1) = A047617(k). (End)
E.g.f.: (4 + sin(x) - cos(x) + (4*x - 1)*sinh(x) + (4*x - 3)*cosh(x))/2. - Ilya Gutkovskiy, May 27 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = (2-sqrt(2))*Pi/8. - Amiram Eldar, Dec 25 2021
Showing 1-10 of 18 results. Next