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.

A080578 a(1)=1; for n > 1, a(n) = a(n-1) + 1 if n is already in the sequence, a(n) = a(n-1) + 3 otherwise.

Original entry on oeis.org

1, 4, 7, 8, 11, 14, 15, 16, 19, 22, 23, 26, 29, 30, 31, 32, 35, 38, 39, 42, 45, 46, 47, 50, 53, 54, 57, 60, 61, 62, 63, 64, 67, 70, 71, 74, 77, 78, 79, 82, 85, 86, 89, 92, 93, 94, 95, 98, 101, 102, 105, 108, 109, 110, 113, 116, 117, 120, 123, 124, 125, 126
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Mar 23 2003

Keywords

Comments

More generally for fixed r, there is a nice connection between the sequence a(1)=1, a(n) = a(n-1) + 1 if n is in the sequence, a(n) = a(n-1) + r + 1 otherwise and the so-called metafibonacci sequences. Indeed, (a(n)-n)/r is a generalized metafibonacci sequence of order r as defined in Ruskey's recent paper (reference given at A046699). - Benoit Cloitre, Feb 04 2007
In the Fokkink-Joshi paper, this sequence is the Cloitre (0,1,1,3)-hiccup sequence. - Michael De Vlieger, Jul 29 2025

Crossrefs

Programs

  • Haskell
    a080578 n = a080578_list !! (n-1)
    a080578_list = 1 : f 2 [1] where
       f x zs@(z:_) = y : f (x + 1) (y : zs) where
         y = if x `elem` zs then z + 1 else z + 3
    -- Reinhard Zumkeller, Sep 26 2014
    
  • Mathematica
    l={1}; a=1; For[n=2, n<=100, If[MemberQ[l, n], a=a+1, a=a+3]; AppendTo[l, a]; n++]; l (* Indranil Ghosh, Apr 07 2017 *)
  • PARI
    a(n)=if(n<2,1,a(n+1-2^floor(log(n)/log(2)))+2*2^floor(log(n)/log(2))-1) \\ Benoit Cloitre, Feb 04 2007
    
  • Python
    l=[1]
    a=1
    for n in range(2, 101):
        a += 3 if n not in l else 1
        l.append(a)
    print(l) # Indranil Ghosh, Apr 07 2017

Formula

a(n) = 2n + O(1); a(2^n) = 2^(n+1). - Benoit Cloitre, Oct 12 2003
a(1) = 1, for n >= 2 a(n) = a(n + 1 - 2^floor(log(n)/log(2))) + 2*2^floor(log(n)/log(2)) - 1; (a(n) - n)/2 = A046699(n) for n >= 2. - Benoit Cloitre, Feb 04 2007
a(n) = A055938(n-1) + 2 (conjectured). - Ralf Stephan, Dec 27 2013

A080458 a(1)=4; for n>1, a(n)=a(n-1) if n is already in the sequence, a(n)=a(n-1)+4 otherwise.

Original entry on oeis.org

4, 8, 12, 12, 16, 20, 24, 24, 28, 32, 36, 36, 40, 44, 48, 48, 52, 56, 60, 60, 64, 68, 72, 72, 76, 80, 84, 84, 88, 92, 96, 96, 100, 104, 108, 108, 112, 116, 120, 120, 124, 128, 132, 132, 136, 140, 144, 144, 148, 152, 156, 156, 160, 164, 168, 168, 172, 176
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Mar 20 2003

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, 0, 0, 1, -1}, {4, 8, 12, 12, 16}, 60] (* Jean-François Alcover, Sep 20 2018 *)
  • PARI
    a(n) = 4 + 4*(n-2-(n-4)\4); \\ Michel Marcus, May 06 2016

Formula

a(n) = 4 + 4*(n-2-floor((n-4)/4)).
From Chai Wah Wu, Jul 17 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
G.f.: 4*x*(x^2 + x + 1)/(x^5 - x^4 - x + 1). (End)
From Ilya Gutkovskiy, Jul 17 2016: (Start)
E.g.f.: (3*x + 1)*cosh(x) + (3*x + 2)*sinh(x) - cos(x) - sin(x).
a(n) = (6*n - (-1)^n - 2*sqrt(2)*sin(Pi*n/2+Pi/4) + 3)/2. (End)

