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-20 of 22 results. Next

A337250 Numbers having at least one 3 in their representation in base 4.

Original entry on oeis.org

3, 7, 11, 12, 13, 14, 15, 19, 23, 27, 28, 29, 30, 31, 35, 39, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 67, 71, 75, 76, 77, 78, 79, 83, 87, 91, 92, 93, 94, 95, 99, 103, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119
Offset: 1

Views

Author

François Marques, Sep 19 2020

Keywords

Comments

Complementary sequence of A023717.

Examples

			18 is not in the sequence since it is 102_4 in base 4, but 19 is in the sequence since it is 103_4 in base 4.
		

Crossrefs

Cf. A196032 (at least one 0 in base 4).
Cf. Numbers with at least one digit b-1 in base b : A074940 (b=3), this sequence, A337572 (b=5), A333656 (b=6), A337141 (b=7), A337239 (b=8), A338090 (b=9), A011539 (b=10), A095778 (b=11).
Cf. Numbers with no digit b-1 in base b: A005836 (b=3), A023717 (b=4), A020654 (b=5), A037465 (b=6), A020657 (b=7), A037474 (b=8), A037477 (b=9), A007095 (b=10), A171397 (b=11).

Programs

  • Maple
    seq(`if`(numboccur(3, convert(n, base, 4))>0, n, NULL), n=0..100);
  • Mathematica
    Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 4 ], 3 ]>0)& ]
  • PARI
    isok(m) = #select(x->(x==3), digits(m, 4)) >= 1; \\ Michel Marcus, Sep 20 2020
    
  • Python
    from gmpy2 import digits
    def A337250(n):
        def f(x):
            l = (s:=digits(x,4)).find('3')
            if l >= 0: s = s[:l]+'2'*(len(s)-l)
            return n+int(s,3)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Dec 04 2024

A337572 Numbers having at least one 4 in their representation in base 5.

Original entry on oeis.org

4, 9, 14, 19, 20, 21, 22, 23, 24, 29, 34, 39, 44, 45, 46, 47, 48, 49, 54, 59, 64, 69, 70, 71, 72, 73, 74, 79, 84, 89, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 129, 134
Offset: 1

Views

Author

François Marques, Sep 19 2020

Keywords

Comments

Complementary sequence to A020654.

Examples

			75 is not in the sequence since it is 300_5 in base 5, but 74 is in the sequence since it is 244_5 in base 5.
		

Crossrefs

Cf. Numbers with at least one digit b-1 in base b : A074940 (b=3), A337250 (b=4), this sequence (b=5), A333656 (b=6), A337141 (b=7), A337239 (b=8), A338090 (b=9), A011539 (b=10), A095778 (b=11).
Cf. Numbers with no digit b-1 in base b: A005836 (b=3), A023717 (b=4), A020654 (b=5), A037465 (b=6), A020657 (b=7), A037474 (b=8), A037477 (b=9), A007095 (b=10), A171397 (b=11).

Programs

  • Maple
    seq(`if`(numboccur(4, convert(n, base, 5))>0, n, NULL), n=0..100);
  • Mathematica
    Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 5 ], 4 ]>0)& ]
  • PARI
    isok(m) = #select(x->(x==4), digits(m, 5)) >= 1; \\ Michel Marcus, Sep 20 2020
    
  • Python
    from gmpy2 import digits
    def A337572(n):
        def f(x):
            l = (s:=digits(x,5)).find('4')
            if l >= 0: s = s[:l]+'3'*(len(s)-l)
            return n+int(s,4)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Dec 04 2024

A333656 Numbers having at least one 5 in their representation in base 6.

Original entry on oeis.org

5, 11, 17, 23, 29, 30, 31, 32, 33, 34, 35, 41, 47, 53, 59, 65, 66, 67, 68, 69, 70, 71, 77, 83, 89, 95, 101, 102, 103, 104, 105, 106, 107, 113, 119, 125, 131, 137, 138, 139, 140, 141, 142, 143, 149, 155, 161, 167, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184
Offset: 1

Views

Author

François Marques, Sep 20 2020

Keywords

Comments

Complementary sequence to A037465.

Examples

			22 is not in the sequence since it is 34_6 in base 6, but 23 is in the sequence since it is 35_6 in base 6.
		

Crossrefs

Cf. Numbers with at least one digit b-1 in base b : A074940 (b=3), A337250 (b=4), A337572 (b=5), this sequence (b=6), A337141 (b=7), A337239 (b=8), A338090 (b=9), A011539 (b=10), A095778 (b=11).
Cf. Numbers with no digit b-1 in base b: A005836 (b=3), A023717 (b=4), A020654 (b=5), A037465 (b=6), A020657 (b=7), A037474 (b=8), A037477 (b=9), A007095 (b=10), A171397 (b=11).

