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

A026352 a(n) = floor(n*tau) + n + 1 where tau is the golden ratio A001622.

Original entry on oeis.org

1, 3, 6, 8, 11, 14, 16, 19, 21, 24, 27, 29, 32, 35, 37, 40, 42, 45, 48, 50, 53, 55, 58, 61, 63, 66, 69, 71, 74, 76, 79, 82, 84, 87, 90, 92, 95, 97, 100, 103, 105, 108, 110, 113, 116, 118, 121, 124, 126, 129, 131, 134, 137, 139, 142, 144
Offset: 0

Views

Author

Clark Kimberling, Dec 11 1999

Keywords

Comments

a(n) = greatest k such that s(k) = n+1, where s = A026350.
Indices at which blocks (0;1) occur in infinite Fibonacci word; i.e., n such that A005614(n)=0 and A005614(n+1)=1. - Benoit Cloitre, Nov 15 2003
Except for the first term, these are the numbers whose lazy Fibonacci representation (see A095791) includes both 1 and 2; thus this sequence is a subsequence of the lower Wythoff sequence, A000201. - Clark Kimberling, Jun 10 2004 [A-number typo corrected by Nathan Fox, May 03 2014]
a(n) = n-th number k whose lazy Fibonacci representation (as in A095791) has more summands than that of k-1. - Clark Kimberling, Jun 12 2004
a(n) = position of n-th 0 in A096270. - Clark Kimberling, Apr 22 2011
Maximum number of chips in a pile created at each step in the game described by Roland Schroeder in his comment at A000201. (From Allan C. Wechsler via Seqfan.)
In the Fokkink-Joshi paper, this sequence is the Cloitre (1,1,2,3)-hiccup sequence, i.e., a(1) = 1; for m < n, a(n) = a(n-1)+2 if a(m) = n-1, else a(n) = a(n-1)+3. - Michael De Vlieger, Jul 28 2025

Crossrefs

Essentially same as A004957.
Subsequence of A000201.
Complement of A026351.

Programs

Formula

a(n) = A026351(n)+n. - R. J. Mathar, Jun 24 2025

A060142 Ordered set S defined by these rules: 0 is in S and if x is in S then 2x+1 and 4x are in S.

Original entry on oeis.org

0, 1, 3, 4, 7, 9, 12, 15, 16, 19, 25, 28, 31, 33, 36, 39, 48, 51, 57, 60, 63, 64, 67, 73, 76, 79, 97, 100, 103, 112, 115, 121, 124, 127, 129, 132, 135, 144, 147, 153, 156, 159, 192, 195, 201, 204, 207, 225, 228, 231, 240, 243, 249, 252, 255, 256, 259, 265, 268, 271
Offset: 0

Views

Author

Clark Kimberling, Mar 05 2001

Keywords

Comments

After expelling 0 and 1, the numbers 4x occupy same positions in S that 1 occupies in the infinite Fibonacci word (A003849).
a(A026351(n)) = A219608(n); a(A004957(n)) = 4 * a(n). - Reinhard Zumkeller, Nov 26 2012
Apart from the initial term, this lists the indices of the 1's in A086747. - N. J. A. Sloane, Dec 05 2019
From Gus Wiseman, Jun 10 2020: (Start)
Numbers k such that the k-th composition in standard order has all odd parts, or numbers k such that A124758(k) is odd. The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. For example, the sequence of all compositions into odd parts begins:
0: () 57: (1,1,3,1) 135: (5,1,1,1)
1: (1) 60: (1,1,1,3) 144: (3,5)
3: (1,1) 63: (1,1,1,1,1,1) 147: (3,3,1,1)
4: (3) 64: (7) 153: (3,1,3,1)
7: (1,1,1) 67: (5,1,1) 156: (3,1,1,3)
9: (3,1) 73: (3,3,1) 159: (3,1,1,1,1,1)
12: (1,3) 76: (3,1,3) 192: (1,7)
15: (1,1,1,1) 79: (3,1,1,1,1) 195: (1,5,1,1)
16: (5) 97: (1,5,1) 201: (1,3,3,1)
19: (3,1,1) 100: (1,3,3) 204: (1,3,1,3)
25: (1,3,1) 103: (1,3,1,1,1) 207: (1,3,1,1,1,1)
28: (1,1,3) 112: (1,1,5) 225: (1,1,5,1)
31: (1,1,1,1,1) 115: (1,1,3,1,1) 228: (1,1,3,3)
33: (5,1) 121: (1,1,1,3,1) 231: (1,1,3,1,1,1)
36: (3,3) 124: (1,1,1,1,3) 240: (1,1,1,5)
39: (3,1,1,1) 127: (1,1,1,1,1,1,1) 243: (1,1,1,3,1,1)
48: (1,5) 129: (7,1) 249: (1,1,1,1,3,1)
51: (1,3,1,1) 132: (5,3) 252: (1,1,1,1,1,3)
(End)
Numbers whose binary representation has the property that every run of consecutive 0's has even length. - Harry Richman, Jan 31 2024

