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.

Previous Showing 21-28 of 28 results.

A101677 a(n) = a(n-1) - 2*a(n-2) + 2*a(n-3) - 2*a(n-4) + 2*a(n-5) - a(n-6).

Original entry on oeis.org

1, 1, -1, -2, -2, -2, -1, -1, -3, -4, -4, -4, -3, -3, -5, -6, -6, -6, -5, -5, -7, -8, -8, -8, -7, -7, -9, -10, -10, -10, -9, -9, -11, -12, -12, -12, -11, -11, -13, -14, -14, -14, -13, -13, -15, -16, -16, -16, -15, -15, -17, -18, -18, -18, -17, -17, -19, -20, -20, -20, -19, -19, -21, -22, -22, -22, -21, -21, -23, -24, -24, -24, -23, -23, -25, -26, -26, -26, -25, -25, -27
Offset: 0

Views

Author

Paul Barry, Dec 11 2004

Keywords

Comments

Partial sums of A101676, second partial sums of A101675.

Programs

  • Magma
    m:=100; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x-x^2)/((1-x)^2*(1+x^2+x^4)))); // G. C. Greubel, Sep 07 2018
  • Mathematica
    LinearRecurrence[{2, -2, 2, -2, 2, -1},{1, 1, -1, -2, -2, -2},81] (* Ray Chandler, Sep 03 2015 *)
    CoefficientList[Series[(1-x-x^2)/((1-x)^2(1+x^2+x^4)),{x,0,80}],x] (* Harvey P. Dale, Dec 02 2021 *)
  • PARI
    x='x+O('x^100); Vec((1-x-x^2)/((1-x)^2*(1+x^2+x^4))) \\ G. C. Greubel, Sep 07 2018
    

Formula

G.f.: (1-x-x^2)/((1-x)^2*(1+x^2+x^4)).
a(n) = 2*sqrt(3)*sin(2*Pi*n/3)/9 + cos(Pi*n/3) + sin(Pi*n/3)/sqrt(3) - n/3.
a(3*(n+1)) = -A014681(n+1); a(3*n) = a(3*n+1) = 0^n -A014681(n); a(3*n+2) = -(n+1).

A135682 a(n)=n if n=1 or if n=prime. Otherwise, n=4 if n is even and n=7 if n is odd.

Original entry on oeis.org

1, 2, 3, 4, 5, 4, 7, 4, 7, 4, 11, 4, 13, 4, 7, 4, 17, 4, 19, 4, 7, 4, 23, 4, 7, 4, 7, 4, 29, 4, 31, 4, 7, 4, 7, 4, 37, 4, 7, 4, 41, 4, 43, 4, 7, 4, 47, 4, 7, 4, 7, 4, 53, 4, 7, 4, 7, 4, 59, 4, 61, 4, 7, 4, 7, 4, 67, 4, 7, 4, 71, 4, 73
Offset: 1

Views

Author

Mohammad K. Azarian, Dec 01 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[PrimeQ[n] || n == 1, n, If[EvenQ[n], 4, 7] ]; Table[a[n], {n,1,25}] (* G. C. Greubel, Oct 26 2016 *)

A135684 a(n)=11 if n is a prime number. Otherwise, a(n)=n.

Original entry on oeis.org

1, 11, 11, 4, 11, 6, 11, 8, 9, 10, 11, 12, 11, 14, 15, 16, 11, 18, 11, 20, 21, 22, 11, 24, 25, 26, 27, 28, 11, 30, 11, 32, 33, 34, 35, 36, 11, 38, 39, 40, 11, 42, 11, 44, 45, 46, 11, 48, 49, 50, 51, 52, 11, 54, 55, 56, 57, 58, 11
Offset: 1

Views

Author

Mohammad K. Azarian, Dec 01 2007

Keywords

Crossrefs

Programs

  • Magma
    [IsPrime(n) select 11 else n: n in [1..70]]; // Vincenzo Librandi, Feb 22 2013
  • Mathematica
    Table[If[PrimeQ[n], 11, n], {n, 70}] (* Vincenzo Librandi, Feb 22 2013 *)

