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 21-30 of 35 results. Next

A158582 Numbers with at least two zeros in their binary representation.

Original entry on oeis.org

4, 8, 9, 10, 12, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 60, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 16 2009

Keywords

Comments

Subsequence of A158581; complement of A089633; A023416(a(n))>1.
A265705(a(n),k) != A265705(a(n),a(n)-k) for at least one k <= a(n). - Reinhard Zumkeller, Dec 15 2015

Crossrefs

Programs

  • Haskell
    a158582 n = a158582_list !! (n-1)
    a158582_list = [x | x <- [0..], a023416 x > 1]
    -- Reinhard Zumkeller, Mar 31 2015
    
  • Mathematica
    Select[Range[100],DigitCount[#,2,0]>1&] (* Harvey P. Dale, Jan 19 2015 *)
  • Python
    def A158582(n):
        def f(x):
            c = n+(((l:=(x+1).bit_length())+1)*(l-2)>>1)
            m = bin(x+1)[2:].find('0')
            c += m if m>-1 else l
            return c
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Dec 24 2024

A359756 First position of n in the sequence of zero-based weighted sums of standard compositions (A124757), if we start with position 0.

Original entry on oeis.org

0, 3, 6, 7, 13, 14, 15, 27, 29, 30, 31, 55, 59, 61, 62, 63, 111, 119, 123, 125, 126
Offset: 0

Views

Author

Gus Wiseman, Jan 17 2023

Keywords

Comments

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. This gives a bijective correspondence between nonnegative integers and integer compositions.
The zero-based weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} (i-1)*y_i.
Is this sequence strictly increasing?

Examples

			The terms together with their standard compositions begin:
    0: ()
    3: (1,1)
    6: (1,2)
    7: (1,1,1)
   13: (1,2,1)
   14: (1,1,2)
   15: (1,1,1,1)
   27: (1,2,1,1)
   29: (1,1,2,1)
   30: (1,1,1,2)
   31: (1,1,1,1,1)
		

Crossrefs

The one-based version is A089633, for prime indices A359682.
First index of n in A124757, reverse A231204.
The version for prime indices is A359676, reverse A359681.
A053632 counts compositions by zero-based weighted sum.
A066099 lists standard compositions.
A304818 gives weighted sums of prime indices, reverse A318283.
A320387 counts multisets by weighted sum, zero-based A359678.

Programs

  • Mathematica
    nn=10;
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    wts[y_]:=Sum[(i-1)*y[[i]],{i,Length[y]}];
    seq=Table[wts[stc[n]],{n,0,2^(nn-1)}];
    Table[Position[seq,k][[1,1]]-1,{k,0,nn}]

Formula

Appears to be the complement of A083329 in A089633.

A362248 a(n) is the number of locations 1..n-1 which can reach i=n-1, where jumps from location i to i +- a(i) are permitted (within 1..n-1); a(1)=1. See example.

Original entry on oeis.org

1, 1, 2, 3, 1, 5, 6, 7, 1, 1, 2, 11, 1, 13, 14, 15, 1, 1, 2, 3, 1, 5, 6, 23, 1, 1, 2, 27, 1, 29, 30, 31, 1, 1, 2, 3, 1, 5, 6, 7, 1, 1, 2, 11, 1, 13, 14, 47, 1, 1, 2, 3, 1, 5, 6, 55, 1, 1, 2, 59, 1, 61, 62, 63, 1, 1, 2, 3, 1, 5, 6, 7, 1, 1, 2, 11, 1, 13, 14, 15
Offset: 1

Views

Author

Neal Gersh Tolunsky, May 12 2023

Keywords

Comments

Note that location n-1 itself is counted as a term which can reach i=n-1.
Conjecture: a(n) is also the largest number such that starting point i=n can reach every previous location (with a(1)=1 and the same rule for jumps as in the current name).
A047619 appears to be the indices of 1's in this sequence.
A023758 appears to be the indices of terms for which a(n)=n-1.
A089633 appears to be the distinct values of the sequence (and its complement A158582 the missing values).
The sequence appears to consist of monotonically increasing runs of length 4.
It appears that a(A004767(n))=A100892(n) and a(A016825(n))=A100892(n)-1.

Examples

			a(6)=5 because there are 5 starting terms from which i=5 can be reached:
  1, 1, 2, 3, 1
  1->1->2---->1
We can see that i=1,2,3 and trivially 5 can reach i=5. i=4 can also reach i=5:
  1, 1, 2, 3, 1
  1<-------3
  1->1->2---->1
This is a total of 5 locations, so a(6)=5.
		

Crossrefs

Programs

  • C
    /* See links */

Extensions

a(24) onwards from Kevin Ryde, May 17 2023

A181741 Primes of the form 2^t-2^k-1, k>=1.

Original entry on oeis.org

3, 5, 7, 11, 13, 23, 29, 31, 47, 59, 61, 127, 191, 223, 239, 251, 383, 479, 503, 509, 991, 1019, 1021, 2039, 3583, 3967, 4079, 4091, 4093, 6143, 8191, 15359, 16127, 16319, 16381, 63487, 65407, 65519, 129023, 131063, 131071, 245759, 253951, 261631, 261887, 262079, 262111, 262127, 262139
Offset: 1

Views

Author

Vladimir Shevelev, Nov 08 2010

Keywords

Comments

All Mersenne primes A000668(i) are in the sequence, parametrized by t=A000043(i)+1 and k=A000043(i).
If p is in the sequence, then the exponents t and k are unique.
For given k, the smallest value of t defines sequence A181692.
Every term p=2^t-2^k-1 in this sequence here generates an entry 2^(t-1)*p in A181595 (cf. A181701).

Crossrefs

Cf. A010051, primes in A081118, see also A208083.

Programs

  • Haskell
    a181741 n = a181741_list !! (n-1)
    a181741_list = filter ((== 1) . a010051) a081118_list
    -- Reinhard Zumkeller, Feb 23 2012
    
  • Maple
    isA000079 := proc(n) if n = 1 then true; elif type(n,'odd') then false; else if nops( numtheory[factorset](n) ) = 1 then  true;  else
    false; end if; end if; end proc:
    isA181741 := proc(p) if isprime(p) then k := A007814(p+1) ; (p+1)/2^k+1 ; return ( isA000079(%) and k >=1 ) ; else
    false;  end if; end proc:
    for i from 1 to 1000 do p := ithprime(i) ; if isA181741(p) then printf("%d,",p) ; end if; end do: # R. J. Mathar, Nov 18 2010
  • Mathematica
    Select[Table[2^t-2^k-1, {t, 1, 20}, {k, 1, t-1}] // Flatten // Union, PrimeQ] (* Jean-François Alcover, Nov 16 2017 *)
  • PARI
    lista(nn) = {for (n=3, nn, forstep(k=n-1, 1, -1, if (isprime(p=2^n-2^k-1), print1(p, ", "));););} \\ Michel Marcus, Dec 17 2018
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    def A181741_gen(): # generator of terms
        m = 2
        for t in count(1):
            r=1<>=1
            m<<=1
    A181741_list = list(islice(A181741_gen(),30)) # Chai Wah Wu, Jul 08 2022

Formula

Conjecture: equals the intersection of A000040 and A081118 or the intersection of A000040 and A089633. [R. J. Mathar, Nov 18 2010]

Extensions

Corrected (251 and 1019 inserted) and extended by R. J. Mathar, Nov 18 2010

A188529 Numbers which contain only the digit 3 in their base-4 representation, with at most one exception. If the exception is the most-significant digit, it must be the digit 1 or 2, otherwise the exception must be the digit 2.

Original entry on oeis.org

1, 2, 3, 7, 11, 14, 15, 31, 47, 59, 62, 63, 127, 191, 239, 251, 254, 255, 511, 767, 959, 1007, 1019, 1022, 1023, 2047, 3071, 3839, 4031, 4079, 4091, 4094, 4095, 8191, 12287, 15359, 16127, 16319, 16367, 16379, 16382, 16383, 32767, 49151, 61439, 64511, 65279, 65471, 65519
Offset: 1

Views

Author

Vladimir Shevelev, Apr 03 2011

Keywords

Comments

The sequence lists the positive binomial coefficient predictors in base 4. For definition, see paper in link.
A subsequence of A089633.

Examples

			(767)_10 = (23333)_4 contains only digits 3, with the exception the leading digit which is 2. Therefore 767 is in the sequence.
(4091)_10 = (333323)_4 contains only digits 3, with the exception a digit 2.
		

Crossrefs

Programs

  • Maple
    isA188529 := proc(n) local dgs ,n3,p,d; dgs := convert(n,base,4); n3 := 0 ; for p from 1 to nops(dgs) do d := op(p,dgs) ; if d <> 3 then n3 := n3+1 ; if n3 >=2 then return false; end if; if p < nops(dgs) and d <> 2 then return false; end if; if p = nops(dgs) and d = 0 then return false; end if; end if; end do: return true; end proc:
    A188529 := proc(n) option remember; local a; if n = 1 then 1; else for a from procname(n-1)+1 do if isA188529(a) then return a; end if; end do; end if; end proc:
    seq(A188529(n),n=1..50) ; # R. J. Mathar, Apr 03 2011

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

A188531 Numbers which contain only the digit 4 in their base-5 representation, with at most one exception. If the exception is the most-significant digit, it must be the digit 1, 2, or 3, otherwise the exception must be the digit 3.

Original entry on oeis.org

1, 2, 3, 4, 9, 14, 19, 23, 24, 49, 74, 99, 119, 123, 124, 249, 374, 499, 599, 619, 623, 624, 1249, 1874, 2499, 2999, 3099, 3119, 3123, 3124, 6249, 9374, 12499, 14999, 15499, 15599, 15619, 15623, 15624, 31249, 46874, 62499, 74999, 77499, 77999, 78099, 78119
Offset: 1

Views

Author

Vladimir Shevelev, Apr 03 2011

Keywords

Comments

The sequence lists the positive binomial coefficient predictors in base 5. For definition, see paper in link.

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local i, l, m, t;
          m:= `if`(n=1, 0, a(n-1));
          l:=NULL;
          for t while m>0 do l:=l, irem(m, 5, 'm') od;
          l:= array([l, 0]);
          for i while l[i]=4 do od;
          if l[i]<3 then l[i]:= l[i]+1
                    else l[i]:= 4;
                         if i>1 then l[i-1]:= 3 fi
          fi;
          add(l[i] *5^(i-1), i=1..t)
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 03 2011
  • Mathematica
    aQ[n_] := Module[{d=IntegerDigits[n,5]}, s=Select[d, #!=4 &]; s=={} || s =={3} || (d[[1]]<3 && s=={d[[1]]})]; Select[Range[100000], aQ] (* Amiram Eldar, Dec 14 2018 *)
  • PARI
    listb(nd) = {for (i = 1, nd, my(v = vector(nd, k, 4), kstart = if (i==1, 1, 3)); for (k=kstart,3, v[i] = k; print1(fromdigits(v, 5), ", "););); print1(fromdigits(vector(nd, k, 4), 5), ", ");}
    lista(nnd) = {for (nd=1, nnd, listb(nd););} \\ Michel Marcus, Dec 14 2018

A188532 Numbers which contain only the digit 5 in their base-6 representation, with at most one exception. If the exception is the most-significant digit, it must be the digit 1, 2, 3, or 4, otherwise the exception must be the digit 4.

Original entry on oeis.org

1, 2, 3, 4, 5, 11, 17, 23, 29, 34, 35, 71, 107, 143, 179, 209, 214, 215, 431, 647, 863, 1079, 1259, 1289, 1294, 1295, 2591, 3887, 5183, 6479, 7559, 7739, 7769, 7774, 7775, 15551, 23327, 31103, 38879, 45359, 46439, 46619, 46649, 46654, 46655, 93311, 139967
Offset: 1

Views

Author

Vladimir Shevelev, Apr 03 2011

Keywords

Comments

The sequence lists the positive binomial coefficient predictors in base 6. For definition, see paper in link.

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local i, l, m, t;
          m:= `if`(n=1, 0, a(n-1));
          l:=NULL;
          for t while m>0 do l:=l, irem(m, 6, 'm') od;
          l:= array([l, 0]);
          for i while l[i]=5 do od;
          if l[i]<4 then l[i]:= l[i]+1
                    else l[i]:= 5;
                         if i>1 then l[i-1]:= 4 fi
          fi;
          add(l[i] *6^(i-1), i=1..t)
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 03 2011

A211344 Atomic Boolean functions interpreted as binary numbers.

Original entry on oeis.org

1, 3, 5, 15, 51, 85, 255, 3855, 13107, 21845, 65535, 16711935, 252645135, 858993459, 1431655765, 4294967295, 281470681808895, 71777214294589695, 1085102592571150095, 3689348814741910323, 6148914691236517205
Offset: 0

Views

Author

Tilman Piesk, Jul 24 2012

Keywords

Comments

Row n of the triangle shows the atoms among n-ary Boolean functions:
1 01
3 5 0011 0101
15 51 85 00001111 00110011 01010101
Often n-ary x_k = T(n,k), e.g. for 2-ary functions x_1=0011, x_2=0101 and for 3-ary functions x_1=00001111, x_2=00110011, x_3=01010101.
An easier generalized way is the enumeration from right to left, here shown with k starting from 0, so that n-ary x_k = T(n, n-k-1). As numbers in the diagonals on the right have the same bit pattern, this corresponds to the infinitary definition of x_k as a binary fraction 1/A000215(k) = 1/(2^2^k + 1):
2-ary x_0=0101=5, 3-ary x_0=01010101=85, infinitary x_0 = 1/3 = .010101...
2-ary x_1=0011=3, 3-ary x_1=00110011=51, infinitary x_1 = 1/5 = .001100110011...

Crossrefs

A001317, A089633, A051179 (left diagonal)

Programs

  • MATLAB
    Seq = sym(zeros(55,1)) ;
    Filledlines = 0 ;
    for m=1:10
        for n=1:m
            Sum = sym(0) ;
            for k=0:2^m-1
                if mod(  floor( k/2^(m-n) )  ,2) == 0
                   Sum = Sum + 2^sym(k) ;
                end
            end
            Seq( Filledlines + n ) = Sum ;
        end
        Filledlines = Filledlines + m ;
    end
    
  • Python
    from itertools import count, islice
    def A211344_gen(): # generator of terms
        return (sum((bool(~(m:=(1<A211344_list = list(islice(A211344_gen(),20)) # Chai Wah Wu, May 03 2023
    
  • Python
    def arity_and_atom_to_integer(arity, atom):
        result = 0
        max_place = (1 << arity) - (1 << atom) - 1
        for exponent in range(max_place + 1):
            if not bool(~max_place & max_place - exponent):
                place_value = 1 << exponent
                result += place_value
        return result
    def A211344(n, k):
        return arity_and_atom_to_integer(n, n-k-1) # Tilman Piesk, Jan 25 2025

Formula

A359757 Greatest positive integer whose weakly increasing prime indices have zero-based weighted sum (A359674) equal to n.

Original entry on oeis.org

4, 9, 25, 49, 121, 169, 289, 361, 529, 841, 961, 1369, 1681, 1849, 2209, 2809, 3481, 3721, 4489, 5041, 5329, 6241, 6889, 7921, 9409, 10201, 12167, 11449, 15341, 24389, 16399, 26071, 29791, 31117, 35557, 50653, 39401, 56129, 68921, 58867, 72283, 83521, 79007, 86903, 103823
Offset: 1

Views

Author

Gus Wiseman, Jan 16 2023

Keywords

Comments

Appears to first differ from A001248 at a(27) = 12167, A001248(27) = 10609.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
The zero-based weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} (i-1)*y_i.

Examples

			The terms together with their prime indices begin:
    4: {1,1}
    9: {2,2}
   25: {3,3}
   49: {4,4}
  121: {5,5}
  169: {6,6}
  289: {7,7}
  361: {8,8}
  529: {9,9}
  841: {10,10}
		

Crossrefs

The one-based version is A359497, minimum A359682 (sorted A359755).
Last position of n in A359674, reverse A359677.
The minimum instead of maximum is A359676, sorted A359675, reverse A359681.
A053632 counts compositions by zero-based weighted sum.
A112798 lists prime indices, length A001222, sum A056239, reverse A296150.
A124757 = zero-based weighted sum of standard compositions, reverse A231204.
A304818 gives weighted sums of prime indices, reverse A318283.
A320387 counts multisets by weighted sum, zero-based A359678.
A358136 = partial sums of prime indices, ranked by A358137, reverse A359361.

Programs

  • Mathematica
    nn=10;
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    wts[y_]:=Sum[(i-1)*y[[i]],{i,Length[y]}];
    seq=Table[wts[prix[n]],{n,2^nn}];
    Table[Position[seq,k][[-1,1]],{k,nn}]
  • PARI
    a(n)={ my(recurse(r, k, m) = if(k==1, if(m>=r, prime(r)^2),
        my(z=0); for(j=1, min(m, (r-k*(k-1)/2)\k), z=max(z, self()(r-k*j, k-1, j)*prime(j))); z));
      vecmax(vector((sqrtint(8*n+1)-1)\2, k, recurse(n,k,n)));
    } \\ Andrew Howroyd, Jan 21 2023

Extensions

Terms a(21) and beyond from Andrew Howroyd, Jan 21 2023
Previous Showing 21-30 of 35 results. Next