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

A074066 Zigzag modulo 3.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 17 2002

Keywords

Comments

Take natural numbers, exchange trisections starting with 2 and 4.

Crossrefs

Programs

  • Haskell
    a074066 n = a074066_list !! (n-1)
    a074066_list = 1 : xs where xs = 4 : 3 : 2 : map (+ 3) xs
    -- Reinhard Zumkeller, Feb 21 2011
  • Mathematica
    a[n_] := n + Mod[n, 3]*(3*Mod[n, 3] - 5); a[1] = 1; Table[a[n], {n, 1, 69}] (* Jean-François Alcover, Nov 04 2011 *)
    Join[{1},Flatten[Reverse/@Partition[Range[2,73],3]]] (* Harvey P. Dale, Feb 17 2012 *)

Formula

a(1)=1; for n>0: a(3*n-1) = 3*n+1, a(3*n) = 3*n, a(3*n+1) = 3*n-1.
a(a(n))=n (self-inverse permutation); for n>1: a(n) = n iff n == 0 modulo 3.
For n > 1: a(n) = 3*floor(n/3) + (n mod 3)^2 * (-1)^(n mod 3); a(1)=1.
a(n) = a(n-1) + a(n-3) - a(n-4) for n > 5. - Chai Wah Wu, May 25 2016
For n > 1, a(n) = n - (4/sqrt(3))*sin(2*n*Pi/3). - Wesley Ivan Hurt, Sep 29 2017
g.f.: x + x^2*(4-x-x^2+x^3) / ( (1+x+x^2)*(x-1)^2 ). - R. J. Mathar, May 22 2019
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2) (A002162). - Amiram Eldar, Dec 24 2023

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