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 13 results. Next

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

A080455 a(1)=1; 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

1, 5, 9, 13, 13, 17, 21, 25, 25, 29, 33, 37, 37, 41, 45, 49, 49, 53, 57, 61, 61, 65, 69, 73, 73, 77, 81, 85, 85, 89, 93, 97, 97, 101, 105, 109, 109, 113, 117, 121, 121, 125, 129, 133, 133, 137, 141, 145, 145, 149, 153, 157, 157, 161, 165, 169, 169, 173
Offset: 1

Views

Author

N. J. A. Sloane, Mar 20 2003

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, 0, 0, 1, -1}, {1, 5, 9, 13, 13}, 58] (* Jean-François Alcover, Sep 21 2017 *)
  • PARI
    Vec(-x*(x^4-4*x^3-4*x^2-4*x-1)/((x-1)^2*(x+1)*(x^2+1)) + O(x^100)) \\ Colin Barker, Oct 16 2013

Formula

For m>=1, a(4m) = a(4m+1) = 12m+1, a(4m+2) = 12m+5, a(4m+3) = 12m+9.
Or, shorter: a(n) = 4*n+1- 4*floor((n+3)/4). - Benoit Cloitre, Mar 20 2003
From Colin Barker, Oct 16 2013: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5).
G.f.: -x*(x^4 - 4*x^3 - 4*x^2 - 4*x - 1) / ((x-1)^2*(x+1)*(x^2+1)). (End)

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

Original entry on oeis.org

2, 5, 7, 9, 12, 14, 17, 19, 22, 24, 26, 29, 31, 34, 36, 38, 41, 43, 46, 48, 50, 53, 55, 58, 60, 63, 65, 67, 70, 72, 75, 77, 79, 82, 84, 87, 89, 92, 94, 96, 99, 101, 104, 106, 108, 111, 113, 116, 118, 121, 123, 125, 128, 130, 133, 135, 137, 140, 142, 145
Offset: 1

Views

Author

N. J. A. Sloane, Mar 23 2003

Keywords

Comments

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

Crossrefs

Cf. A080455-A080458, A080036, A080037. Apart from start, equals A064437 - 1.

Programs

  • Magma
    [Floor(n*(1+Sqrt(2)) + 1/(1+(1+Sqrt(2)))): n in [1..60]]; // Vincenzo Librandi, Oct 02 2018
  • Mathematica
    a[1] = 2;
    a[n_] := a[n] = If[MemberQ[Array[a, n-1], n], a[n-1] + 3, a[n-1] + 2];
    Array[a, 60] (* Jean-François Alcover, Oct 01 2018 *)
    Table[Floor[n (1 + Sqrt[2]) + 1 / (1 + (1 + Sqrt[2]))], {n, 60}] (* Vincenzo Librandi, Oct 02 2018 *)
  • PARI
    a(n) = my(r=sqrt(2)+1); (r*(r+1)*n+1)\(r+1); \\ Altug Alkan, Oct 01 2018
    

Formula

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

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

A080457 a(1)=3; 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

3, 7, 7, 11, 15, 19, 19, 23, 27, 31, 31, 35, 39, 43, 43, 47, 51, 55, 55, 59, 63, 67, 67, 71, 75, 79, 79, 83, 87, 91, 91, 95, 99, 103, 103, 107, 111, 115, 115, 119, 123, 127, 127, 131, 135, 139, 139, 143, 147, 151, 151, 155, 159, 163, 163, 167, 171, 175
Offset: 1

Views

Author

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

Keywords

Crossrefs

Programs

  • Magma
    [3+4*(n-2-Floor((n-3)/4)) : n in [1..100]]; // Wesley Ivan Hurt, Jul 15 2015
    
  • Maple
    A080457:=n->3+4*(n-2-floor((n-3)/4)): seq(A080457(n), n=1..100); # Wesley Ivan Hurt, Jul 15 2015
  • Mathematica
    CoefficientList[Series[(3 + 4 x + 4 x^3 + x^4)/((x - 1)^2*(1 + x + x^2 + x^3)), {x, 0, 100}], x] (* Wesley Ivan Hurt, Jul 15 2015 *)
    LinearRecurrence[{1, 0, 0, 1, -1}, {3, 7, 7, 11, 15}, 70] (* Vincenzo Librandi, Jul 16 2015 *)
  • PARI
    main(size)={my(v=vector(size),i,j);v[1]=3;for(j=2,size,x=0;for(i=1,j-1,if(v[i]==j,x=1;break));if(x==1,v[j]=v[j-1],v[j]=v[j-1]+4));return(v);} /* Anders Hellström, Jul 15 2015 */

