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-5 of 5 results.

A064429 a(n) = floor(n / 3) * 3 + sign(n mod 3) * (3 - n mod 3).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 15 2001

Keywords

Comments

a(a(n)) = n (a self-inverse permutation).
Take natural numbers, exchange trisections starting with 1 and 2.
Lodumo_3 of A080425. - Philippe Deléham, Apr 26 2009
From Franck Maminirina Ramaharo, Jul 27 2018: (Start)
The sequence is A008585 interleaved with A016789 and A016777.
a(n) is also obtained as follows: write n in base 3; if the rightmost digit is '1', then replace it with '2' and vice versa; convert back to decimal. For example a(14) = a('11'2') = '11'1' = 13 and a(10) = a('10'1') = '10'2' = 11. (End)
A permutation of the nonnegative integers partitioned into triples [3*k-3, 3*k-1, 3*k-2] for k > 0. - Guenther Schrack, Feb 05 2020

Examples

			From _Franck Maminirina Ramaharo_, Jul 27 2018: (Start)
Interleave 3 sequences:
A008585: 0.....3.....6.....9.......12.......15........
A016789: ..2.....5.....8.....11.......14.......17.....
A016777: ....1.....4.....7......10.......13.......16..
(End)
		

Crossrefs

Programs

  • GAP
    a:=[0,2,1,3];; for n in [5..100] do a[n]:=a[n-1]+a[n-3]-a[n-4]; od; a; # Muniru A Asiru, Jul 27 2018
    
  • Magma
    [2*n - 3 - 3*((n-2) div 3): n in [0..80]]; // Vincenzo Librandi, Aug 05 2018
  • Maple
    A064429:=n->2*n-3-3*floor((n-2)/3): seq(A064429(n), n=0..100); # Wesley Ivan Hurt, Nov 30 2013
  • Mathematica
    Table[2 n - 3 - 3 Floor[(n - 2)/3], {n, 0, 100}] (* Wesley Ivan Hurt, Nov 30 2013 *)
    {#+1,#-1,#}[[Mod[#,3,1]]]&/@Range[0, 100] (* Federico Provvedi, May 11 2021 *)
    LinearRecurrence[{1,0,1,-1},{0,2,1,3},80] (* or *) {#[[1]],#[[3]],#[[2]]}&/@Partition[Range[0,80],3]//Flatten (* Harvey P. Dale, Mar 28 2025 *)
  • PARI
    a(n) = 2*n-3-3*((n-2)\3); \\ Altug Alkan, Oct 06 2017
    

Formula

a(n) = A080782(n+1) - 1.
a(n) = n - 2*sin(4*Pi*n/3)/sqrt(3). - Jaume Oliver Lafont, Dec 05 2008
a(n) = A001477(n) + A102283(n). - Jaume Oliver Lafont, Dec 05 2008
a(n) = lod_3(A080425(n)). - Philippe Deléham, Apr 26 2009
G.f.: x*(2 - x + 2*x^2)/((1 + x + x^2)*(1 - x)^2 ). - R. J. Mathar, Feb 20 2011
a(n) = 2*n - 3 - 3*floor((n-2)/3). - Wesley Ivan Hurt, Nov 30 2013
a(n) = a(n-1) + a(n-3) - a(n-4) for n > 3. - Wesley Ivan Hurt, Oct 06 2017
E.g.f.: x*exp(x) + (2*sin((sqrt(3)*x)/2))/(exp(x/2)*sqrt(3)). - Franck Maminirina Ramaharo, Jul 27 2018
From Guenther Schrack, Feb 05 2020: (Start)
a(n) = a(n-3) + 3 with a(0)=0, a(1)=2, a(2)=1 for n > 2;
a(n) = n + (w^(2*n) - w^n)*(1 + 2*w)/3 where w = (-1 + sqrt(-3))/2. (End)
Sum_{n>=1} (-1)^n/a(n) = log(2)/3. - Amiram Eldar, Jan 31 2023

A092486 Take natural numbers, exchange first and third quadrisection.

Original entry on oeis.org

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

Views

Author

Ralf Stephan, Apr 04 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Flatten[Partition[Range[80],4]/.{a_,b_,c_,d_}->{c,b,a,d}] (* Harvey P. Dale, Aug 12 2012 *)
  • PARI
    { f="b092486.txt"; for (n=0, 5000, a0=4*n + 3; a1=a0 - 1; a2=a1 - 1; a3=a0 + 1; write(f, 4*n, " ", a0); write(f, 4*n+1, " ", a1); write(f, 4*n+2, " ", a2); write(f, 4*n+3, " ", a3); ); } \\ Harry J. Smith, Jun 21 2009

Formula

G.f.: (3-4*x+3*x^2)/((1+x^2)*(1-x)^2).
a(4n) = 4n+3, a(4n+1) = 4n+2, a(4n+2) = 4n+1, a(4n+3) = 4n+4.
a(n) = n+1+i^n+(-i)^n, where i is the imaginary unit. - Bruno Berselli, Feb 08 2011
From Wesley Ivan Hurt, May 09 2021: (Start)
a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-a(n-4).
a(n) = 1 + n + 2*cos(n*Pi/2). (End)
Sum_{n>=0} (-1)^n/a(n) = log(2) (A002162). - Amiram Eldar, Nov 28 2023

A330396 Permutation of the nonnegative integers partitioned into triples [3*k+2, 3*k+1, 3*k] for k >= 0.

Original entry on oeis.org

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

Views

Author

Guenther Schrack, Mar 03 2020

Keywords

Comments

Partition the nonnegative integer sequence into triples starting with (0,1,2); transpose the first and third elements of the triple, repeat for all triples.
A self-inverse sequence: a(a(n)) = n.
The sequence is an interleaving of A016789 with A016777 and with A008585, in that order.

Crossrefs

Fixed point sequence: A016777.
Relationships:
a(n) = a(n-1) - 1 + 6*A079978(n).
a(n) = 2*a(n-1) - a(n-2) + 6*A049347(n).
a(n) = A074066(n+2) - 2.
a(n) = A113655(n+1) - 1.

Programs

  • MATLAB
    a = zeros(1,10000);
    w = (-1+sqrt(-3))/2;
    fprintf('0 2\n');
    for n = 1:10000
       a(n) = int64((3*n + 2*w^(2*n)*(w + 2) + 2*w^n*(1 - w))/3);
       fprintf('%i %i\n',n,a(n));
    end

Formula

G.f.: (2 - x - x^2 + 3*x^3)/((x-1)^2*(1 + x + x^2)). [corrected by Georg Fischer, Apr 17 2020]
Linear recurrence: a(n) = a(n-1) + a(n-3) - a(n-4) for n > 4.
Simple recursion: a(n) = a(n-3) + 3 for n > 2 with a(0) = 2, a(1) = 1, a(2) = 0.
Negative domain: a(-n) = -(a(n-1) + 1).
Explicit formulas:
a(n) = n + 2 - 2*(n mod 3).
a(n) = 2 - n + 6*floor(n/3).
a(n) = n + 2*(w^(2*n)*(2 + w) + w^n*(1 - w))/3 where w = (-1 + sqrt(-3))/2.

A074067 Zigzag modulo 5.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 17 2002

Keywords

Crossrefs

Programs

  • Haskell
    a074067 n = a074067_list !! (n-1)
    a074067_list = 1 : 2 : xs where xs = 7 : 6 : 5 : 4 : 3 : map (+ 5) xs
    -- Reinhard Zumkeller, Feb 21 2011
  • Mathematica
    {1, 2}~Join~Flatten[Reverse /@ Partition[Range[3, 72], 5]] (* after Harvey P. Dale at A074066, or *)
    {1, 2}~Join~Table[5 Floor[n/5] + 10 Floor[#/3] - # &@ Mod[n, 5], {n, 3, 69}] (* Michael De Vlieger, May 25 2016 *)
    LinearRecurrence[{1,0,0,0,1,-1},{1,2,7,6,5,4,3,12},70] (* Harvey P. Dale, Jun 18 2025 *)

Formula

a(a(n)) = n (a self-inverse permutation).
For n > 1: a(n) = n iff n == 0 modulo 5.
a(n) = 5*floor(n/5) + 10*floor((n mod 5)/3) - (n mod 5) for n > 2; a(n) = n for n <= 2.
a(n) = a(n-1) + a(n-5) - a(n-6) for n > 8. - Chai Wah Wu, May 25 2016
G.f.: x+2*x + x^3*(7-x-x^2-x^3-x^4+2*x^5) / ( (x^4+x^3+x^2+x+1)*(x-1)^2 ). - R. J. Mathar, May 22 2019
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2) (A002162). - Amiram Eldar, May 11 2025

A074068 Zigzag modulo 7.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 17 2002

Keywords

Crossrefs

Programs

  • Haskell
    a074068 n = a074068_list !! (n-1)
    a074068_list = 1 : 2 : 3 : xs where
       xs = 10 : 9 : 8 : 7 : 6 : 5 : 4 : map (+ 7) xs
    -- Reinhard Zumkeller, Feb 21 2011
  • Mathematica
    Range[3]~Join~Flatten[Reverse /@ Partition[Range[4, 73], 7]] (* after Harvey P. Dale at A074066, or *)
    Range[3]~Join~Table[7 Floor[n/7] + 14 Floor[#/4] - # &@ Mod[n, 7], {n, 4, 69}] (* Michael De Vlieger, May 25 2016 *)
    LinearRecurrence[{1,0,0,0,0,0,1,-1},{1,2,3,10,9,8,7,6,5,4,17},80] (* Harvey P. Dale, Jan 19 2025 *)

Formula

a(a(n)) = n (a self-inverse permutation).
For n > 1: a(n) = n iff n == 0 modulo 7.
a(n) = 7*floor(n/7) + 14*floor((n mod 7)/4) - (n mod 7) for n > 3; a(n) = n for n <= 3.
a(n) = a(n-1) + a(n-7) - a(n-8) for n > 11. - Chai Wah Wu, May 25 2016
G.f.: x+2*x^2+3*x^3 + x^4*(10-x-x^2-x^3-x^4-x^5-x^6+3*x^7) / ( (x^6+x^5+x^4+x^3+x^2+x+1)*(x-1)^2 ). - R. J. Mathar, May 22 2019
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2) (A002162). - Amiram Eldar, May 11 2025
Showing 1-5 of 5 results.