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-10 of 11 results. Next

A181929 Numbers n such that n is the substring identical to the most significant bits of its base 2 representation.

Original entry on oeis.org

0, 1, 10, 110, 10011, 110101, 10011000, 110100011, 10010101001, 101111000101, 110011001110, 10010001101010, 101101111110011, 110010000001101, 1111110010100011, 10001110000111111, 101100111001011100, 110000110110011001, 1111011010110001101
Offset: 1

Views

Author

Douglas Latimer, Apr 02 2012

Keywords

Comments

The main idea behind my program is that if we say start searching from 10000, which is 10011... binary, then as the binary string for the first 5 places is larger than our decimal value, then the decimal value can be immediately jumped to 10011 for the next search number. Repeating this process (while also doing slight jumps if the decimal value is larger than the binary), allows ones to do very large jumps in the checked decimal values, sometimes eliminating an entire string of length n in just a few checks. I got the idea from similar people were using when searching for the next term in A258107. - Scott R. Shannon, Feb 25 2021

Examples

			The number 110 is represented in the binary system by the string "1101110". 110 is a three-digit number, so we consider the 3 most significant bits, which are "110", identical to the string of digits used to represent the number 110. Thus 110 is in the sequence.
		

Crossrefs

This is a subsequence of A038102. Sequence A181891 has a similar definition.
Subsequence of A007088.