Formula

a(n) = 3 + 4*(n-2-floor((n-3)/4)).
From Wesley Ivan Hurt, Jul 15 2015: (Start)
G.f.: x*(3+4*x+4*x^3+x^4)/((x-1)^2*(1+x+x^2+x^3)).
a(n) = a(n-1)+a(n-4)-a(n-5), n>5.
a(n) = (6*n-1+(-1)^n-2*(-1)^((2*n+1-(-1)^n)/4))/2. (End)

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

Original entry on oeis.org

1, 5, 9, 13, 15, 19, 23, 27, 29, 33, 37, 41, 43, 47, 49, 53, 57, 61, 63, 67, 71, 75, 77, 81, 85, 89, 91, 95, 97, 101, 105, 109, 111, 115, 119, 123, 125, 129, 133, 137, 139, 143, 145, 149, 153, 157, 159, 163, 165, 169, 173, 177, 179, 183, 187, 191, 193
Offset: 1

Views

Author

N. J. A. Sloane, Mar 23 2003

Keywords

Comments

Also, positions of 0 in A284939; complement of A284941. - R. J. Mathar_, Apr 24 2017
Proof that this is the same as the positions of 0 in A284939, from Joe Slater, Apr 26 2017: (Start)
The sequence A284939 consists of a concatenation of the words 01 and 1101, each word representing a single term from the previous iteration of the transformation taken in order.
Because the sequence has reached its fixed point we don't need to compare these words to the terms of the previous iteration: we can actually relate the present iteration to itself.
Thus the following table relates terms of A284939 to its words. We would end up with the same sequence by concatenating either the terms or the words:
0 -> 01
1 -> 1101
1 -> 1101
1 -> 1101
0 -> 01
1 -> 1101
... ...
Consider any arbitrary term A284939(n) and its successor A284939(n+1) . They relate to the n-th and (n+1)-st words, and since neither of the possible words have sequential zeros there are only three possibilities for the two terms (0,1; 1,0; and 1,1) and therefore three possibilities for the words: 01 1101, 1101 01, or 1101 1101.
We can see that the only time there is a gap of three 1's between the first and second zeros will be when the two terms A284939(n) and A284939(n+1) are (1,0). Therefore, if the n-th zero of the sequence (corresponding to the term A284939(n)) is at position k, it will be followed by a zero at position k+2 if the term A284939(n+1)=0, but otherwise it will be followed by a zero at position k+4.
Let's relate this to the present sequence A080580:
We know sequence A284939 starts with a zero in position 1 (i.e., A284939(1)=0), so we can make a sequence S (say) listing the position of the zeros with S(1)=1. From our earlier discussion we know that the n-th zero of A284939 relates to the n-th term of A284939. Therefore, if S(n)=k, the following term S(n+1) will be +4 if A284939(n+1)=1 and +2 if A284939(n+1)=0.
But we don't actually need to refer to A284939 at all! When we come to S(n+1) we can just see whether n+1 appears in our sequence. If the number n+1 already appears in S then we know that A284939(n+1)=0, so S(n+1)=S(n)+2. If the number n+1 does not appear in S then we know that A284939(n+1)=1, so S(n+1)=S(n)+4.
This rule is exactly the rule of A080580, which means that A080580 and S are identical, and A080580 manages to predict the positions of the zeros in A284939 without ever referring to the sequence itself. QED
(End)
In the Fokkink-Joshi paper, this sequence is the Cloitre (0,1,2,4)-hiccup sequence. - Michael De Vlieger, Jul 29 2025

Crossrefs