Examples

			From _Harry Richman_, Jan 31 2024: (Start)
In the following, dots are used for zeros in the binary representation:
   n  binary(a(n))  a(n)
   0:    .......     0
   1:    ......1     1
   2:    .....11     3
   3:    ....1..     4
   4:    ....111     7
   5:    ...1..1     9
   6:    ...11..    12
   7:    ...1111    15
   8:    ..1....    16
   9:    ..1..11    19
  10:    ..11..1    25
  11:    ..111..    28
  12:    ..11111    31
  13:    .1....1    33
  14:    .1..1..    36
  15:    .1..111    39
  16:    .11....    48
  17:    .11..11    51
  18:    .111..1    57
  19:    .1111..    60
  20:    .111111    63
  21:    1......    64
  22:    1....11    67
(End)
		

Crossrefs

Cf. A003714 (no consecutive 1's in binary expansion).
Odd partitions are counted by A000009.
Numbers with an odd number of 1's in binary expansion are A000069.
Numbers whose binary expansion has odd length are A053738.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Compositions without odd parts are A062880.
- Sum is A070939.
- Product is A124758.
- Strict compositions are A233564.
- Heinz number is A333219.
- Number of distinct parts is A334028.

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a060142 n = a060142_list !! n
    a060142_list = 0 : f (singleton 1) where
       f s = x : f (insert (4 * x) $ insert (2 * x + 1) s') where
           (x, s') = deleteFindMin s
    -- Reinhard Zumkeller, Nov 26 2012
    
  • Mathematica
    Take[Nest[Union[Flatten[# /. {{i_Integer -> i}, {i_Integer -> 2 i + 1}, {i_Integer -> 4 i}}]] &, {1}, 5], 32]  (* Or *)
    Select[Range[124], FreeQ[Length /@ Select[Split[IntegerDigits[#, 2]], First[#] == 0 &], ?OddQ] &] (* _Birkas Gyorgy, May 29 2012 *)
  • PARI
    is(n)=if(n<3, n<2, if(n%2,is(n\2),n%4==0 && is(n/4))) \\ Charles R Greathouse IV, Oct 21 2013

Extensions

Corrected by T. D. Noe, Nov 01 2006
Definition simplified by Charles R Greathouse IV, Oct 21 2013

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

A004956 a(n) = ceiling(n*phi), where phi is the golden ratio, A001622.

Original entry on oeis.org

0, 2, 4, 5, 7, 9, 10, 12, 13, 15, 17, 18, 20, 22, 23, 25, 26, 28, 30, 31, 33, 34, 36, 38, 39, 41, 43, 44, 46, 47, 49, 51, 52, 54, 56, 57, 59, 60, 62, 64, 65, 67, 68, 70, 72, 73, 75, 77, 78, 80, 81, 83, 85, 86, 88, 89
Offset: 0

Views

Author

Keywords

Comments

a(0)=0, a(1)=2; for n > 1, a(n) = a(n-1) + 2 if n is already in the sequence, a(n) = a(n-1) + 1 otherwise.
Integer solutions to the equation x = ceiling(phi*floor(x/phi)). - Benoit Cloitre, Feb 14 2004
From Benoit Cloitre, Mar 05 2007: (Start)
The following is an alternative way to obtain this sequence. NP means "term not in parentheses". Write down the natural numbers and mark the least NP, which is 1:
1* 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
Take the first NP (which is 1) and parenthesize it; mark the least NP (which is 2):
(1*) 2* 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
Take the 2nd NP (which is 3) and parenthesize it; mark the next NP (which is 4):
(1*) 2* (3) 4* 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
Take the 4th NP (which is 6) and parenthesize it; mark the next NP (which is 5):
(1*) 2* (3) 4* 5* (6) 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
Continuing in this way we obtain
(1*) 2* (3) 4* 5* (6) 7* (8) 9* 10* (11) 12* 13* (14) 15* (16) 17* (18) 19* ...
The starred entries (after the first) give the sequence. (End)
From Rick L. Shepherd, Dec 05 2009: (Start)
An equivalent statement of the sieving process described by Benoit Cloitre on Mar 05 2007:
Begin with the natural numbers N. Repeatedly perform these two steps:
i) Let k = N's least remaining term not yet used in Step ii).
ii) Remove the k-th remaining term from N.
The remaining terms of N are the (positive) terms shared by this sequence and A026351.
The terms removed from N (the complement) are A026352's terms (see also A004957).
The PARI program performs this sieving process and prints the positive terms of this sequence. (End)
In the Fokkink-Joshi paper, apart from a(0) = 0, this sequence is the Cloitre (0,2,2,1)-hiccup sequence, i.e., a(1) = 2; for m < n, a(n) = a(n-1)+2 if a(m) = n, else a(n) = a(n-1)+1. - Michael De Vlieger, Jul 30 2025

Crossrefs

Cf. A001622, A004957, A026352 (Cloitre (1,1,2,3)-hiccup sequence).
Essentially same as A026351.

Programs

A013642 Numbers k such that the continued fraction for sqrt(k) has period 2.

Original entry on oeis.org

3, 6, 8, 11, 12, 15, 18, 20, 24, 27, 30, 35, 38, 39, 40, 42, 48, 51, 56, 63, 66, 68, 72, 80, 83, 84, 87, 90, 99, 102, 104, 105, 110, 120, 123, 132, 143, 146, 147, 148, 150, 152, 156, 168, 171, 182, 195, 198, 200, 203, 210, 224, 227, 228, 230, 231, 235, 240, 255, 258, 260, 264
Offset: 1

Views

Author

Keywords

Comments

This sequence is identical to the sequence of numbers of the form k = a^2 + b, where a and b are positive integers and b is a factor of 2a greater than 1, in which case the continued fraction expansion of sqrt(k) is [a; [2a/b, 2a]]. - David Terr, Jun 11 2004

References

  • Kenneth H. Rosen, Elementary Number Theory and Its Applications, Addison-Wesley, 1984, page 426 (but beware of errors!).

Crossrefs

Programs

  • Mathematica
    cf2Q[n_]:=Module[{s=Sqrt[n]},If[IntegerQ[s],1,Length[ ContinuedFraction[ s][[2]]]]==2]; Select[Range[300],cf2Q] (* Harvey P. Dale, Jun 21 2017 *)

A356327 Replace 2^k in binary expansion of n with A039834(1+k).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 03 2022

Keywords

Comments

This sequence has similarities with A022290, and is related to negaFibonacci representations.

Examples

			For n = 13:
- 13 = 2^3 + 2^2 + 2^0,
- so a(13) = A039834(4) + A039834(3) + A039834(1) = -3 + 2 + 1 = 0.
		

Crossrefs

Programs

  • Mathematica
    Table[Reverse[#].Fibonacci[-Range[Length[#]]] &@ IntegerDigits[n, 2], {n, 0, 69}] (* Rémy Sigrist, Aug 05 2022 *)
  • PARI
    a(n) = { my (v=0, k); while (n, n-=2^k=valuation(n, 2); v+=fibonacci(-1-k)); return (v) }
    
  • Python
    from sympy import fibonacci
    def A356327(n): return sum(fibonacci(-a)*int(b) for a, b in enumerate(bin(n)[:1:-1],start=1)) # Chai Wah Wu, Aug 31 2022

Formula

a(n) = Sum_{k>=0} A030308(n,k)*A039834(1+k).
a(A215024(n)) = n.
a(A215025(n)) = -n.
a(A003714(n)) = A309076(n).
Empirically:
- a(n) = 0 iff n = 0 or n belongs to A072197,
- a(n) = 1 iff n belongs to A020989,
- a(2*A215024(n)) = -A000201(n) for n > 0,
- a(3*A215024(n)) = -A060143(n),
- a(floor(A215024(n)/2)) = -A060143(n),
- a(4*A215024(n)) = A001950(n) for n > 0,
- a(floor(A215024(n)/4)) = A189663(n) for n > 0,
- a(2*A215025(n)) = A026351(n),
- a(3*A215025(n)) = A019446(n) for n > 0,
- a(floor(A215025(n)/2)) = A019446(n) for n > 0,
- a(4*A215025(n)) = -A004957(n),
- a(floor(A215025(n)/4)) = -A060144(n+1) for n >= 0.

A329130 a(0)=0; for any n >= 0, if a(n) > n then a(n+1) = a(n) - n, otherwise a(n+1) = a(n) + k, where k is the total number of terms a(m) <= m with m <= n.

Original entry on oeis.org

0, 1, 3, 1, 4, 8, 3, 8, 1, 7, 14, 4, 12, 21, 8, 18, 3, 14, 26, 8, 21, 1, 15, 30, 7, 23, 40, 14, 32, 4, 23, 43, 12, 33, 55, 21, 44, 8, 32, 57, 18, 44, 3, 30, 58, 14, 43, 73, 26, 57, 8, 40, 73, 21, 55, 1, 36, 72, 15, 52, 90
Offset: 0

Views

Author

James Marjamaa, Nov 05 2019

Keywords

Comments

Values where a(n) = n appear to be the values of A027941.

Examples

			For n = 0,   a(0) =            0    0 >= a(0)
    n = 1,   a(1) = a(0) + 1 = 1,   1 >= a(1), I = 1
    n = 2,   a(2) = a(1) + 2 = 3,   2 <  a(2), I = 2
    n = 3,   a(3) = a(2) - 2 = 1,   3 >= a(3)
    n = 4,   a(4) = a(3) + 3 = 4,   4 >= a(4), I = 3
    n = 5,   a(5) = a(4) + 4 = 8,   5 <  a(5), I = 4
    n = 6,   a(6) = a(5) - 5 = 3,   6 >= a(6)
    n = 7,   a(7) = a(6) + 5 = 8,   7 <  a(7), I = 5
    n = 8,   a(8) = a(7) - 7 = 1,   8 >= a(8)
    n = 9,   a(9) = a(8) + 6 = 7,   9 >= a(9), I = 6
    n = 10,  a(10)= a(9) + 7 = 14,  10<  a(10), I = 7
    n = 11,  a(11)= a(10)- 10= 4,   11>= a(11)
    n = 12,  a(12)= a(11)+ 8 = 12,  12>= a(12), I = 8
    .
    .
    .
		

Crossrefs

Programs

  • C
    #include
    void seq(int terms)
    {int n = 0; int i = 0; int a = 0; int c = 0;
    while (n <= terms)
    {
        if (c)
           {int N = n - 1;
            a -= N;
            printf("%d\n", a);}
        else
           {a += i;
            printf("%d\n", a);
            i++;}
        if (a > n)
           {c = 1;}
        else
           {c = 0;}
        n++;
    }
    }
    int main(void)
    {
    seq(1000);
    }
    
  • PARI
    v=k=0; for (n=0, 69, print1 (v, ", "); v=if (v>n, v-n, v+k++)) \\ Rémy Sigrist, Nov 06 2019

Formula

a(n+1) = a(n) + I, if n >= a(n) ('I' is the next consecutive integer not yet added);
= a(n) - n, if n < a(n).
From Yan Sheng Ang, May 20 2020: (Start)
a(A004957(n)) = a(n). Hence it follows that (writing F(n) = A000045(n)):
a(F(2*n)-1) = F(2*n) for n > 1;
a(F(2*n)) = 1;
a(F(2*n+1)-1) = F(2*n+1)-1 (as noted above);
a(F(2*n+1)) = F(2*n+2);
a(F(2*n+1)+1) = F(2*n) for n > 1.
(End)

A054089 For k >= 1, let p(k) = least h in N not already an a(i), q(k) = p(k)+k, a(2k) = q(k), a(2k+1) = p(k).

Original entry on oeis.org

1, 3, 2, 6, 4, 8, 5, 11, 7, 14, 9, 16, 10, 19, 12, 21, 13, 24, 15, 27, 17, 29, 18, 32, 20, 35, 22, 37, 23, 40, 25, 42, 26, 45, 28, 48, 30, 50, 31, 53, 33, 55, 34, 58, 36, 61, 38, 63, 39, 66, 41, 69, 43, 71, 44, 74, 46, 76, 47, 79, 49, 82, 51
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A004957 (even-indexed terms), A026351 (odd-indexed terms).
Showing 1-8 of 8 results.