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

A079000 a(n) is taken to be the smallest positive integer greater than a(n-1) which is consistent with the condition "n is a member of the sequence if and only if a(n) is odd".

Original entry on oeis.org

1, 4, 6, 7, 8, 9, 11, 13, 15, 16, 17, 18, 19, 20, 21, 23, 25, 27, 29, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 95, 97
Offset: 1

Views

Author

Matthew Vandermast, Feb 01 2003

Keywords

Comments

a(a(n)) = 2n + 3 for n>1.

Examples

			a(2) cannot be 2 because 2 is even; it cannot be 3 because that would require 2 to be a member of the sequence. Hence a(2)=4 and the next odd member of the sequence is the fourth member.
		

References

  • Hsien-Kuei Hwang, S Janson, TH Tsai, Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications, Preprint, 2016; http://140.109.74.92/hk/wp-content/files/2016/12/aat-hhrr-1.pdf. Also Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications, ACM Transactions on Algorithms, 13:4 (2017), #47; DOI: 10.1145/3127585
  • N. J. A. Sloane, Seven Staggering Sequences, in Homage to a Pied Puzzler, E. Pegg Jr., A. H. Schoen and T. Rodgers (editors), A. K. Peters, Wellesley, MA, 2009, pp. 93-110.

Crossrefs

Partial sums give A080566. Differences give A079948.

Programs

  • Maple
    Digits := 50; A079000 := proc(n) local k,j; if n<=2 then n^2; else k := floor(evalf(log( (n+3)/6 )/log(2)) ); j := n-(9*2^k-3); 12*2^k-3+3*j/2 +abs(j)/2; fi; end;
    A002264 := n->floor(n/3): A079944 := n->floor(log[2](4*(n+2)/3))-floor(log[2](n+2)): A000523 := n->floor(log[2](n)): f := n->A079944(A002264(n-4)): g := n->A000523(A002264(n+2)/2): A079000 := proc(n) if n>3 then RETURN(simplify(3*n+3-3*2^g(n)+(-1)^f(n)*(9*2^g(n)-n-3))/2) else if n>0 then RETURN([1,4,6][n]) else RETURN(0) fi fi: end;
  • Mathematica
    a[1] = 1; a[n_] := (k = Floor[Log[2, (n+3)/6]]; j = n-(9*2^k - 3); 12*2^k-3 + 3*j/2 + Abs[j]/2); Table[a[n], {n, 1, 71}] (* Jean-François Alcover, May 21 2012, after Maple *)

Formula