Programs

  • Maple
    seq(`if`(numboccur(5, convert(n, base, 6))>0, n, NULL), n=0..100);
  • Mathematica
    Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 6 ], 5 ]>0)& ]
  • PARI
    isok(m) = #select(x->(x==5), digits(m, 6)) >= 1;
    
  • Python
    from gmpy2 import digits
    def A333656(n):
        def f(x):
            l = (s:=digits(x,6)).find('5')
            if l >= 0: s = s[:l]+'4'*(len(s)-l)
            return n+int(s,5)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Dec 04 2024

A337141 Numbers having at least one 6 in their representation in base 7.

Original entry on oeis.org

6, 13, 20, 27, 34, 41, 42, 43, 44, 45, 46, 47, 48, 55, 62, 69, 76, 83, 90, 91, 92, 93, 94, 95, 96, 97, 104, 111, 118, 125, 132, 139, 140, 141, 142, 143, 144, 145, 146, 153, 160, 167, 174, 181, 188, 189, 190, 191, 192, 193, 194, 195, 202, 209, 216, 223, 230, 237, 238, 239, 240
Offset: 1

Views

Author

François Marques, Sep 20 2020

Keywords

Comments

Complementary sequence to A020657.

Examples

			33 is not in the sequence since it is 45_7 in base 7, but 34 is in the sequence since it is 46_7 in base 7.
		

Crossrefs

Cf. Numbers with at least one digit b-1 in base b: A074940 (b=3), A337250 (b=4), A337572 (b=5), A333656 (b=6), this sequence (b=7), A337239 (b=8), A338090 (b=9), A011539 (b=10), A095778 (b=11).
Cf. Numbers with no digit b-1 in base b: A005836 (b=3), A023717 (b=4), A020654 (b=5), A037465 (b=6), A020657 (b=7), A037474 (b=8), A037477 (b=9), A007095 (b=10), A171397 (b=11).

Programs

  • Maple
    seq(`if`(numboccur(6, convert(n, base, 7))>0, n, NULL), n=0..100);
  • Mathematica
    Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 7 ], 6 ]>0)& ]
    Select[Range[300],DigitCount[#,7,6]>0&] (* Harvey P. Dale, Dec 23 2020 *)
  • PARI
    isok(m) = #select(x->(x==6), digits(m, 7)) >= 1;
    
  • Python
    from gmpy2 import digits
    def A337141(n):
        def f(x):
            l = (s:=digits(x,7)).find('6')
            if l >= 0: s = s[:l]+'5'*(len(s)-l)
            return n+int(s,6)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Dec 04 2024

A337239 Numbers having at least one 7 in their representation in base 8.

Original entry on oeis.org

7, 15, 23, 31, 39, 47, 55, 56, 57, 58, 59, 60, 61, 62, 63, 71, 79, 87, 95, 103, 111, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 143, 151, 159, 167, 175, 183, 184, 185, 186, 187, 188, 189, 190, 191, 199, 207, 215, 223, 231, 239, 247, 248, 249, 250, 251, 252, 253, 254, 255
Offset: 1

Views

Author

François Marques, Sep 20 2020

Keywords

Comments

Complementary sequence to A037474.

Examples

			54 is not in the sequence since it is 66_8 in base 8, but 55 is in the sequence since it is 67_8 in base 8.
		

Crossrefs

Cf. Numbers with at least one digit b-1 in base b : A074940 (b=3), A337250 (b=4), A337572 (b=5), A333656 (b=6), A337141 (b=7), this sequence (b=8), A338090 (b=9), A011539 (b=10), A095778 (b=11).
Cf. Numbers with no digit b-1 in base b: A005836 (b=3), A023717 (b=4), A020654 (b=5), A037465 (b=6), A020657 (b=7), A037474 (b=8), A037477 (b=9), A007095 (b=10), A171397 (b=11).

Programs

  • Maple
    seq(`if`(numboccur(7, convert(n, base, 8))>0, n, NULL), n=0..100);
  • Mathematica
    Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 8 ], 7 ]>0)& ]
  • PARI
    isok(m) = #select(x->(x==7), digits(m, 8)) >= 1;
    
  • Python
    def A337239(n):
        def f(x):
            s = oct(x)[2:]
            l = s.find('7')
            if l >= 0:
                s = s[:l]+'6'*(len(s)-l)
            return n+int(s,7)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Dec 04 2024

A032925 Numbers whose set of base-4 digits is a subset of {1,2}.

Original entry on oeis.org