Programs

  • Mathematica
    fQ[n_] := Module[{d = IntegerDigits[n], len}, len = Length[d]; d == Take[IntegerDigits[n, 2], len]]; Select[Range[0, 1000000], fQ] (* T. D. Noe, Apr 03 2012 *)
  • PARI
    {for(vv=0,2000000,bvv=binary(vv);
    ll=length(bvv);texp=0;btod=0;
    forstep(i=ll,1,-1,btod=btod+bvv[i]*10^texp;texp++);
    bigb=binary(btod);swsq=1;
    for(j=1,ll,if(bvv[j]!=bigb[j],swsq=0));
    if(swsq==1,print(btod)))}
    
  • PARI
    lista(nn) = {for (n=0, nn, if (n==0, print1(n, ", "), my(b = binary(n), db = fromdigits(b), bb = binary(db)); if (vector(#b, k, bb[k]) == b, print1(db, ", "));););} \\ Michel Marcus, Feb 10 2021

A146025 Numbers that can be written in bases 2, 3, 4, and 5 using only the digits 0 and 1.

Original entry on oeis.org

0, 1, 82000
Offset: 1

Views

Author

Daniel Mondot, Oct 26 2008

Keywords

Comments

Originally checked to 2^65520 (or about 3*10^19723) on Nov 07 2008. - Daniel Mondot, Jan 17 2016
Conjectured to be complete. a(4), if it exists, is greater than 10^15. - Charles R Greathouse IV, Apr 06 2012
Checked to 3125 (5^5) base-5 digits in just under 1/2 hour using a minor modification of the PARI program at A230360. Interestingly, with 5 replaced by 9 and the digits 2 and 3 permitted, it appears the complete set is--somewhat coincidental with this--{0, 1, 2, 3, 8281, 8282, 8283}, see A146026. - James G. Merickel, Dec 01 2013
Checked to 11 million decimal digits in 1 week using an algorithm that, upon finding that the current guess has non-{0,1} digits in a particular base, increases the guess to only have {0,1} digits in that base. C code in links. - Alex P. Klinkhamer, Aug 29 2015
It is a plausible conjecture that there are no more terms, but this has not been proved. - N. J. A. Sloane, Feb 06 2016

Examples

			82000 = 10100000001010000 (2) = 11011111001 (3) = 110001100 (4) = 10111000 (5).
		

Crossrefs

Intersection of A005836, A000695, and A033042.
Cf. A258981 (bases 2,3,4), A258107 (bases 2..n).

Programs

  • Mathematica
    f[n_] := Total[Total@ Drop[RotateRight[DigitCount[n, #]], 2] & /@ Range[3, 5]]; Select[Range[0, 100000], f@ # == 0 &] (* Michael De Vlieger, Aug 29 2015 *)
  • PARI
    is(n)=vecmax(digits(n,5))<2 && vecmax(digits(n,4))<2 && vecmax(digits(n,3))<2 \\ Charles R Greathouse IV, Aug 31 2015

Extensions

Edited by Charles R Greathouse IV, Nov 01 2009
Search limit extended to astronomical odds by James G. Merickel, Dec 03 2013
Search limit increased again with example code by Alex P. Klinkhamer, Aug 29 2015
Removed keywords "fini" and "full", since it is only a conjecture that there are no further terms. - N. J. A. Sloane, Feb 06 2016

A275600 Numbers that can be written in all bases from base 2 to base 6 using only the digits 0, 1 and 2.

Original entry on oeis.org

0, 1, 2, 6, 36, 37, 260, 1302, 1376, 1380, 1381, 1382, 1556, 1560, 1561, 1562, 16932, 562500, 562501, 562502, 562506, 562512, 562536, 562537, 562752, 562760, 23610752, 23610756, 23610757, 23610786, 23615750, 23615760, 23615761, 23615762, 23615785, 23615786, 23626310
Offset: 1

Views

Author

Sergio Pimentel, Aug 03 2016

Keywords

Comments

Is there any number that keeps this property also in base 7, other than the trivial cases 0,1,2?

Examples

			16932 is in the sequence because this number can be written in bases 2 through 6 using only the digits 0, 1 and 2: 16932(b4)  = 10020210 / (b5) = 1020212 / (b6) = 210220.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6], Function[k, Max@ Flatten@ Map[IntegerDigits[k, #] &, Range[4, 6]] < 3]] (* or *)
    Select[Range[10^5], Function[k, Total@ Flatten@ Map[Take[RotateRight@ DigitCount[k, #], -(# - 3)] &, Range[4, 6]] == 0]] (* (not as efficient) Michael De Vlieger, Aug 03 2016 *)
  • PARI
    nextWithSmallDigits(n, base) = my (pow=1, rem=n, val=0, d); while (rem>0, d = rem % base; rem = rem \ base; if (d>2, val = 0; rem = rem+1, val = val + d*pow); pow = pow * base); return (val)
    { n = 0; prev = 0; while (n < 300, succ = prev; for (b=4,6, succ = nextWithSmallDigits(succ, b)); if (prev==succ, n = n+1; print(n " " prev); prev = succ+1, prev = succ)) } \\ Rémy Sigrist, Sep 08 2016
  • Perl
    use ntheory ":all"; my($x,$n10)=(0,0); while ($x < 50) { my $n = fromdigits( todigitstring($n10++, 3), 6);  next if vecany { $ > 2 } todigits($n, 4);  next if vecany { $ > 2 } todigits($n, 5);  print ++$x," $n\n"; } # Dana Jacobsen, Aug 16 2016
    
  • Python
    from gmpy2 import digits
    A275600_list = [n for n in (int(digits(m,3),6) for m in range(10**6)) if max(digits(n,5)) <= '2' and max(digits(n,4)) <= '2'] # Chai Wah Wu, Aug 15 2016
    

Extensions

a(18)-a(26) from Michael De Vlieger, Aug 03 2016
a(27)-a(37) from Chai Wah Wu, Aug 15 2016

A335051 a(n) is the smallest decimal number > 1 such that when it is written in all bases from base 2 to base n those numbers all contain both 0 and 1.

Original entry on oeis.org

2, 9, 19, 28, 145, 384, 1128, 2601, 2601, 101256, 103824, 382010, 572101, 971400, 1773017, 1773017, 22873201, 64041048, 64041048, 1193875201, 2496140640, 10729882801, 21660922801, 120068616277, 333679563001, 427313653201, 427313653201, 10436523921264, 10868368953601
Offset: 2

Views

Author

Keywords

Comments

The sequence is infinite since 1 + lcm(2,...,n)^2 is always a candidate for a(n). - Giovanni Resta, May 24 2020

Examples

			a(3) = 9 as 9_2 = 1001 and 9_3 = 100, both of which contain a 0 and 1.
a(6) = 145 as 145_2 = 10010001, 145_3 = 12101, 145_4 = 2101, 145_5 = 1040, 145_6 = 401, all of which contain a 0 and 1.
a(9) = 2601 as 2601_2 = 101000101001, 2601_3 = 10120100, 2601_4 = 220221, 2601_5 = 40401, 2602_6 = 20013, 2601_7 = 10404, 2601_8 = 5051, 2601_9 = 3510, all of which contain a 0 and 1. Note that, as 2601 also contains a 0 and 1, a(10) = 2601.
a(16) = 1773017 as 1773017_2 = 110110000110111011001, 1773017_3 = 10100002010022, 1773017_4 = 12300313121, 1773017_5 = 423214032, 1773017_6 = 102000225, 1773017_7 = 21033101, 1773017_8 = 6606731, 1773017_9 = 3302108, 1773017_10 = 1773017, 1773017_11 = 1001104, 1773017_12 = 716075, 1773017_13 = 4A102C, 1773017_14 = 342201, 1773017_15 = 250512, 1773017_16 = 1B0DD9, all of which contain a 0 and 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{k=2}, While[ AnyTrue[ Range[n, 2, -1], ! SubsetQ[ IntegerDigits[k, #], {0, 1}] &], k++]; k]; a /@ Range[2, 13] (* Giovanni Resta, May 24 2020 *)
  • Python
    from numba import njit
    @njit
    def hasdigits01(n, b):
        has0, has1 = False, False
        while n >= b:
          n, r = divmod(n, b)
          if r == 0: has0 = True
          if r == 1: has1 = True
          if has0 and has1: return True
        return has0 and (has1 or n==1)
    @njit
    def a(n, start=2):
      k = start
      while True:
        for b in range(n, 1, -1):
          if not hasdigits01(k, b): break
        else: return k
        k += 1
    anm1 = 2
    for n in range(2, 21):
      an = a(n, start=anm1)
      print(an, end=", ")
      anm1 = an # Michael S. Branicky, Feb 09 2021

Extensions

a(29)-a(30) from Giovanni Resta, May 24 2020

A335066 Decimal numbers such that when they are written in all bases from 2 to 10 those numbers all share a common digit (the digit 0 or 1).

Original entry on oeis.org

1, 81, 91, 109, 127, 360, 361, 417, 504, 540, 541, 631, 661, 720, 781, 841, 918, 981, 991, 1008, 1009, 1039, 1080, 1081, 1088, 1089, 1090, 1091, 1093, 1099, 1105, 1111, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1128, 1134, 1135, 1136, 1137, 1138, 1139
Offset: 1

Views

Author

Keywords

Comments

As base 2 is included the only possible common digit between all the bases is either a 0 or 1.

Examples

			1 is a term as 1 written in all bases is 1.
81 is a term as 81_2 = 1010001, 81_3 = 10000, 81_4 = 1101, 81_5 = 311, 81_6 = 213, 81_7 = 144, 81_8 121, 81_9 = 100, 81_10 = 81, all of which contain the digit 1.
360 is a term as 360_2 = 101101000, 360_3 = 111100, 360_4 = 11220, 360_5 = 2420, 360_6 = 1400, 360_7 = 1023, 360_8 = 550, 360_9 = 550, 360_10 = 360, all of which contain the digit 0.
		

Crossrefs

Programs

  • Python
    def hasdigits01(n, b):
        has0, has1 = False, False
        while n >= b:
            n, r = divmod(n, b)
            if r == 0: has0 = True
            if r == 1: has1 = True
            if has0 and has1: return (True, True)
        return (has0, has1 or n==1)
    def ok(n):
        all0, all1 = True, True
        for b in range(10, 1, -1):
            has0, has1 = hasdigits01(n, b)
            all0 &= has0; all1 &= has1
            if not all0 and not all1: return False
        return all0 or all1
    print([k for k in range(1140) if ok(k)]) # Michael S. Branicky, May 23 2022

A258946 Numbers that can be expressed using only the digits 0 and 1 in no more than three different bases.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 11, 14, 15, 18, 19, 22, 23, 24, 29, 32, 33, 34, 35, 38, 41, 44, 45, 46, 47, 48, 51, 52, 53, 54, 55, 58, 59, 60, 61, 62, 63, 66, 67, 70, 71, 74, 75, 76, 77, 78, 79, 83, 86, 87, 88, 89, 92, 95, 96, 97, 98, 99, 102, 103, 104, 105, 106, 107
Offset: 1

Views

Author

Thomas Oléron Evans, Jun 15 2015

Keywords

Comments

All integers n >= 4 may trivially be expressed using only the digits 0 and 1 in three different bases: 2, n-1 (as '11') and n (as '10'). The numbers in this sequence cannot be expressed using only 0 and 1 in any other base.
The only positive integers that may be expressed using only the digits 0 and 1 in fewer than three different bases are 2 and 3, for which the values {2, n-1, n} are not all distinct or are not all valid bases.
An equivalent definition: For each term a(n) of this sequence, there are at most three integers k >= 2 for which a(n) is a sum of distinct nonnegative integer powers of k.

Examples

			5 is a term of the sequence, because 5 may be expressed using only the digits 0 and 1 in precisely three different bases: 2, 4 and 5 (5 is '12' in base 3).
9 is not a term of the sequence, because 9 can be expressed using only the digits 0 and 1 in four different bases: 2, 3, 8, 9 (9 is '100' in base 3).
		

Crossrefs

Subsequence of A074940.

Programs

  • Maple
    filter:= proc(n)
      local b;
      for b from 3 to n-2 do
        if max(convert(n,base,b)) <= 1 then return false
        fi
      od:
    true
    end proc:
    select(filter, [$2..1000]); # Robert Israel, Jun 19 2015
  • PARI
    is(n)=if(n<2, return(0)); for(b=3,sqrtint(n),if(vecmax(digits(n,b))<2, return(0))); 1 \\ Charles R Greathouse IV, Jun 15 2015

A344512 a(n) is the least number larger than 1 which is a self number in all the bases 2 <= b <= n.

Original entry on oeis.org

4, 13, 13, 13, 287, 287, 2971, 2971, 27163, 27163, 90163, 90163, 5940609, 5940609, 6069129, 6069129, 276404649, 276404649
Offset: 2

Views

Author

Amiram Eldar, May 21 2021

Keywords

Comments

Since the sequence of base-b self numbers for odd b is the sequence of the odd numbers (A005408) (Joshi, 1973), all the terms beyond a(2) are odd numbers.
For the corresponding sequence with only even bases, see A344513.
a(20) > 1.5*10^10, if it exists.

Examples

			a(2) = 4 since the least binary self number after 1 is A010061(2) = 4.
a(3) = 13 since the least binary self number after 1 which is also a self number in base 3 is A010061(4) = 13.
		

References

  • Vijayshankar Shivshankar Joshi, Contributions to the theory of power-free integers and self-numbers, Ph.D. dissertation, Gujarat University, Ahmedabad (India), October, 1973.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Programs

  • Mathematica
    s[n_, b_] := n + Plus @@ IntegerDigits[n, b]; selfQ[n_, b_] := AllTrue[Range[n, n - (b - 1) * Ceiling @ Log[b, n], -1], s[#, b] != n &]; a[2] = 4; a[b_] := a[b] = Module[{n = a[b - 1]}, While[! AllTrue[Range[2, b], selfQ[n, #] &], n++]; n]; Array[a, 10, 2]

Formula

a(2*n+1) = a(2*n) for n >= 2.

A344513 a(n) is the least number larger than 1 which is a self number in all the even bases b = 2*k for 1 <= k <= n.

Original entry on oeis.org

4, 13, 287, 294, 6564, 90163, 1136828, 3301262, 276404649, 5643189146
Offset: 1

Views

Author

Amiram Eldar, May 21 2021

Keywords

Comments

Joshi (1973) proved that for all odd b the sequence of base-b self numbers is the sequence of odd numbers (A005408). Therefore, in this sequence the bases are restricted to even values. For the corresponding sequence with both odd and even bases, see A344512.

Examples

			a(1) = 4 since the least binary self number after 1 is A010061(2) = 4.
a(2) = 13 since the least binary self number after 1 which is also a self number in base 2*2 = 4 is A010061(4) = A010064(4) = 13.
		

References

  • Vijayshankar Shivshankar Joshi, Contributions to the theory of power-free integers and self-numbers, Ph.D. dissertation, Gujarat University, Ahmedabad (India), October, 1973.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Programs

  • Mathematica
    s[n_, b_] := n + Plus @@ IntegerDigits[n, b]; selfQ[n_, b_] := AllTrue[Range[n, n - (b - 1) * Ceiling @ Log[b, n], -1], s[#, b] != n &]; a[1] = 4; a[n_] := a[n] = Module[{k = a[n - 1]}, While[! AllTrue[Range[1, n], selfQ[k, 2*#] &], k++]; k]; Array[a, 7]

A347053 a(n) is the smallest base-10 number greater than 1 such that when written in all bases from base 2 to base n its leading digit is 1.

Original entry on oeis.org

2, 3, 4, 5, 78125, 67108864, 4747561509943, 4747561509943, 1123100968590805486067490785139871311149300510808491947285143687519677653346191462727898443913171541426176
Offset: 2

Views

Author

Scott R. Shannon, Aug 14 2021

Keywords

Comments

Each term is a power of a number <= n. The terms given in the data section are a(2) = 2, a(3) = 3, a(4) = 4, a(5) = 5, a(6) = 5^7 = 78125, a(7) = 4^13 = 67108864, a(8) = a(9) = 7^15 = 4747561509943, and a(10) = 6^135 = 1123...6176 (106 digits). The other known terms (too large to write in the data section) are a(11) = a(12) = 10^421 (422 digits), a(13) = 8^2144 = 1678...1296 (1937 digits), and a(14) = a(15) = 7^7081 = 1377...6007 (5985 digits).
Assuming a(16) exists it is greater than 10^21000.
a(16) = a(17) = 6^132847 = 1145...3136 (103376 digits); a(18) = 18^521808 = 1719...0576 (655012 digits); a(19) = a(20) = 7^1192509 = 1043...3607 (1007788 digits). - Jon E. Schoenfield, Aug 17 2021
a(21) = 3^6959688 (3320616 digits). - Scott R. Shannon and Jon E. Schoenfield_, Aug 20 2021

Examples

			a(2) = 2 as 2 = 10_2, which has 1 as its leading digit.
a(3) = 3 as 3 = 11_2 = 10_3, each of which has 1 as its leading digit.
a(4) = 4 as 4 = 100_2 = 11_3 = 10_4, each of which has 1 as its leading digit.
a(5) = 5 as 5 = 101_2 = 12_3 = 11_4 = 10_5, each of which has 1 as its leading digit.
a(6) = 78125 as 78125 = 10011000100101101_2 = 10222011112_3 = 103010231_4 = 10000000_5 = 1401405_6, each of which has 1 as its leading digit.
a(7) = 67108864 as 67108864 = 100000000000000000000000000_2 = 11200021111001111_3 = 10000000000000_4 = 114134440424_5 = 10354213104_6 = 1443262444_7, each of which has 1 as its leading digit.
		

Crossrefs

Programs

A342348 Smallest number > 3 whose representation in all bases from 2 up to n consists only of '0's, '1's, '2's and '3's.

Original entry on oeis.org

4, 4, 4, 5, 6, 7, 8, 8281
Offset: 2

Views

Author

Chai Wah Wu, Mar 12 2021

Keywords

Comments

Conjecture: there are no more terms.
If it exists, a(10) > 10^2000. - Bert Dobbelaere, Mar 14 2021

Examples

			a(9) = 8281.
8281 in base 2 =  10000001011001
8281 in base 3 =  102100201
8281 in base 4 =  2001121
8281 in base 5 =  231111
8281 in base 6 =  102201
8281 in base 7 =  33100
8281 in base 8 =  20131
8281 in base 9 =  12321
		

Crossrefs

Cf. A258107.

Programs

  • Python
    def only0123(n, b):
      while n >= b:
        n, r = divmod(n, b)
        if r > 3: return False
      return n <= 3
    def a(n):
      k = max(4, n)
      while not all(only0123(k, b) for b in range(2, n+1)): k += 1
      return k
    print([a(n) for n in range(2, 10)]) # Michael S. Branicky, Mar 12 2021
Showing 1-10 of 11 results. Next