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.

Previous Showing 11-17 of 17 results.

A083368 a(n) is the position of the highest one in A003754(n).

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 1, 3, 2, 1, 5, 2, 1, 4, 1, 3, 2, 1, 6, 1, 3, 2, 1, 5, 2, 1, 4, 1, 3, 2, 1, 7, 2, 1, 4, 1, 3, 2, 1, 6, 1, 3, 2, 1, 5, 2, 1, 4, 1, 3, 2, 1, 8, 1, 3, 2, 1, 5, 2, 1, 4, 1, 3, 2, 1, 7, 2, 1, 4, 1, 3, 2, 1, 6, 1, 3, 2, 1, 5, 2, 1, 4, 1, 3, 2, 1, 9, 2, 1, 4, 1, 3, 2, 1, 6, 1, 3, 2, 1, 5, 2
Offset: 1

Views

Author

Gary W. Adamson, Jun 04 2003

Keywords

Comments

Previous name was: A Fibbinary system represents a number as a sum of distinct Fibonacci numbers (instead of distinct powers of two). Using representations without adjacent zeros, a(n) = the highest bit-position which changes going from n-1 to n.
A003754(n), when written in binary, is the representation of n.
Often one uses Fibbinary representations without adjacent ones (the Zeckendorf expansion).
a(A000071(n+3)) = n. - Reinhard Zumkeller, Aug 10 2014
From Gus Wiseman, Jul 24 2025: (Start)
Conjecture: To obtain this sequence, start with A245563 (maximal run lengths of binary indices), then remove empty and duplicate rows (giving A385817), then take the first term of each remaining row. Some variations:
- For sum instead of first term we appear to have A200648.
- For length instead of first term we appear to have A200650+1.
- For last instead of first term we have A385892.
(End)

Examples

			27 is represented 110111, 28 is 111010; the fourth position changes, so a(28)=4.
		

References

  • Jay Kappraff, Beyond Measure: A Guided Tour Through Nature, Myth and Number, World Scientific, 2002, page 460.

Crossrefs

A035612 is the analogous sequence for Zeckendorf representations.
A001511 is the analogous sequence for power-of-two representations.
Appears to be the first element of each row of A385817, see A083368, A200648, A200650, A385818, A385892.
A000120 counts ones in binary expansion.
A245563 gives run lengths of binary indices, see A089309, A090996, A245562, A246029, A328592.
A384877 gives anti-run lengths of binary indices, ranks A385816.

