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

A215020 a(n) = log_2( A182105(n) ).

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 1, 2, 3, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 1, 2, 3, 4, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 1, 2, 3, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 1, 2, 3, 4, 5, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 1, 2, 3, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 1, 2, 3, 4, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 1, 2, 3, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1
Offset: 1

Views

Author

N. J. A. Sloane, Aug 01 2012

Keywords

Comments

Apparently the leftmost positions of change with incrementing skew-binary numbers (A169683), see example. - Joerg Arndt, May 27 2016
Irregular table read by rows, where the k-th row counts from 0 up to the ruler function of k, A007814(k). - Allan C. Wechsler, Sep 26 2019

Examples

			From _Joerg Arndt_, May 27 2016: (Start)
The first nonnegative skew-binary numbers (dots denote zeros) are
n :  [skew-binary]  position of change
00:  [ . . . . . ]  -
01:  [ . . . . 1 ]  0
02:  [ . . . . 2 ]  0
03:  [ . . . 1 . ]  1
04:  [ . . . 1 1 ]  0
05:  [ . . . 1 2 ]  0
06:  [ . . . 2 . ]  1
07:  [ . . 1 . . ]  2
08:  [ . . 1 . 1 ]  0
09:  [ . . 1 . 2 ]  0
10:  [ . . 1 1 . ]  1
11:  [ . . 1 1 1 ]  0
12:  [ . . 1 1 2 ]  0
13:  [ . . 1 2 . ]  1
14:  [ . . 2 . . ]  2
15:  [ . 1 . . . ]  3
16:  [ . 1 . . 1 ]  0
17:  [ . 1 . . 2 ]  0
18:  [ . 1 . 1 . ]  1
19:  [ . 1 . 1 1 ]  0
20:  [ . 1 . 1 2 ]  0
21:  [ . 1 . 2 . ]  1
22:  [ . 1 1 . . ]  2
23:  [ . 1 1 . 1 ]  0
24:  [ . 1 1 . 2 ]  0
25:  [ . 1 1 1 . ]  1
26:  [ . 1 1 1 1 ]  0
27:  [ . 1 1 1 2 ]  0
28:  [ . 1 1 2 . ]  1
29:  [ . 1 2 . . ]  2
30:  [ . 2 . . . ]  3
31:  [ 1 . . . . ]  4
32:  [ 1 . . . 1 ]  0
33:  [ 1 . . . 2 ]  0
...
(End)
From _Allan C. Wechsler_, Sep 27 2019 (Start)
First few rows of irregular table derived from A007814 (see comments).
0
0 1
0
0 1 2
0
0 1
0
0 1 2 3
0
0 1
...
(End)
		

Crossrefs

Formula

a(n) = A082850(n) - 1. - Omar E. Pol, Jun 18 2019

A133494 Diagonal of the array of iterated differences of A047848.

Original entry on oeis.org

1, 1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, 177147, 531441, 1594323, 4782969, 14348907, 43046721, 129140163, 387420489, 1162261467, 3486784401, 10460353203, 31381059609, 94143178827, 282429536481, 847288609443, 2541865828329, 7625597484987, 22876792454961, 68630377364883
Offset: 0

Views

Author

Paul Barry, Paul Curtz, Dec 23 2007

Keywords

Comments

a(n) is the number of ways to choose a composition C, and then choose a composition of each part of C. - Geoffrey Critzer, Mar 19 2012
a(n) is the top left entry of the n-th power of the 3 X 3 matrix [1, 1, 1; 1, 1, 1; 1, 1, 1]. - R. J. Mathar, Feb 03 2014
a(n) is the reptend length of 1/3^(n+1) in decimal. - Jianing Song, Nov 14 2018
Also the number of pairs of integer compositions, the first summing to n and the second with sum equal to the length of the first. If an integer composition is regarded as an arrow from sum to length, these are composable pairs, and the obvious composition operation founds a category of integer compositions. For example, we have (2,1,1,4) . (1,2,1) . (1,2) = (2,6), where dots represent the composition operation. The version without empty compositions is A000244. Composable triples are counted by 1 followed by A000302. The unordered version is A022811. - Gus Wiseman, Jul 14 2022

Examples

			From _Gus Wiseman_, Jul 15 2020: (Start)
