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.

User: André Engels

André Engels's wiki page.

André Engels has authored 7 sequences.

A344985 Sum of imbalance of all initial subsequences of the binary representation of n.

Original entry on oeis.org

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

Author

André Engels, Jun 04 2021

Keywords

Comments

The imbalance of a sequence of zeros and ones is given as the absolute value of the difference between the number of zeros and the number of ones (that is, the absolute value of A037861 if n is the sequence A007088).

Examples

			9 in binary is 1001. The imbalance of 1 is 1, the imbalance of 10 is 0, the imbalance of 100 is 1 and the imbalance of 1001 is 0. thus a(9)=1+0+1+0=2.
		

Crossrefs

Programs

  • Maple
    imbal := proc(L)
         abs(numboccur(0, L) - numboccur(1, L))
    end proc:
    A344985 := proc(n)
        dgs := ListTools[Reverse](convert(n,base,2)) ;
        add(imbal( dgs[1..l]),l=1..nops(dgs)) ;
    end proc: # R. J. Mathar, Jul 07 2021
    # second Maple program:
    a:= proc(n) option remember; `if`(n=0, 0, a(iquo(n, 2))+
          (l-> abs(add(1-2*i, i=l)))(Bits[Split](n)))
        end:
    seq(a(n), n=1..80);  # Alois P. Heinz, Jul 07 2021
  • PARI
    a(n) = my(b=binary(n)); sum(k=1, #b, abs(sum(j=1, k, b[j]==1) - sum(j=1, k, b[j]==0))); \\ Michel Marcus, Jun 09 2021
    
  • Python
    def A344985(n):
        s, c, b = bin(n)[2:], 0, 0
        for x in s:
            b += 1 if x == '1' else -1
            c += abs(b)
        return c # Chai Wah Wu, Jul 07 2021

Formula

a(n) = a(floor(n/2)) + |A037861(n)|. - R. J. Mathar, Jul 07 2021

A329173 Smallest positive integer such that for any n no substring (subsequence without internal skips) of length n is repeated unless it contains the number n or higher.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 1, 3, 1, 2, 3, 1, 2, 4, 1, 2, 3, 2, 1, 3, 2, 1, 4, 1, 2, 3, 3, 1, 2, 4, 2, 1, 3, 3, 1, 3, 1, 3, 2, 2, 2, 3, 1, 3, 3, 2, 1, 4, 2, 1, 3, 4, 1, 2, 3, 4, 1, 2, 4, 1, 3, 1, 4, 1, 2, 4, 2, 2, 3, 2, 2, 3, 3, 2, 2, 4, 1, 2, 4, 3, 1, 2, 4, 3, 2, 1, 4
Offset: 1

Author

André Engels, Nov 07 2019

Keywords

Examples

			After 1,1,2,1,2, the next element is 2, because a 1 would repeat the length 3 substring 1,2,1. A 2 repeats the length 2 substring 2,2, but that's allowed because it contains a 2.
		

A288157 Number of bases b < n where the digits of n are not all different.

Original entry on oeis.org

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

Author

André Engels, Jun 06 2017

Keywords

Examples

			a(10)=4 because 10 equals 1010 base 2 (repeating both 0 and 1), 101 base 3 (repeating 1), 22 base 4 (repeating 2) and 11 base 9 (repeating 1), and 20, 14, 13, 12 in the other bases < 10, not repeating digits.
		

Crossrefs

a(n) = n - 1 - A270832(n).

Programs

  • Mathematica
    Table[n - 1 - Boole[n > 1] - Count[Range[2, n - 1], b_ /; UnsameQ @@ IntegerDigits[n, b]], {n, 99}] (* Michael De Vlieger, Jun 15 2017 *)
  • PARI
    a(n) = sum(b=2, n, d = digits(n, b); #d != #Set(d)); \\ Michel Marcus, Jun 13 2017
    
  • PARI
    a(n)=my(s=sqrtint(n)); sum(b=2, s, my(d=digits(n,b)); #Set(d)!=#d) + sum(k=1,n\(s+1), n%k==0 && n/k>s+1) \\ Charles R Greathouse IV, Jun 15 2017

A270832 Number of bases in which n is written using more than 1 digit, all of which are distinct.

Original entry on oeis.org

0, 1, 1, 1, 2, 3, 4, 4, 5, 5, 8, 7, 9, 9, 11, 10, 12, 12, 16, 14, 16, 16, 18, 17, 19, 19, 22, 22, 24, 23, 25, 24, 27, 27, 30, 27, 30, 32, 34, 32, 35, 34, 36, 37, 38, 38, 41, 39, 42, 41, 45, 45, 48, 47, 48, 48, 49, 51, 53, 48, 53, 54, 55, 53, 57, 58, 60, 60, 63, 62
Offset: 1

Author

André Engels, Mar 23 2016

Keywords

Comments

n/2 - 1 <= a(n) < n.
a(n) is not always <= n - sqrt(n) + 1. Counterexample: for n = 1000000, a(n) = 999911 > 999001 = n - sqrt(n) + 1. - Lucas O. Wagner, Jul 27 2019

Examples

			a(5) = 2 because 5 equals 10 in base 5, 12 in base 3. In base 2 (101) and base 4 (11) there are repeated digits, in base > 5 it is only one digit long.
		

Programs

  • Mathematica
    Table[Count[Function[b, AllTrue[DigitCount[n, b], # <= 1 &]] /@ Range[2, n], True], {n, 70}] (* Michael De Vlieger, Mar 24 2016, Version 10 *)
  • PARI
    a(n) = sum(b=2, n, v = digits(n,b); (#v > 1) && (#v == #Set(v))); \\ Michel Marcus, Mar 24 2016

A228071 Write n in binary and interpret as a decimal number; a(n) is this quantity minus n.

Original entry on oeis.org

0, 0, 8, 8, 96, 96, 104, 104, 992, 992, 1000, 1000, 1088, 1088, 1096, 1096, 9984, 9984, 9992, 9992, 10080, 10080, 10088, 10088, 10976, 10976, 10984, 10984, 11072, 11072, 11080, 11080, 99968, 99968, 99976, 99976, 100064, 100064, 100072, 100072, 100960, 100960
Offset: 0

Author

André Engels, Aug 08 2013

Keywords

Comments

Difference between decimal and binary numbers written the same.

Examples

			5 in binary is written 101, so a(5) = 101-5 = 96.
		

Crossrefs

Programs

  • Magma
    [Seqint(Intseq((n), 2))-n: n in [0..50]];  // Vincenzo Librandi, Feb 20 2016
  • Mathematica
    Table[d = IntegerDigits[n, 2]; FromDigits[d, 10] - n, {n, 50}] (* T. D. Noe, Aug 08 2013 *)
  • PARI
    a(n)=subst(Pol(binary(n)),'x,10)-n \\ Charles R Greathouse IV, Aug 09 2013
    

Formula

a(n) ~ A007088(n). - Charles R Greathouse IV, Aug 09 2013
a(2^n + r) = a(2^n) + a(r) for 1 <= r <= 2^n - 1. - Peter Bala, Aug 12 2013
a(n) = A007088(n) - n. - Omar E. Pol, Aug 27 2013

A089071 Number of liberties a big eye of size n gives in the game of Go.

Original entry on oeis.org

1, 2, 3, 5, 8, 12, 17, 23, 30, 38, 47, 57, 68, 80, 93, 107, 122, 138, 155, 173, 192, 212, 233, 255, 278, 302, 327, 353, 380, 408, 437, 467, 498, 530, 563, 597, 632, 668, 705, 743, 782, 822, 863, 905, 948, 992, 1037, 1083, 1130, 1178, 1227, 1277, 1328, 1380
Offset: 1

Author

André Engels, Dec 03 2003

Keywords

Comments

The terms after the seventh are considered to be of only theoretical importance, since the largest dead shape is six spaces.

Examples

			A 5-space big eye can be almost filled in 4 moves, after which one takes and has a 4-space big eye (5 liberties) left. This gives a total of 4 + 5 moves for the opponent and 1 for oneself, for de facto 8 liberties.
		

Crossrefs

Cf. A022856.

Programs

  • Magma
    [n eq 1 select 1 else Binomial(n-1,2) +2: n in [1..65]]; // G. C. Greubel, Oct 31 2022
    
  • Mathematica
    Join[{1}, Binomial[Range[65],2] +2] (* G. C. Greubel, Oct 31 2022 *)
  • SageMath
    [binomial(n-1,2)+2-int(n==1) for n in range(1,65)] # G. C. Greubel, Oct 31 2022

Formula

a(n) = a(n-1) + n - 2 for n>=3.
From Paul Barry, Dec 07 2009: (Start)
G.f.: (1 - x + x^3)/(1-x)^3.
a(n) = n + 1 - 0^n + C(n-1,2). (End)
a(n) = A022856(n+2). - R. J. Mathar, Oct 30 2011

Extensions

More terms from David Wasserman, Aug 29 2005

A090589 Number of letters in n (in Dutch) counting 'ij' as two letters.

Original entry on oeis.org

3, 3, 4, 4, 4, 4, 3, 5, 4, 5, 4, 3, 6, 7, 8, 8, 7, 9, 8, 9, 7, 12, 13, 13, 13, 13, 12, 14, 13, 14, 6, 11, 12, 12, 12, 12, 11, 13, 12, 13, 7, 12, 13, 13, 13, 13, 12, 14, 13, 14, 7, 12, 13, 13, 13, 13, 12, 14, 13, 14, 6, 11, 12, 12, 12, 12, 11, 13, 12, 13, 8, 13, 14, 14, 14, 14, 13, 15, 14, 15, 7, 12, 13, 13, 13, 13, 12, 14, 13, 14, 8, 13, 14, 14, 14, 14, 13, 15, 14, 15, 7
Offset: 0

Author

André Engels, Dec 03 2003

Keywords

Comments

The 'ij' in 'vijf' has been counted as two letters here. Counting it as one or two letters are both common in Dutch.

Crossrefs

Cf. A007485 gives the sequence when the 'ij' is considered as one letter.

Extensions

a(0) and a(79)-a(100) from Charles R Greathouse IV, Aug 26 2017