a(1) = 1, a(2) = 4, then a(9*2^k-3+j) = 12*2^k-3+3*j/2+|j|/2 for k>=0, -3*2^k <= j <= 3*2^k. Also a(3n) = 3*b(n/3), a(3n+1) = 2*b(n)+b(n+1), a(3n+2) = b(n)+2*b(n+1) for n>=2, where b = A079905. - N. J. A. Sloane and Benoit Cloitre, Feb 20 2003
a(n+1) - 2*a(n) + a(n-1) = 1 for n = 9*2^k - 3, k>=0, = -1 for n = 2 and 3*2^k-3, k>=1 and = 0 otherwise.
a(n) = (3*n + 3 - 3*2^g(n) + (-1)^f(n)*(9*2^g(n) - n - 3))/2 for n>3, f(n) = A079944(A002264(n-4)) and g(n) = A000523(A002264(n+2)/2). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 23 2003
Also a(n) = n + 3*2^A000523(A002264(n+2)/2)*(1 - 3*A080584(n-4)) + A080584(n-4)*(n+3) for n>3, where A080584(n)=A079944(A002264(n)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 24 2003

A007066 a(n) = 1 + ceiling((n-1)*phi^2), phi = (1+sqrt(5))/2.

Original entry on oeis.org

1, 4, 7, 9, 12, 15, 17, 20, 22, 25, 28, 30, 33, 36, 38, 41, 43, 46, 49, 51, 54, 56, 59, 62, 64, 67, 70, 72, 75, 77, 80, 83, 85, 88, 91, 93, 96, 98, 101, 104, 106, 109, 111, 114, 117, 119, 122, 125, 127, 130, 132, 135, 138, 140, 143, 145, 148, 151, 153, 156, 159, 161, 164, 166
Offset: 1

Views

Author

Keywords

Comments

First column of dual Wythoff array, A126714.
Positions of 0's in A189479.
Skala (2016) asks if this sequence also gives the positions of the 0's in A283310. - N. J. A. Sloane, Mar 06 2017
Upper Wythoff sequence plus 2, when shifted by 1. - Michel Dekking, Aug 26 2019
In the Fokkink-Joshi paper, this sequence is the Cloitre (0,1,2,3)-hiccup sequence, i.e., a(1) = 1; for m < n, a(n) = a(n-1)+2 if a(m) = n, else a(n) = a(n-1)+3. - Michael De Vlieger, Jul 30 2025

References

  • Clark Kimberling, "Stolarsky interspersions," Ars Combinatoria 39 (1995) 129-138.
  • D. R. Morrison, "A Stolarsky array of Wythoff pairs," in A Collection of Manuscripts Related to the Fibonacci Sequence. Fibonacci Assoc., Santa Clara, CA, 1980, pp. 134-136.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A064437.
Apart from initial terms, same as A026356 (Cloitre (0,2,2,3)-hiccup sequence).
First column of A126714.
Complement is (essentially) A026355.
Equals 1 + A004957, also n + A004956.
First differences give A076662.
Complement of A099267. [Gerald Hillier, Dec 19 2008]
Cf. A193214 (primes). Except for the first term equal to A001950 + 2.
Cf. A026352 (Cloitre (1,1,2,3)-hiccup sequence), A064437 (Cloitre (0,1,3,2)-hiccup sequence).

Programs

  • Haskell
    a007066 n = a007066_list !! (n-1)
    a007066_list = 1 : f 2 [1] where
       f x zs@(z:_) = y : f (x + 1) (y : zs) where
         y = if x `elem` zs then z + 2 else z + 3
    -- Reinhard Zumkeller, Sep 26 2014, Sep 18 2011
    
  • Maple
    Digits := 100: t := (1+sqrt(5))/2; A007066 := proc(n) if n <= 1 then 1 else floor(1+t*floor(t*(n-1)+1)); fi; end;
  • Mathematica
    t = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {1, 0, 1}}] &, {0}, 6] (*A189479*)
    Flatten[Position[t, 0]] (*A007066*)
    Flatten[Position[t, 1]] (*A099267*)
    With[{grs=GoldenRatio^2},Table[1+Ceiling[grs(n-1)],{n,70}]] (* Harvey P. Dale, Jun 24 2011 *)
  • Python
    from math import isqrt
    def A007066(n): return (n+1+isqrt(5*(n-1)**2)>>1)+n if n > 1 else 1 # Chai Wah Wu, Aug 25 2022

Formula

a(n) = floor(1+phi*floor(phi*(n-1)+1)), phi=(1+sqrt(5))/2, n >= 2.
a(1)=1; for n>1, a(n)=a(n-1)+2 if n is already in the sequence, a(n)=a(n-1)+3 otherwise. - Benoit Cloitre, Mar 06 2003
a(n+1) = floor(n*phi^2) + 2, n>=1. - Michel Dekking, Aug 26 2019

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).

A080782 a(1)=1, a(n)=a(n-1)-1 if n is already in the sequence, a(n)=a(n-1)+2 otherwise.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Mar 07 2003

Keywords

Comments

Permutation of the integers: exchange trisections starting with 2 and 3.
a(a(n)) = n. - Reinhard Zumkeller, Oct 29 2004

Crossrefs