Programs

  • Maple
    A080580 := proc(n)
        option remember;
        if n = 1 then
            1;
        else
            known := false ;
            for i from 1 to n-1 do
                if procname(i) = n then
                    known := true;
                    break;
                end if;
            end do:
            if known then
                procname(n-1)+2 ;
            else
                procname(n-1)+4 ;
            end if;
        end if;
    end proc:
    seq(A080580(n),n=1..100) ; # R. J. Mathar, Apr 25 2017
  • Mathematica
    a[1] = 1; a[n_] := a[n] = If[MemberQ[Array[a, n-1], n], a[n-1]+2, a[n-1]+4 ];
    Array[a, 60] (* Jean-François Alcover, Nov 23 2017 *)

Extensions

Edited by N. J. A. Sloane, Apr 27 2017

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

Original entry on oeis.org

1, 5, 9, 13, 16, 20, 24, 28, 31, 35, 39, 43, 46, 50, 54, 57, 61, 65, 69, 72, 76, 80, 84, 87, 91, 95, 99, 102, 106, 110, 113, 117, 121, 125, 128, 132, 136, 140, 143, 147, 151, 155, 158, 162, 166, 169, 173, 177, 181, 184, 188, 192, 196, 199, 203, 207
Offset: 1

Views

Author

N. J. A. Sloane, Mar 23 2003

Keywords

Comments

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

Crossrefs

Programs

  • Haskell
    a080590 n = a080590_list !! (n-1)
    a080590_list = 1 : f 2 [1] where
       f x zs@(z:_) = y : f (x + 1) (y : zs) where
         y = z + (if x `elem` zs then 3 else 4)
    -- Reinhard Zumkeller, Sep 26 2014
  • Mathematica
    a[n_] := a[n] = If[n == 1, 1, If[MemberQ[Array[a, n-1], n], a[n-1]+3, a[n-1]+4]]; Array[a, 56] (* Jean-François Alcover, Oct 05 2018 *)

A080600 a(n) = ceiling(n*(3 + sqrt(13))/2).

Original entry on oeis.org

0, 4, 7, 10, 14, 17, 20, 24, 27, 30, 34, 37, 40, 43, 47, 50, 53, 57, 60, 63, 67, 70, 73, 76, 80, 83, 86, 90, 93, 96, 100, 103, 106, 109, 113, 116, 119, 123, 126, 129, 133, 136, 139, 143, 146, 149, 152, 156, 159, 162, 166, 169, 172, 176, 179, 182, 185, 189
Offset: 0

Views

Author

N. J. A. Sloane, Mar 23 2003

Keywords

Comments

a(0)=0, a(1)=4; for n > 1, a(n) = a(n-1) + 4 if n is already in the sequence, a(n) = a(n-1) + 3 otherwise.
In the Fokkink-Joshi paper, this sequence is the Cloitre (0,4,4,3)-hiccup sequence. - Michael De Vlieger, Jul 29 2025

Crossrefs

Equals A080081 + 1 for n > 0. Cf. A080455-A080458, A080036, A080037.

Programs

  • Mathematica
    With[{c=(3+Sqrt[13])/2},Table[Ceiling[c*n],{n,0,60}]] (* Harvey P. Dale, Oct 30 2021 *)

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

Original entry on oeis.org

1, 5, 9, 13, 14, 18, 22, 26, 27, 31, 35, 39, 40, 41, 45, 49, 53, 54, 58, 62, 66, 67, 71, 75, 79, 80, 81, 85, 89, 93, 94, 98, 102, 106, 107, 111, 115, 119, 120, 121, 122, 126, 130, 134, 135, 139, 143, 147, 148, 152, 156, 160, 161, 162, 166, 170, 174, 175
Offset: 1

Views

Author

N. J. A. Sloane, Mar 23 2003

Keywords

Comments

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

Crossrefs

Programs

  • Haskell
    a080579 n = a080579_list !! (n-1)
    a080579_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 + 4
    -- Reinhard Zumkeller, Sep 26 2014
  • Mathematica
    a[1] = 1; a[n_] := a[n] = If[MemberQ[Array[a, n-1], n], a[n-1]+1, a[n-1]+4]; Array[a, 60] (* Jean-François Alcover, Oct 08 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.
Showing 1-10 of 13 results. Next