A167419 Exchange adjacent nonprimes and primes.

Original entry on oeis.org

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

Views

Author

Giovanni Teofilatto, Nov 03 2009

Keywords

Comments

If we have consecutive numbers, one prime and one nonprime, swap them. So after the initial 2,1,4,3,6,5,8,7 we have "if n is prime, a(n) = n-1; if n+1 is prime, a(n) = n+1, otherwise a(n) = n".

Crossrefs

Cf. A014681.

Programs

  • Mathematica
    a[n_]:=If[PrimeQ[n],n-1,If[PrimeQ[n+1],n+1,n]]; Join[{2,1,4,3,6,5,8,7},Array[a,65,9]] (* Stefano Spezia, May 05 2023 *)

Extensions

Edited by Franklin T. Adams-Watters, Nov 04 2009
42 and 64 inserted by Stefano Spezia, May 05 2023

A167542 Natural numbers, swapped in pairs, with decimal digits reversed.

Original entry on oeis.org

2, 1, 4, 3, 6, 5, 8, 7, 1, 9, 21, 11, 41, 31, 61, 51, 81, 71, 2, 91, 22, 12, 42, 32, 62, 52, 82, 72, 3, 92, 23, 13, 43, 33, 63, 53, 83, 73, 4, 93, 24, 14, 44, 34, 64, 54, 84, 74, 5, 94, 25, 15, 45, 35, 65, 55, 85, 75, 6, 95, 26, 16, 46, 36, 66, 56, 86, 76, 7, 96, 27, 17, 47, 37, 67
Offset: 1

Views

Author

Giovanni Teofilatto, Nov 06 2009

Keywords

Programs

  • Maple
    read("transforms") ; A014681 := proc(n) option remember; if n <= 3 then op(n+1,[0,2,1,4]) ; else procname(n-1)+procname(n-2)-procname(n-3) ; end if; end proc: A167542 := proc(n) digrev(A014681(n)) ; end proc: seq(A167542(n),n=1..120) ; # R. J. Mathar, Jan 30 2010

Extensions

All terms from a(18) on corrected by R. J. Mathar, Jan 30 2010

A317630 Lexicographically first sequence of different terms, starting with a(1) = 0 and showing a 1-step roller coaster of terms together with a 1-step roller coaster of digits (see the Comments section).

Original entry on oeis.org

0, 2, 1, 4, 3, 6, 5, 8, 7, 80, 9, 13, 12, 15, 14, 17, 16, 19, 18, 24, 23, 26, 25, 28, 27, 34, 29, 36, 35, 38, 37, 45, 39, 47, 46, 49, 48, 57, 56, 59, 58, 68, 67, 120, 10, 21, 20, 31, 30, 40, 32, 42, 41, 50, 43, 52, 51, 54, 53, 61, 60, 63, 62, 65, 64, 71, 70, 73, 72, 75, 74, 81, 76, 83, 82, 85, 84, 87, 86, 91, 90, 93, 92, 95
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Aug 02 2018

Keywords

Comments

Every term a(n) > 0 of the sequence stands between two terms bigger than a(n) or between two terms smaller than a(n); this is also true for every digit d > 0 of the sequence that stands between two digits bigger than d or between two digits smaller than d.

Examples

			The sequence starts with 0,2,1,4,3,6,5,8,7,80,9,13,12,15,14,17,16,19...
If we consider the terms, we see indeed that 0 < 2 > 1 < 4 > 3 < 6 > 5 < 8 > 7 < 80 > 9 < 13 > 12 < 15 > 14 < 17 > 16 < 19... and if we consider the digits, we see also that 0 < 2 > 1 < 4 > 3 < 6 > 5 < 8 > 7 < 8 > 0 < 9 > 1 < 3 > 1 < 2 > 1 < 5 > 1 < 4 > 1 < 7 > 1 < 6 > 1 < 9...
So no matter the elements considered (terms, digits), those elements seem to ride on a 1-step roller-coaster: up, down, up, down, up, etc.
		