Programs

  • Haskell
    a083368 n = a083368_list !! (n-1)
    a083368_list = concat $ h $ drop 2 a000071_list where
       h (a:fs@(a':_)) = (map (a035612 . (a' -)) [a .. a' - 1]) : h fs
    -- Reinhard Zumkeller, Aug 10 2014

Formula

For n = F(a)-1 to F(a+1)-2, a(n) = A035612(F(a+1)-1-n).
a(n) = a(k)+1 if n = ceiling(phi*k) where phi is the golden ratio; otherwise a(n) = 1. - Tom Edgar, Aug 25 2015

Extensions

Edited by Don Reble, Nov 12 2005
Shorter name from Joerg Arndt, Jul 27 2025

A056973 Number of blocks of {0,0} in the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a056973 = f 0 where
       f y x = if x == 0 then y else f (y + 0 ^ (mod x 4)) $ div x 2
    -- Reinhard Zumkeller, Mar 31 2015
    
  • Maple
    f:= proc(n) option remember;
         if n mod 4 = 0 then 1 + procname(n/2)
         else procname(floor(n/2))
         fi
    end proc:
    f(1):= 0:
    map(f, [$1..200]); # Robert Israel, Sep 02 2015
  • Mathematica
    f[n_] := Count[Partition[IntegerDigits[n, 2], 2, 1], {0, 0}]; Table[f@ n, {n, 0, 102}] (* Michael De Vlieger, Sep 01 2015, after Robert G. Wilson v at A014081 *)
    SequenceCount[#,{0,0},Overlaps->True]&/@(IntegerDigits[#,2]&/@Range[0,120]) (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 24 2018 *)
  • PARI
    a(n) = { my(x = bitor(n, n>>1));
             if (x == 0, 0, 1 + logint(x, 2) - hammingweight(x)) }
    vector(102, i, a(i))  \\ Gheorghe Coserea, Sep 01 2015

Formula

a(2n) = a(n) + [n is even], a(2n+1) = a(n).
G.f.: 1/(1-x) * Sum_{k>=0} t^4/((1+t)*(1+t^2)) where t=x^(2^k). - Ralf Stephan, Sep 10 2003
a(n) = A023416(n) - A033264(n). - Ralf Stephan, Sep 10 2003
Sum_{n>=1} a(n)/(n*(n+1)) = 2 - 3*log(2)/2 - Pi/4 (Allouche and Shallit, 1990). - Amiram Eldar, Jun 01 2021

A089591 "Lazy binary" representation of n. Also called redundant binary representation of n.

Original entry on oeis.org

0, 1, 10, 11, 20, 101, 110, 111, 120, 201, 210, 1011, 1020, 1101, 1110, 1111, 1120, 1201, 1210, 2011, 2020, 2101, 2110, 10111, 10120, 10201, 10210, 11011, 11020, 11101, 11110, 11111, 11120, 11201, 11210, 12011, 12020, 12101, 12110, 20111
Offset: 0

Views

Author

Jeff Erickson, Dec 29 2003

Keywords

Comments

Let a(0) = 0 and construct a(n) from a(n-1) by (i) incrementing the rightmost digit and (ii) if any digit is 2, replace the rightmost 2 with a 0 and increment the digit immediately to its left. (Note that changing "if" to "while" in this recipe gives the standard binary representation of n, A007088(n)).
Equivalently, a(2n+1) = a(n):1 and a(2n+2) = b(n):0, where b(n) is obtained from a(n) by incrementing the least significant digit and : denotes string concatenation.
If the digits of a(n) are d_k, d_{k-1}, ..., d_2, d_1, d_0, then n = Sum_{i=0..k} d_i*2^i, just as in standard binary notation. The difference is that here we are a bit lazy, and allow a few digits to be 2's. The number of 2's in a(n) appears to be A037800(n+1). - N. J. A. Sloane, Jun 03 2023
Every pair of 2's is separated by a 0 and every pair of significant 0's is separated by a 2.
a(n) has exactly floor(log_2((n+2)/3))+1 digits [cf. A033484] and their sum is exactly floor(log_2(n+1)) [A000523].
The i-th digit of a(n) is ceiling( floor( ((n+1-2^i) mod 2^(i+1))/2^(i-1) ) / 2).
A137951 gives values of terms interpreted as ternary numbers, a(n)=A007089(A137951(n)). - Reinhard Zumkeller, Feb 25 2008

Examples

			a(8) = 120 -> 121 -> 201 = a(9); a(9) = 201 -> 202 -> 210 = a(10).
		

References

  • Gerth S. Brodal, Worst-case efficient priority queues, SODA 1996.
  • Michael J. Clancy and D. E. Knuth, A programming and problem-solving seminar, Technical Report STAN-CS-77-606, Department of Computer Science, Stanford University, Palo Alto, 1977.
  • Haim Kaplan and Robert E. Tarjan, Purely functional representations of catenable sorted lists, STOC 1996.
  • Chris Okasaki, Purely Functional Data Structures, Cambridge, 1998.

Crossrefs

A158582: lazy binary different from regular binary, A089633: lazy binary and regular binary agree.

Programs

  • Maple
    A089591 := proc(n) option remember ; local nhalf ; if n <= 1 then RETURN(n) ; else nhalf := floor(n/2) ; if n mod 2 = 1 then RETURN(10*A089591(nhalf) +1) ; else RETURN(10*(A089591(nhalf-1)+1)) ; fi ; fi ; end: for n from 0 to 200 do printf("%d, ",A089591(n)) ; od ; # R. J. Mathar, Mar 11 2007
  • Mathematica
    a[n_] := a[n] = Module[{nhalf}, If[n <= 1, Return[n], nhalf = Floor[n/2]; If[Mod[n, 2]==1, Return[10*a[nhalf]+1], Return[10*(a[nhalf-1]+1)]]]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jan 19 2016, after R. J. Mathar *)

Extensions

More terms from R. J. Mathar, Mar 11 2007
Edited by Charles R Greathouse IV, Apr 30 2010
Edited by N. J. A. Sloane, Jun 03 2023

A374354 Irregular table T(n, k), n >= 0, 0 <= k < A277561(n), read by rows; the n-th row lists the fibbinary numbers f <= n such that n - f is also a fibbinary number whose binary expansion has no common 1's with that of f (where fibbinary numbers correspond to A003714).

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 2, 0, 4, 0, 1, 4, 5, 2, 4, 2, 5, 0, 8, 0, 1, 8, 9, 0, 2, 8, 10, 1, 2, 9, 10, 4, 8, 4, 5, 8, 9, 4, 10, 5, 10, 0, 16, 0, 1, 16, 17, 0, 2, 16, 18, 1, 2, 17, 18, 0, 4, 16, 20, 0, 1, 4, 5, 16, 17, 20, 21, 2, 4, 18, 20, 2, 5, 18, 21, 8, 16, 8, 9, 16, 17
Offset: 0

Views

Author

Rémy Sigrist, Jul 06 2024

Keywords

Comments

In other words, we partition n into pairs of fibbinary numbers whose binary expansions have no common 1's and list the corresponding fibbinary numbers to get the n-th row.

Examples

			Triangle T(n, k) begins:
  n   n-th row
  --  -----------
   0  0
   1  0, 1
   2  0, 2
   3  1, 2
   4  0, 4
   5  0, 1, 4, 5
   6  2, 4
   7  2, 5
   8  0, 8
   9  0, 1, 8, 9
  10  0, 2, 8, 10
  11  1, 2, 9, 10
  12  4, 8
  13  4, 5, 8, 9
  14  4, 10
  15  5, 10
  16  0, 16
		

Crossrefs

See A295989 and A374361 for similar sequences.

Programs

  • PARI
    row(n) = { my (r = [0], e, x, y, b); while (n, x = y = 0; e = valuation(n, 2); for (k = 0, oo, if (bittest(n, e+k), n -= b = 2^(e+k); [x, y] = [y + b, x], r = concat([v + y | v <- r], [v + x | v <- r]); break;););); return (r); }

Formula

T(n, 0) = 0 iff n is a fibbinary number.
T(n, k) + T(n, A277561(n)-1-k) = n.
T(n, 0) = A374355(n).
T(n, A277561(n)-1) = A374356(n).
Sum_{k = 0..A277561(n)-1} T(n, k) = n * 2^A037800(n).

A231902 Decimal expansion of Pi/4 + log(2)/2.

Original entry on oeis.org

1, 1, 3, 1, 9, 7, 1, 7, 5, 3, 6, 7, 7, 4, 2, 0, 9, 6, 4, 3, 2, 4, 2, 7, 6, 9, 0, 6, 5, 4, 8, 9, 6, 4, 0, 0, 5, 0, 8, 7, 0, 4, 2, 4, 1, 7, 0, 2, 3, 9, 0, 4, 0, 8, 2, 3, 0, 4, 0, 7, 6, 1, 5, 2, 8, 2, 3, 6, 5, 0, 9, 1, 2, 5, 5, 6, 3, 9, 9, 6, 0, 7, 4, 5, 9, 9, 4
Offset: 1

Views

Author

Bruno Berselli, Nov 15 2013

Keywords

Examples

			1.131971753677420964324276906548964005087042417023904082304076152823650...
		

References

  • L. B. W. Jolley, Summation of series, Dover Publications Inc. (New York), 1961, p. 28 (formula 154).
  • Jean-Marie Monier, Analyse, Exercices corrigés, 2ème année MP, Dunod, 1997, Exercice 3.15, p. 269.

Crossrefs

Cf. A003881 (Pi/4), A016655 (10*(log(2)/2)), A072691 (Pi^2/12).
Cf. A006752 (Catalan's constant)
Cf. A196521 (Pi/4-log(2)/2).
Cf. A037800.

Programs

  • Magma
    SetDefaultRealField(RealField(100)); R:=RealField(); (Pi(R) + 2*Log(2))/4; // G. C. Greubel, Aug 24 2018
  • Mathematica
    RealDigits[Pi/4 + Log[2]/2, 10, 90][[1]]
  • PARI
    default(realprecision, 100); (Pi + 2*log(2))/4 \\ G. C. Greubel, Aug 24 2018
    

Formula

Equals 1 + Sum_{m>=1} -(-1)^m/(2*m*(2*m+1)) = 1 + 1/(2*3) - 1/(4*5) + 1/(6*7) - 1/(8*9) + ... .
From Amiram Eldar, Jul 16 2020: (Start)
Equals Integral_{x=1..oo} arctan(x)/x^2 dx.
Equals 1 + Integral_{x=0..1/2} log(4*x^2 + 1) dx. (End)
From Bernard Schott, Sep 07 2020: (Start)
Equals -Sum_{n>=1} (-1)^(n*(n+1)/2) / n [compare with A196521 formula].
Equals Sum_{n>=0} (32*n^2+40*n+11) / (4*(n+1)*(2*n+1)*(4*n+1)*(4*n+3)). (End)
Equals 1 + Sum_{k>=1} A037800(k)/(k*(k+1)) (Allouche and Shallit, 1990). - Amiram Eldar, Jun 01 2021

A071933 a(n) = Sum_{i=1..n} K(i,i+1), where K(x,y) is the Kronecker symbol (x/y).

Original entry on oeis.org

1, 0, 1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 7, 8, 9, 8, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15, 14, 13, 14, 15, 14, 13, 14, 15, 14, 15, 16, 17, 16, 15, 16, 17, 16, 15, 16, 17, 16, 17, 18, 19, 18, 19, 20, 21, 20, 21, 22, 23, 22, 21, 22, 23, 22, 23
Offset: 1

Views

Author

Benoit Cloitre, Jun 14 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[KroneckerSymbol[j, j+1], {j, 1, n}], {n, 1, 80}] (* G. C. Greubel, Mar 17 2019 *)
  • PARI
    for(n=1,100,print1(sum(i=1,n,kronecker(i,i+1)),","))
    
  • Sage
    [sum(kronecker_symbol(j,j+1) for j in (1..n)) for n in (1..80)] # G. C. Greubel, Mar 17 2019

Formula

a(n) = n/4 + O(n), asymptotically. [Perhaps O(n) should be o(n)? - N. J. A. Sloane, Mar 26 2019]
In fact we have a(n) = n/4 + O(log(n)). More precisely let c(n)=A037800(n) then we get a(8n)=2n+2+2c(n), a(8n+1)=2n+3+2c(n), a(8n+2)=2n+2+2c(n), a(8n+3)=2n+2+2c(n)+(-1)^n, a(8n+4)=2n+3+2c(n)+(-1)^n, a(8n+5)=2n+4+2c(n)+(-1)^n, a(8n+6)=2n+3+2c(n)+(-1)^n, a(8n+7)=2n+3+2c(n+1). - Benoit Cloitre, Mar 30 2019

A385892 In the sequence of run lengths of binary indices of each positive integer (A245563), remove all duplicate rows after the first and take the last term of each remaining row.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 18 2025

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.

Examples

			The binary indices of 53 are {1,3,5,6}, with maximal runs ((1),(3),(5,6)), with lengths (1,1,2), which is the 16th row of A385817, so a(16) = 2.
		

Crossrefs

In the following references, "before" is short for "before removing duplicate rows".
Positions of firsts appearances appear to be A000071.
Without the removals we have A090996.
For sum instead of last we have A200648, before A000120.
For length instead of last we have A200650+1, before A069010 = A037800+1.
Last term of row n of A385817 (ranks A385818, before A385889), first A083368.
A245563 gives run lengths of binary indices, see A245562, A246029, A328592.
A384877 gives anti-run lengths of binary indices, A385816.

Programs

  • Mathematica
    Last/@DeleteDuplicates[Table[Length/@Split[Join@@Position[Reverse[IntegerDigits[n,2]],1],#2==#1+1&],{n,100}]]
Previous Showing 11-17 of 17 results.