The a(0) = 1 through a(3) = 9 ways to choose a composition of each part of a composition:
  ()  (1)  (2)      (3)
           (1,1)    (1,2)
           (1),(1)  (2,1)
                    (1,1,1)
                    (1),(2)
                    (2),(1)
                    (1),(1,1)
                    (1,1),(1)
                    (1),(1),(1)
(End)
		

Crossrefs

The strict version is A336139.
Splittings of partitions are A323583.
Multiset partitions of partitions are A001970.
Partitions of each part of a partition are A063834.
Compositions of each part of a partition are A075900.
Strict partitions of each part of a strict partition are A279785.
Compositions of each part of a strict partition are A304961.
Strict compositions of each part of a composition are A307068.
Compositions of each part of a strict composition are A336127.

Programs

Formula

Binomial transform of A078008. - Paul Curtz, Aug 04 2008
From R. J. Mathar, Nov 11 2008: (Start)
G.f.: (1 - 2*x)/(1 - 3*x).
a(n) = A000244(n-1), n > 0. (End)
From Philippe Deléham, Nov 13 2008: (Start)
a(n) = Sum_{k=0..n} A112467(n,k)*2^k.
a(n) = Sum_{k=0..n} A071919(n,k)*2^k. (End)
Let A(x) be the g.f. Then B(x) = x*A(x) satisfies B(x/(1-x)) = x/(1 - 2*B(x)). - Vladimir Kruchinin, Dec 05 2011
G.f.: 1/(1 - (Sum_{k>=1} (x/(1 - x))^k)). - Joerg Arndt, Sep 30 2012
For n > 0, a(n) = 2*(Sum_{k=0..n-1} a(k)) - 1 = 3^(n-1). - J. Conrad, Oct 29 2015
G.f.: 1 + x/(1 + x)*(1 + 4*x/(1 + 4*x)*(1 + 7*x/(1 + 7*x)*(1 + 10*x/(1 + 10*x)*(1 + .... - Peter Bala, May 27 2017
Invert transform of A011782(n) = 2^(n-1). Second invert transform of A000012. - Gus Wiseman, Jul 19 2020
a(n) = ceiling(3^(n-1)). - Alois P. Heinz, Jul 26 2020
From Elmo R. Oliveira, Mar 31 2025: (Start)
E.g.f.: (2 + exp(3*x))/3.
a(n) = 3*a(n-1) for n > 1. (End)

Extensions

Definition clarified by R. J. Mathar, Nov 11 2008

A046699 a(1) = a(2) = 1, a(n) = a(n - a(n-1)) + a(n-1 - a(n-2)) if n > 2.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 6, 7, 8, 8, 8, 8, 9, 10, 10, 11, 12, 12, 12, 13, 14, 14, 15, 16, 16, 16, 16, 16, 17, 18, 18, 19, 20, 20, 20, 21, 22, 22, 23, 24, 24, 24, 24, 25, 26, 26, 27, 28, 28, 28, 29, 30, 30, 31, 32, 32, 32, 32, 32, 32, 33, 34, 34, 35, 36, 36, 36, 37
Offset: 1

Views

Author

Keywords

Comments

Ignoring first term, this is the meta-Fibonacci sequence for s=0. - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
Except for the first term, n occurs A001511(n) times. - Franklin T. Adams-Watters, Oct 22 2006

References

  • Sequence was proposed by Reg Allenby.
  • B. W. Conolly, "Meta-Fibonacci sequences," in S. Vajda, editor, Fibonacci and Lucas Numbers and the Golden Section. Halstead Press, NY, 1989, pp. 127-138. See Eq. (2).
  • Michael Doob, The Canadian Mathematical Olympiad & L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society & Société Mathématique du Canada, Problem 5, 1990, pp. 212-213, 1993.
  • S. Vajda, Fibonacci and Lucas Numbers and the Golden Section, Wiley, 1989, see p. 129.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

Callaghan et al. (2005)'s sequences T_{0,k}(n) for k=1 through 7 are A000012, A046699, A046702, A240835, A241154, A241155, A240830.

Programs

  • Haskell
    a046699 n = a046699_list !! (n-1)
    a046699_list = 1 : 1 : zipWith (+) zs (tail zs) where
       zs = map a046699 $ zipWith (-) [2..] a046699_list
    -- Reinhard Zumkeller, Jan 02 2012
    
  • Magma
    [ n le 2 select 1 else Self(n - Self(n-1)) + Self(n-1 -Self(n-2)):n in [1..80]]; // Marius A. Burtea, Oct 17 2019
  • Maple
    a := proc(n) option remember; if n <= 1 then return 1 end if; if n <= 2 then return 2 end if; return add(a(n - i + 1 - a(n - i)), i = 1 .. 2) end proc # Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
    a := proc(n) option remember; if n <= 2 then 1 else a(n - a(n-1)) + a(n-1 - a(n-2)); fi; end; # N. J. A. Sloane, Apr 16 2014
  • Mathematica
    a[n_] := (k = 1; While[ !Divisible[(2*++k)!, 2^(n-1)]]; k); a[1] = a[2] = 1; Table[a[n], {n, 1, 72}] (* Jean-François Alcover, Oct 06 2011, after Benoit Cloitre *)
    CoefficientList[ Series[1 + x/(1 - x)*Product[1 + x^(2^n - 1), {n, 6}], {x, 0, 80}], x] (* or *)
    a[1] = a[2] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - 1 - a[n - 2]]; Array[a, 80] (* Robert G. Wilson v, Sep 08 2014 *)
  • Maxima
    a[1]:1$
    a[2]:1$
    a[n]:=a[n-a[n-1]]+a[n-1-a[n-2]]$
    makelist(a[n],n,2,60); /* Martin Ettl, Oct 29 2012 */
    
  • PARI
    a(n)=if(n<0,1,s=1;while((2*s)!%2^(n-1)>0,s++);s) \\ Benoit Cloitre, Jan 19 2007
    
  • Python
    from sympy import factorial
    def a(n):
        if n<3: return 1
        s=1
        while factorial(2*s)%(2**(n - 1))>0: s+=1
        return s
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 11 2017, after Benoit Cloitre
    

Formula

First differences seem to be A079559. - Vladeta Jovovic, Nov 30 2003. This is correct and not too hard to prove, giving the generating function x + x^2(1+x)(1+x^3)(1+x^7)(1+x^15).../(1-x). - Paul Boddington, Jul 30 2004
G.f.: x + x^2/(1-x) * Product_{n=1}^{infinity} (1 + x^(2^n-1)). - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
For n>=1, a(n)=w(n-1) where w(n) is the least k such that 2^n divides (2k)!. - Benoit Cloitre, Jan 19 2007
Conjecture: a(n+1) = a(n) + A215530(a(n) + n) for all n > 0. - Velin Yanev, Oct 17 2019
From Bernard Schott, Dec 03 2021: (Start)
a(n) <= a(n+1) <= a(n) +1.
For n > 1, if a(n) is odd, then a(n+1) = a(n) + 1.
a(2^n+1) = 2^(n-1) + 1 for n > 0.
Results coming from the 5th problem proposed during the 22nd Canadian Mathematical Olympiad in 1990 (link IMO Compendium and Doob reference). (End)

A082850 Let S(0) = {}, S(n) = {S(n-1), S(n-1), n}; sequence gives S(infinity).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Apr 14 2003

Keywords

Comments

Sequence counts up to successive values of A001511; i.e., apply the morphism k -> 1,2,...,k to A001511. If all 1's are removed from the sequence, the resulting sequence b has b(n) = a(n)+1. A101925 lists the positions of 1's in this sequence.
The geometric mean of this sequence approaches the Somos constant (A112302). - Jwalin Bhatt, Jan 30 2025

Examples

			S(1) = {1}, S(2) = {1,1,2}, S(3) = {1,1,2,1,1,2,3}, etc.
		

Crossrefs

Cf. A082851 (partial sums).
Cf. A215020.

Programs

  • Mathematica
    Fold[Flatten[{#1, #1, #2}] &, {}, Range[5]] (* Birkas Gyorgy, Apr 13 2011 *)
    Flatten[Table[Length@Last@Split@IntegerDigits[2 n, 2], {n, 20}] /. {n_ ->Range[n]}] (* Birkas Gyorgy, Apr 13 2011 *)
  • Python
    S = []; [S.extend(S + [n]) for n in range(1, 8)]
    print(S) # Michael S. Branicky, Jul 02 2022
    
  • Python
    from itertools import count, islice
    def A082850_gen(): # generator of terms
        S = []
        for n in count(1):
            yield from (m:=S+[n])
            S += m #
    A082850_list = list(islice(A082850_gen(),20)) # Chai Wah Wu, Mar 06 2023

Formula

a(2^m - 1) = m.
If n = 2^m - 1 + k with 0 < k < 2^m, then a(n) = a(k). - Franklin T. Adams-Watters, Aug 16 2006
a(n) = log_2(A182105(n)) + 1. - Laurent Orseau, Jun 18 2019
a(n) = 1 + A215020(n). - Joerg Arndt, Mar 04 2025

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

3, 6, 7, 10, 13, 14, 15, 18, 21, 22, 25, 28, 29, 30, 31, 34, 37, 38, 41, 44, 45, 46, 49, 52, 53, 56, 59, 60, 61, 62, 63, 66, 69, 70, 73, 76, 77, 78, 81, 84, 85, 88, 91, 92, 93, 94, 97, 100, 101, 104, 107, 108, 109, 112, 115, 116, 119, 122, 123, 124, 125, 126
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Apr 01 2003

Keywords

Comments

It appears these are the indices of the terms in A182105 which are greater than 1. - Carl Joshua Quines, Apr 07 2017
In the Fokkink-Joshi paper, this sequence is the Cloitre (0,3,1,3)-hiccup sequence. - Michael De Vlieger, Jul 30 2025

Crossrefs

Cf. A080578.

Programs

  • Mathematica
    l={3}; a=3; 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 *)
  • Python
    l=[3]
    a=3
    for n in range(2, 101):
        if n not in l: a+=3
        else: a+=1
        l.append(a)
    print(l) # Indranil Ghosh, Apr 07 2017

A215026 Reluctant Fibonacci sequence.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 1, 2, 3, 5, 1, 1, 2, 1, 2, 3, 5, 8, 1, 1, 2, 1, 2, 3, 1, 1, 2, 3, 5, 8, 13, 1
Offset: 1

Views

Author

N. J. A. Sloane, Aug 03 2012

Keywords

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 4, Pre-Fascicle 6A, Section 7.2.2.2, Problem 178, page 54.
  • Donald E. Knuth, Satisfiability, Fascicle 6, volume 4 of The Art of Computer Programming. Addison-Wesley, 2015, page 160, Problem 310; see solution on page 246.

Crossrefs

A339451 Gray-code-like sequence in which, at each step, the least significant bit that has never been toggled from the previous value, is toggled.

Original entry on oeis.org

0, 1, 0, 2, 3, 2, 0, 4, 5, 4, 6, 7, 6, 4, 0, 8, 9, 8, 10, 11, 10, 8, 12, 13, 12, 14, 15, 14, 12, 8, 0, 16, 17, 16, 18, 19, 18, 16, 20, 21, 20, 22, 23, 22, 20, 16, 24, 25, 24, 26, 27, 26, 24, 28, 29, 28, 30, 31, 30, 28, 24, 16, 0, 32, 33, 32, 34, 35, 34, 32, 36
Offset: 0

Views

Author

Allan C. Wechsler, Dec 05 2020

Keywords

Comments

Conjectured connections: the position of the bit that is toggled to derive a(n) from a(n-1) is A215020(n); the sequence of absolute differences of this sequence is A182105; there is some underlying connection to the "skew binary" counting system.

Examples

			For n = 18, a(n-1) = 8. That is the second 8 in the sequence. We cannot toggle the 1-bit, because that was already used to derive a(16) = 9 from a(15) = 8, so instead we toggle the 2-bit, yielding a(n) = 10.
		

Crossrefs

Programs

  • Maple
    a:= proc() local b, a; b:= proc() 1/2 end; a:= proc(n)
          option remember; local h; if n=0 then 0 else h:=
          a(n-1); b(h):= 2*b(h); Bits[Xor](h, b(h)) fi end
        end():
    seq(a(n), n=0..127);  # Alois P. Heinz, Dec 05 2020
  • Mathematica
    a[m_] := Module[{b, a}, b[] = 1/2; a[n] := a[n] =
         Module[{h}, If[n == 0 ,  0 ,  h = a[n - 1];
         b[h] = 2*b[h]; BitXor[h, b[h]]]]; a[m]];
    Table[a[n], {n, 0, 127}] (* Jean-François Alcover, May 15 2022, after Alois P. Heinz *)
Showing 1-7 of 7 results.