A080456 a(1) = a(2) = 2; for n > 2, a(n) = a(n-1) if n is already in the sequence, a(n) = a(n-1) + 4 otherwise.

Original entry on oeis.org

2, 2, 6, 10, 14, 18, 18, 22, 26, 30, 30, 34, 38, 42, 42, 46, 50, 54, 54, 58, 62, 66, 66, 70, 74, 78, 78, 82, 86, 90, 90, 94, 98, 102, 102, 106, 110, 114, 114, 118, 122, 126, 126, 130, 134, 138, 138, 142, 146, 150, 150, 154, 158, 162, 162, 166, 170, 174, 174
Offset: 1

Views

Author

N. J. A. Sloane, Mar 20 2003

Keywords

Comments

First differences are 4-periodic.

Crossrefs

Programs

  • Mathematica
    Join[{2}, LinearRecurrence[{1, 0, 0, 1, -1}, {6, 10, 14, 18, 18}, 60]] (* Jean-François Alcover, Sep 02 2018 *)
    CoefficientList[Series[-2*(-1 - 2 x^2 - 2 x^3 - x^4 - 2 x^5 + 2 x^6)/((-1 + x)^2 (1 + x +x^2 + x^3)), {x, 0, 60}],x] (* Stefano Spezia, Sep 02 2018 *)

Formula

From Chai Wah Wu, Jul 17 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 6.
G.f.: -2*(-1 - 2*x^2 - 2*x^3 - x^4 - 2*x^5 + 2*x^6)/((-1 + x)^2*(1 + x + x^2 + x^3)). (End)

Extensions

a(1) = 2 prepended by Stefano Spezia, Sep 04 2018

A080667 a(1)=3; for n>1, a(n)=a(n-1)+4 if n is already in the sequence, a(n)=a(n-1)+3 otherwise.

Original entry on oeis.org

3, 6, 10, 13, 16, 20, 23, 26, 29, 33, 36, 39, 43, 46, 49, 53, 56, 59, 62, 66, 69, 72, 76, 79, 82, 86, 89, 92, 96, 99, 102, 105, 109, 112, 115, 119, 122, 125, 129, 132, 135, 138, 142, 145, 148, 152, 155, 158, 162, 165, 168, 171, 175, 178, 181, 185, 188
Offset: 1

Views

Author

N. J. A. Sloane, Mar 23 2003

Keywords

Comments

In the Fokkink-Joshi paper, this sequence is the Cloitre (0,3,4,3)-hiccup sequence. - Michael De Vlieger, Jul 29 2025

Crossrefs

Programs

  • Mathematica
    a[1] = 3; a[n_] := a[n] = a[n-1] + If[MemberQ[Array[a, n-1], n], 4, 3];
    Array[a, 60] (* Jean-François Alcover, Nov 25 2018 *)

Formula

a(n) = floor(n*r + 1/(1+r)) where r = (3 + sqrt(13))/2.

A080460 a(1) = 2; for n > 1, a(n) = a(n-1) if n is already in the sequence, a(n) = a(n-1) + 4 otherwise.

Original entry on oeis.org

2, 2, 6, 10, 14, 14, 18, 22, 26, 26, 30, 34, 38, 38, 42, 46, 50, 50, 54, 58, 62, 62, 66, 70, 74, 74, 78, 82, 86, 86, 90, 94, 98, 98, 102, 106, 110, 110, 114, 118, 122, 122, 126, 130, 134, 134, 138, 142, 146, 146, 150, 154, 158, 158, 162, 166, 170, 170
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Mar 22 2003

Keywords

Crossrefs

Programs

Formula

a(n) = 2 + 4*(n - 2 - floor((n - 2)/4)).
From Chai Wah Wu, Jul 17 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
G.f.: 2*x*(x^4 + 2*x^3 + 2*x^2 + 1)/(x^5 - x^4 - x + 1). (End)
From Ilya Gutkovskiy, Jul 17 2016: (Start)
E.g.f.: 2 + (3*x - 2)*sinh(x) + 3*(x - 1)*cosh(x) + sin(x) + cos(x).
a(n) = (6*n - (-1)^n + 2*sqrt(2)*sin(Pi*n/2 + Pi/4) - 5)/2. (End)
Showing 1-5 of 5 results.