Programs

  • Mathematica
    Array[#+Mod[#+1,3]&,70,0] (* or *) LinearRecurrence[{1,0,1,-1},{1,3,2,4},70] (* Harvey P. Dale, Mar 29 2013 *)
    {#,#+1,#-1}[[Mod[#,3,1]]]&/@Range[99] (* Federico Provvedi, May 15 2021 *)

Formula

a(n) = A064429(n-1) + 1.
a(n) - n is periodic with period 3.
G.f.: x*(1+2*x-x^2+x^3)/(1-x-x^3+x^4). - Jaume Oliver Lafont, Mar 24 2009
a(0)=1, a(1)=3, a(2)=2, a(3)=4, a(n)=a(n-1)+0*a(n-2)+a(n-3)-a(n-4). - Harvey P. Dale, Mar 29 2013
a(n) = n + (2/sqrt(3))*sin(2*(n+2)*Pi/3). - Wesley Ivan Hurt, Sep 26 2017
From Guenther Schrack, Oct 23 2019: (Start)
a(n) = a(n-3) + 3 with a(1) = 1, a(2) = 3, a(3) = 2 for n > 3.
a(n) = n - (w^(2*n)*(2 + w) + w^n*(1 - w))/3 where w = (-1 + sqrt(-3))/2. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*Pi/(3*sqrt(3)) - log(2)/3. - Amiram Eldar, Jan 31 2023
From Charles L. Hohn, Sep 03 2024: (Start)
a(n) = n-1+n%3.
a(n) = A375336(n-2, 1) for n >= 6. (End)

A086377 a(1)=1; a(n)=a(n-1)+2 if n is in the sequence; a(n)=a(n-1)+2 if n and (n-1) are not in the sequence; a(n)=a(n-1)+3 if n is not in the sequence but (n-1) is in the sequence.

Original entry on oeis.org

1, 4, 6, 8, 11, 13, 16, 18, 21, 23, 25, 28, 30, 33, 35, 37, 40, 42, 45, 47, 49, 52, 54, 57, 59, 62, 64, 66, 69, 71, 74, 76, 78, 81, 83, 86, 88, 91, 93, 95, 98, 100, 103, 105, 107, 110, 112, 115, 117, 120, 122, 124, 127, 129, 132, 134, 136, 139, 141, 144, 146, 148, 151
Offset: 1

Views

Author

Benoit Cloitre, Sep 13 2003

Keywords

Comments

From Joseph Biberstine (jrbibers(AT)indiana.edu), May 02 2006: (Start)
The continued fraction 4/Pi = 1 + 1/(3 + 4/(5 + 9/(7 + 16/(9 + 25/(11 + ...))))) (see A079037) suggests the recurrence b(n) = 2*n - 1 + n^2/b(n+1) with b(1) = 4/Pi. Solving the above recurrence in the other direction we would have b(n) = (n-1)^2/b(n-1 - 2*n + 3) with b(1) = 4/Pi.
Now consider this last defined sequence {b(n)}. It appears to grow linearly. (1) Does it? (2) What is the limit of b(n)/n as n->oo? (3) How does the limit depend on the initial term b(1)? (End)
From the recurrence relation, it follows that the limit L = lim_{b->oo} b(n)/n satisfies the following quadratic equation: L^2 - 2*L - 1 = 0 implying that L = 1+sqrt(2) or 1-sqrt(2). - Max Alekseyev, May 02 2006
Note that b(n)/n decreases, while b(n)/(n+1) increases. I speculate that 4/Pi is the only b(1) value such that b(n)/n converges to 1+sqrt(2) instead of 1-sqrt(2). - Don Reble, May 02 2006
It appears that round( b(n) ) = floor((1+sqrt(2))*n - 1/sqrt(2)) = A086377(n) = a(n). This is certainly true for the first 190 terms. Is there a formal proof? - Paul D. Hanna, May 02 2006
Is A086377 the sequence of positions of 0 in A189687? - Clark Kimberling, Apr 25 2011
The three conjectures by respectively Biberstein, Hanna, and Kimberling have all been proved, see the paper by Bosma et al. in the Links. - Michel Dekking, Oct 05 2017
In the Fokkink-Joshi paper, this sequence is the Cloitre (1,1,3,2)-hiccup sequence, - Michael De Vlieger, Jul 29 2025

Crossrefs

Programs

Formula

a(n) = floor((1+sqrt(2))*n - 1/sqrt(2)).
n is in the sequence if A004641(n)=1 or A001030(n)=2. a(n) = A080652(n) - 1 = A064437(n+1) - 2 = A081841(n+2) - 3. - Ralf Stephan, Feb 23 2004

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

1, 4, 7, 11, 14, 17, 21, 24, 27, 30, 34, 37, 40, 44, 47, 50, 54, 57, 60, 63, 67, 70, 73, 77, 80, 83, 87, 90, 93, 97, 100, 103, 106, 110, 113, 116, 120, 123, 126, 130, 133, 136, 139, 143, 146, 149, 153, 156, 159, 163, 166, 169, 172, 176, 179, 182, 186, 189, 192, 196
Offset: 1

Views

Author

Benoit Cloitre, Apr 11 2003

Keywords

Comments

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

Crossrefs

Programs

Formula

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

A079357 a(1)=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, 12, 16, 20, 24, 23, 27, 31, 30, 29, 33, 37, 36, 40, 44, 48, 47, 51, 55, 54, 53, 57, 61, 60, 64, 63, 62, 61, 65, 64, 68, 72, 71, 70, 74, 78, 77, 81, 85, 89, 88, 92, 96, 95, 94, 98, 102, 101, 105, 104, 103, 102, 106, 105, 109, 113, 112, 111, 110, 109, 108, 107
Offset: 1

Views

Author

Benoit Cloitre, Feb 14 2003

Keywords

Comments

If, in the defining recurrence, the rule a(n)=a(n-1)+4 when n is not already in the sequence is generalized to a(n)=a(n-1)+k, then the resulting sequence ultimately becomes periodic with period 1,3,10,35 for k=1,2,3,4, respectively. - John W. Layman, Apr 15 2003

Crossrefs

Formula

It appears that, for n >= 219, a(n)=n+b(n) where b(n) is the period-35 sequence (-1, 2, 5, 3, 6, 9, 7, 5, 8, 11, 9, 12, 10, 8, 6, 9, 7, 10, 13, 11, 9, 7, 5, 3, 1, -1, -3, -5, -7, -9, -11, -13, -10, -7, -4).

Extensions

More terms from John W. Layman, Apr 15 2003

A080704 a(1)=2; for n>1, if n is in the sequence then a(n) is the smallest even integer > a(n-1), otherwise a(n) = a(n-1) + 3.

Original entry on oeis.org

2, 4, 7, 8, 11, 14, 16, 18, 21, 24, 26, 29, 32, 34, 37, 38, 41, 42, 45, 48, 50, 53, 56, 58, 61, 62, 65, 68, 70, 73, 76, 78, 81, 82, 85, 88, 90, 92, 95, 98, 100, 102, 105, 108, 110, 113, 116, 118, 121, 122, 125, 128, 130, 133, 136, 138, 141, 142, 145, 148
Offset: 1

Views

Author

Benoit Cloitre, Mar 01 2003

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 2; a[n_] := a[n] = Module[{s = Array[a, n-1]}, a[n-1] + If[MemberQ[s, n], If[OddQ[a[n-1]], 1, 2], 3]]; Array[a, 100] (* Amiram Eldar, May 14 2022 *)
  • PARI
    for(n=2,400,an[n]=if(setsearch(Set(vector(n-1,i,a(i))),n),if(a(n-1)%2,a(n-1)+1,a(n-1)+2),a(n-1)+3))

Formula

It seems that a(n)/n -> 2.4799.... = 62/25 ?

A081835 a(1)=1, a(n) = a(n-1) + 5 if n is already in the sequence, a(n) = a(n-1) + 4 otherwise.

Original entry on oeis.org

1, 5, 9, 13, 18, 22, 26, 30, 35, 39, 43, 47, 52, 56, 60, 64, 68, 73, 77, 81, 85, 90, 94, 98, 102, 107, 111, 115, 119, 124, 128, 132, 136, 140, 145, 149, 153, 157, 162, 166, 170, 174, 179, 183, 187, 191, 196, 200, 204, 208, 212, 217, 221, 225, 229, 234, 238, 242
Offset: 1

Views

Author

Benoit Cloitre, Apr 11 2003

Keywords

Comments

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

Examples

			a(2) = a(1)+4 = 5 because 2 is not already in the sequence;
a(3) = a(2)+4 = 9 because 3 is not already in the sequence;
a(4) = a(3)+4 = 13 because 4 is not already in the sequence;
a(5) = a(4)+5 = 18 because 5 is already in the sequence.
		

Crossrefs

Programs

  • Maple
    r:=2+sqrt(5): seq(floor(r*n-(4*r-1)/(r+1)),n=1..60); # Muniru A Asiru, Jun 06 2018
  • Mathematica
    Module[{r=2+Sqrt[5],c},c=(4r-1)/(r+1);Table[Floor[r*n-c],{n,60}]] (* Harvey P. Dale, Feb 19 2013 *)

Formula

a(n) = floor(rn-(4r-1)/(r+1)) where r=2+sqrt(5).

A079352 a(1)=1, then a(n)=3*a(n-1) if n is already in the sequence, a(n)=2*a(n-1) otherwise.

Original entry on oeis.org

1, 2, 4, 12, 24, 48, 96, 192, 384, 768, 1536, 4608, 9216, 18432, 36864, 73728, 147456, 294912, 589824, 1179648, 2359296, 4718592, 9437184, 28311552, 56623104, 113246208, 226492416, 452984832, 905969664, 1811939328, 3623878656
Offset: 1

Views

Author

Benoit Cloitre, Feb 14 2003

Keywords

Comments

Inspired by A079000. Cf. A064437.

Programs

  • PARI
    a(n)=3*(3/2)^floor((log(n)-log(3))/log(2))*2^n

Formula

a(n+1)=3*a(n) for n=3 n of the form 3*2^k - 1, k>=2 . a(n+1)=2*a(n) otherwise. Hence a(n)=3*(3/2)^floor((log(n/3))/log(2))*2^n.
Showing 1-10 of 12 results. Next