1, 2, 5, 6, 9, 10, 21, 22, 25, 26, 37, 38, 41, 42, 85, 86, 89, 90, 101, 102, 105, 106, 149, 150, 153, 154, 165, 166, 169, 170, 341, 342, 345, 346, 357, 358, 361, 362, 405, 406, 409, 410, 421, 422, 425, 426, 597, 598, 601, 602, 613, 614, 617, 618, 661, 662, 665
Offset: 1

Views

Author

Keywords

Comments

Intersection of A023705 and A023717; A179888 is the intersection of this sequence and A053754. - Reinhard Zumkeller, Jul 31 2010

Crossrefs

Programs

  • C
    #include 
    uint32_t a_next(uint32_t a_n) {
        uint32_t t = (a_n + 0x55555556) ^ 0x55555555;
        return (a_n - t) & t;
    } /* Falk Hüffner, Jan 22 2022 */
  • Haskell
    import Data.List (transpose)
    a032925 n = a032925_list !! (n-1)
    a032925_list = 1 : 2 : (concat $ transpose [map (+ 1) fs, map (+ 2) fs])
                   where fs = map (* 4) a032925_list
    -- Reinhard Zumkeller, Apr 18 2015
    
  • Magma
    [n: n in [1..1000] | Set(IntegerToSequence(n, 4)) subset {1, 2}]; // Vincenzo Librandi, Jun 05 2012
    
  • Maple
    A032925 := proc(n)
        option remember;
        if n <= 2 then
            n;
        else
            if type(n,'even') then
                2+4*procname(n/2-1) ;
            else
                1+4*procname(floor(n/2)) ;
            end if;
        end if;
    end proc:
    seq(A032925(n),n=1..100) ;  # R. J. Mathar, Sep 07 2016
  • Mathematica
    Flatten[Table[FromDigits[#,4]&/@Tuples[{1,2},n],{n,5}]] (* Vincenzo Librandi, Jun 05 2012 *)

Formula

a(2n) = 4a(n-1) + 2, a(2n+1) = 4a(n) + 1. - Ralf Stephan, Oct 07 2003, corrected by R. J. Mathar, Sep 07 2016

A337536 Numbers k for which there are only 2 bases b (2 and k+1) where the digits of k contain the digit b-1.

Original entry on oeis.org

2, 3, 4, 10, 36, 40, 82, 256
Offset: 1

Views

Author

Michel Marcus, Aug 31 2020

Keywords

Comments

These could be called "nine-free numbers".
From David A. Corneth, Aug 31 2020: (Start)
This sequence has density 0. Conjecture: this sequence is finite and full. a(9) > 10^100 if it exists.
Suppose we want to see if 22792 = 1011021011_3 is a term. Since it has a digit of 2 in base 3, we can see that it is not. The next number that does not have the digit 2 in base 3 is 1011100000_3 = 22842, so we can proceed from there. In a similar way we can skip numbers based on bases b > 3. (End)
All terms of this sequence increased by 1 (except a(2)=3) are prime. - François Marques, Aug 31 2020
From Devansh Singh, Sep 19 2020: (Start)
If n is one less than an odd prime and we are interested in bases 3 <= b <= n-1 such that n in base b contains the digit b-1, then divisor of b (except 1) -1 cannot be the last digit since divisor of b divides n+1, which is not possible as n+1 is an odd prime.
If the last digit is 1, then b is odd as 1 = 2-1 and 2 cannot divide b as n+1 is an odd prime.
If the last digit is 0, then b-1 is the last digit of n-1 in base b.
b <= n/2 for even n,b <= (n+1)/2 for odd n.
This sequence is equivalent to the existence of only one prime generating polynomial = F(x) (having positive integer coefficients >=0 and <=b-1 for F(b)) such that F(2) = p.
There is no other prime generating polynomial = G(x) (having positive integer coefficients >=0 and <= b-1 for G(b)) that generates p for 2 < x = b <= (p-1)/2.
(End)

Examples

			2 is a term because 2 = 10_2 = 2_3, so both have the digit b-1, and there are no other bases where this happens.
4 is a term because 4 = 100_2 = 4_5, so both have the digit b-1, and there are no other bases where this happens.
		

Crossrefs

Programs

  • PARI
    isok(n, b) = vecmax(digits(n, b)) == b-1;
    b(n) = if (n==1, return (1)); my(b=3); while(!isok(n, b), b++); b; \\ A337535
    is(n) = b(n) == n+1;
    
  • PARI
    \\ See Corneth link \\ David A. Corneth, Aug 31 2020

A248625 Lexicographically earliest sequence of nonnegative integers such that no triple (a(n),a(n+d),a(n+2d)) is in arithmetic progression, for any d>0, n>=0.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 1, 3, 3, 0, 0, 1, 0, 0, 1, 1, 3, 3, 1, 3, 3, 4, 4, 7, 4, 4, 8, 0, 0, 1, 0, 0, 1, 1, 3, 3, 0, 0, 1, 0, 0, 1, 1, 3, 3, 1, 3, 3, 4, 4, 7, 4, 4, 8, 8, 3, 3, 4, 4, 9, 4, 4, 9, 1, 9, 12, 10, 9, 7, 10, 12, 9, 11, 9, 9, 11, 9, 10, 13, 19, 12, 0, 0, 1, 0, 0, 1, 1, 3, 3
Offset: 0

Views

Author

M. F. Hasler, Oct 10 2014

Keywords

Comments

The sequence is constructed in the greedy way, appending at each step the least nonnegative integer such that no subsequence of equidistant terms contains an AP.
Every nonnegative integer seems to appear in this sequence - see A248627 for the corresponding indices.
Sequence A229037 is the analog for positive integers (and indices).

Examples

			Start with a(0)=a(1)=0, smallest possible choice and trivially satisfying the constraint since no 3-term subsequence is possible.
Then one must take a(2)=1 since otherwise [0,0,0] would be an AP.
Then one can take again a(3)=a(4)=0, and a(5)=1.
Now appending 0 would yield the AP (0,0,0) by extracting terms with indices 0,3,6; therefore a(6)=1.
Now a(7) cannot be 0 not 1 nor 2 since else a(3)=0, a(5)=1, a(7)=2 would be an AP, therefore a(7)=3 is the least possible choice.
		

Crossrefs

Programs

  • PARI
    [DD(v)=vecextract(v,"^1")-vecextract(v,"^-1"), hasAP(a,m=3)=u=vector(m,i,1);v=vector(m,i,i-1);for(i=1,#a-m+1,for(s=1,(#a-i)\(m-1),#Set(DD(t=vecextract(a,(i)*u+s*v)))==1&&return
    ([i,s,t])))]; a=[]; for(n=1,90,a=concat(a,0);while(hasAP(a),a[#a]++);print1(a[#a]","));a

Formula

a(n) = A229037(n+1)+1.

A006288 Loxton-van der Poorten sequence: base-4 representation contains only -1, 0, +1.

Original entry on oeis.org

0, 1, 3, 4, 5, 11, 12, 13, 15, 16, 17, 19, 20, 21, 43, 44, 45, 47, 48, 49, 51, 52, 53, 59, 60, 61, 63, 64, 65, 67, 68, 69, 75, 76, 77, 79, 80, 81, 83, 84, 85, 171, 172, 173, 175, 176, 177, 179, 180, 181, 187, 188, 189, 191, 192, 193, 195, 196, 197, 203, 204, 205, 207, 208, 209
Offset: 0

Views

Author

Keywords

Examples

			1*4^2 + 0*4^1 + (-1)*4^0 = 15, so 15 is in sequence.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A344892 (in base 4), A344893 (morphism).

Programs

  • PARI
    a(n)=if(n<2,n>0,4*a((n+1)\3)+(n+1)%3-1) \\ Ralf Stephan, Jan 19 2014
    
  • PARI
    a(n) = my(v=digits(n,3),prev=0); forstep(i=#v,1,-1, prev=(v[i]+=(v[i]>(prev<2)))); fromdigits(v,4); \\ Kevin Ryde, Jun 03 2021

Formula

Recurrence: a(3n) = 4a(n), a(3n-1) = 4a(n)-1, a(3n+1) = 4a(n)+1, starting 0,1. - Ralf Stephan, Jan 19 2014

Extensions

Offset changed to 0 and example added by Ralf Stephan, Jan 19 2014

A215090 a(n) = Sum_{i=0..m} d(i)*3^i, where Sum_{i=0..m} d(i)*4^i is the base-4 representation of n.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Aug 03 2012

Keywords

Crossrefs

Cf. A023717.

Programs

  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 4)
            r += b * q
            b *= 3
        end
    r end; [a(n) for n in 0:70] |> println # Peter Luschny, Jan 03 2021
  • Mathematica
    t = Table[FromDigits[RealDigits[n, 4], 3], {n, 0, 100}]
  • PARI
    a(n) = fromdigits(digits(n, 4), 3); \\ Michel Marcus, May 02 2018
    

Formula

a(n) = 3*a(n/4) if n == 0 (mod 4); otherwise a(n) = a(n-1)+1.
Previous Showing 11-20 of 22 results. Next