Crossrefs

Cf. A014681 (a 1-step roller coaster of terms only) and A317548 (a 1-step roller coaster of digits only).

A354522 Square array A(n, k), n, k >= 0, read by antidiagonals; A(n, k) = g(f(n) + f(k)) where f denotes A001057 and g denotes its inverse.

Original entry on oeis.org

0, 1, 1, 2, 3, 2, 3, 0, 0, 3, 4, 5, 4, 5, 4, 5, 2, 1, 1, 2, 5, 6, 7, 6, 7, 6, 7, 6, 7, 4, 3, 0, 0, 3, 4, 7, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 6, 5, 2, 1, 1, 2, 5, 6, 9, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 8, 7, 4, 3, 0, 0, 3, 4, 7, 8, 11, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12
Offset: 0

Views

Author

Rémy Sigrist, Sep 14 2022

Keywords

Comments

This sequence is directly related to A355278.
The function f is a bijection from the nonnegative integers to the integers (Z).
The nonnegative integers, together with (x,y) -> A(x,y), form an abelian group isomorph to the additive group Z (f and g act as isomorphisms).
As a consequence, each row and each column is a permutation of the nonnegative integers.

Examples

			Array A(n, k) begins:
  n\k |  0   1   2   3   4   5   6   7   8   9  10  11  12
  ----+---------------------------------------------------
    0 |  0   1   2   3   4   5   6   7   8   9  10  11  12
    1 |  1   3   0   5   2   7   4   9   6  11   8  13  10
    2 |  2   0   4   1   6   3   8   5  10   7  12   9  14
    3 |  3   5   1   7   0   9   2  11   4  13   6  15   8
    4 |  4   2   6   0   8   1  10   3  12   5  14   7  16
    5 |  5   7   3   9   1  11   0  13   2  15   4  17   6
    6 |  6   4   8   2  10   0  12   1  14   3  16   5  18
    7 |  7   9   5  11   3  13   1  15   0  17   2  19   4
    8 |  8   6  10   4  12   2  14   0  16   1  18   3  20
    9 |  9  11   7  13   5  15   3  17   1  19   0  21   2
   10 | 10   8  12   6  14   4  16   2  18   0  20   1  22
   11 | 11  13   9  15   7  17   5  19   3  21   1  23   0
   12 | 12  10  14   8  16   6  18   4  20   2  22   0  24
		

Crossrefs

Programs

  • PARI
    f(n) = - (-1)^n * ((n+1)\2)
    g(n) = if (n<=0, -2*n, 2*n-1)
    A(n, k) = g(f(n) + f(k))

Formula

A355278(n+1, k+1) = prime(1 + A(n, k)) (where prime(m) denotes the m-th prime number).
A(n, k) = A(k, n).
A(n, 0) = n.
A(n, A014681(n)) = 0.
A(m, A(n, k)) = A(A(m, n), k).
A(n, n) = A014601(n).
A(n, A(n, n)) = A047264(n+1).
A(A(n, n), A(n, n)) = A047521(n+1).

A132293 Maximal number of right angles in an n-gon.

Original entry on oeis.org

1, 4, 3, 4, 5, 6
Offset: 3

Views

Author

Asher Stuhlman (asherstuhlman(AT)gmail.com), Nov 06 2007

Keywords

Comments

A proper definition is needed for this sequence.
Conjecture from R. J. Mathar, Mar 07 2008, Apr 21 2008: (Start)
The correct sequence is a(n)=A014681(n-1), because a polyomino with a zigzag "stair" shape along a diagonal provides a solution where the number of right angles equals the number of edges:
┌─────────┐
|. . . . .|
| ┘
|. . . . .
|
|. .|
| ┌─┘
|.|
└─┘
(End)
Possibly an incorrect version of A049008. - Michal Paulovic, Sep 27 2023

Examples

			The first (n=3) integer in this sequence is 1 because a triangle cannot have more than one right angle.
		

Crossrefs

Cf. A049008.
Previous Showing 21-28 of 28 results.