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

A055238 Numbers that are divisible by at least one of their digits in every base.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 24, 28, 30, 36, 42, 48, 60, 120
Offset: 1

Views

Author

Henry Bottomley, May 04 2000

Keywords

Comments

This list is probably finite and complete. For example 180 fails at base 23 and 240 fails at bases 21, 31 and 33

Examples

			9 is included because it can be written as 111111111,1001,100,21,14,13,12,11,10 or 9 and in every case there is a digit which divides 9; 11 is not on the list because in base 4 it is written 23 and 11 is not divisible by either 2 or 3.
		

Crossrefs

Programs

  • Mathematica
    divQ[n_, base_] := AnyTrue[Select[IntegerDigits[n, base], Positive], Divisible[n, #]&];
    okQ[n_] := AllTrue[Range[2, n-1], divQ[n, #]&];
    Select[Range[1000], okQ] (* Jean-François Alcover, Nov 07 2019 *)

A384211 a(n) is the number of distinct ways of representing n in any integer base >= 2 using only prime digits.

Original entry on oeis.org

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

Views

Author

Felix Huber, May 23 2025

Keywords

Comments

The representations of n remain the same for bases greater than n, as they all consist solely of the digit n.

Examples

			The a(43) = 9 representations of [4,3] in base 10 using only prime digits are [2,2,3] in base 4, [5,3] in base 8, [3,7] in base 12, [2,13] in base 15, [2,11] in base 16, [2,7] in base 18, [2,5] in base 19, [2,3] in base 20 and [43] in bases >= 44.
		

Crossrefs

Programs

  • Maple
    A384211:=proc(n)
        local a,b,c;
        a:=0;
        for b from 2 to n+1 do
            c:=convert(n,'base',b);
            if select(isprime,c)=c then
                a:=a+1
            fi
        od;
        return a
    end proc;
    seq(A384211(n),n=0..87);
    A384211representations:=proc(n)
        local L,b,c;
        L:=[];
        for b from 2 to n+1 do
            c:=convert(n,'base',b);
            if select(isprime,c)=c then
                L:=[op(L),b,ListTools:-Reverse(c)]
            fi
        od;
        return op(L)
    end proc;
    A384211representations(43);
  • Mathematica
    a[n_] := Boole[PrimeQ[n]] + Count[Range[2, n-1], ?(AllTrue[IntegerDigits[n, #], PrimeQ] &)]; Array[a, 100 ,0] (* _Amiram Eldar, May 23 2025 *)
  • PARI
    a(n) = sum(k=2, n+1, my(d=digits(n, k)); #select(isprime, d) == #d); \\ Michel Marcus, May 26 2025
  • Python
    from sympy import isprime
    from sympy.ntheory import digits
    def a(n): return len(set(t for b in range(2, n+2) if all(map(isprime, (t:=tuple(digits(n, b)[1:]))))))
    print([a(n) for n in range(84)]) # Michael S. Branicky, May 23 2025
    

A384212 a(n) is the number of bases >= 2 in which the alternating sum of digits of n is equal to 0.

Original entry on oeis.org

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

Views

Author

Felix Huber, May 24 2025

Keywords

Comments

The alternating sum of digits of n is equal to 1 for base n and equal to n for bases > n.

Examples

			a(72) = 10 because the alternating sum of digits of n is equal to 0 in the 10 bases 2 [1, 0, 0, 1, 0, 0, 0], 3 [2, 2, 0, 0], 5 [2, 4, 2], 7 [1, 3, 2], 8 [1, 1, 0], 11 [6, 6], 17 [4, 4], 23 [3, 3], 35 [2, 2] and 71 [1, 1].
		

Crossrefs

Programs

  • Maple
    A384212:=proc(n)
        local a,b,c,i;
        a:=0;
        for b from 2 to n-1 do
            c:=convert(n,'base',b);
        	   if add(c[i]*(-1)^i,i=1..nops(c))=0 then
               a:=a+1
            fi
        od;
        return a
    end proc;
    seq(A384212(n),n=1..87);
    A384212bases:=proc(n)
        local L,b,c,i;
        L:=[];
        for b from 2 to n-1 do
            c:=convert(n,'base',b);
        	if add(c[i]*(-1)^i,i=1..nops(c))=0 then
                L:=[op(L),b,ListTools:-Reverse(c)]
            fi
        od;
        return op(L)
    end proc;
    A384212bases(72);
  • Mathematica
    q[n_, b_] := Module[{d = IntegerDigits[n, b]}, Sum[(-1)^k*d[[k]], {k, 1, Length[d]}] == 0 ]; a[n_] := Count[Range[2, n-1], ?(q[n, #] &)]; Array[a, 100] (* _Amiram Eldar, May 24 2025 *)
  • PARI
    a(n) = sum(b=2, n-1, my(d=digits(n, b)); sum(k=1, #d, (-1)^k*d[k]) == 0); \\ Michel Marcus, May 24 2025
  • Python
    from sympy.ntheory import digits
    def s(v): return sum(v[::2]) - sum(v[1::2])
    def a(n): return sum(1 for b in range(2, n) if s(digits(n, b)[1:]) == 0)
    print([a(n) for n in range(1, 87)]) # Michael S. Branicky, May 24 2025
    

Formula

Trivial bounds: 1 <= a(n) <= n - 2 for n >= 3 because the representation of n in base n-1 is [1,1] and the alternating sum of digits of n is > 0 for bases >= n.

A054476 Numbers not divisible by any of their digits when written in base 5.

Original entry on oeis.org

13, 17, 19, 23, 53, 65, 67, 73, 77, 79, 85, 89, 94, 95, 97, 98, 103, 113, 115, 118, 119, 253, 263, 265, 269, 313, 317, 319, 323, 325, 329, 335, 337, 343, 347, 349, 353, 365, 367, 373, 377, 379, 385, 389, 394, 395, 397, 398, 425, 427, 437, 439, 443, 445, 449
Offset: 1

Views

Author

Henry Bottomley, May 12 2000

Keywords

Crossrefs

Programs

  • PARI
    is(n)=my(d=Set(digits(n,5))); for(i=if(d[1],1,2),#d, if(n%d[i]==0, return(0))); 1 \\ Charles R Greathouse IV, Feb 23 2017

A368930 a(n) is the least k which is divisible by none of its digits in exactly n bases, or 0 if there is no such k.

Original entry on oeis.org

1, 11, 27, 17, 33, 70, 23, 29, 51, 37, 92, 41, 74, 43, 82, 65, 69, 47, 53, 136, 106, 87, 59, 67, 71, 154, 172, 118, 111, 79, 146, 83, 123, 378, 89, 97, 153, 212, 125, 101, 103, 121, 119, 107, 113, 225, 250, 127, 159, 206, 202, 218, 155, 183, 143, 131, 137, 139, 161, 1020, 151, 169, 157, 149, 286
Offset: 0

Views

Author

Robert Israel, Jan 09 2024

Keywords

Comments

a(n) is the least k, if it exists, such that A055240(k) = n.
It appears that a(n) = 0 for n = 159, 208, 266, 267, 328, 405, 484, 492, ....
Entries of 0 in the a-file are conjectural: if they are not 0, they are > 35000.

Examples

			a(3) = 17 because there are exactly 3 bases in which 17 is divisible by none of its digits: these bases are 5, 6, 7, because 17 = 32_5 = 25_6 = 23_7, and 17 is not divisible by any of the digits 2, 3 and 5 from these bases.  In every other base, 17 is divisible by at least one of its digits; e.g., in base 10, 17 is divisible by 1.  And 17 is the first number for which there are exactly 3 such bases.
		

Crossrefs

Cf. A055240.

Programs

  • Maple
    f:= proc(n)
       nops(select(b -> not ormap(d -> d <> 0 and n mod d = 0, convert(n,base,b)), [$3 .. (n-1)/2]))
    end proc:
    V:= Array(0..100): count:= 0:
    for n from 1 while count < 101 do
    v:= f(n);
    if v <= 100 and V[v] = 0 then V[v]:= n; count:= count+1 fi;
    od:
    convert(V,list);
  • Mathematica
    isDiv[k_, b_] := Module[{d}, d = IntegerDigits[k, b]; Or @@ (Mod[k, #] == 0 & /@ DeleteCases[d, 0])];
    co[k_] := co[k] = Module[{c = 0, b = 2}, While[b <= k, If[Not[isDiv[k, b]], c++]; b++]; c];
    a[n_] := a[n] = Module[{k = 1}, While[co[k] != n, k++;]; k];
    Table[a[n], {n, 0, 64}] (* Robert P. P. McKone, Jan 10 2024 *)
  • Python
    from itertools import count, islice
    from sympy.ntheory.factor_ import digits
    def agen():
        adict, n = dict(), 0
        for k in count(1):
            v = sum(1 for i in range(2, k) if all(d==0 or k%d for d in digits(k, i)[1:]))
            if v not in adict: adict[v] = k
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 65))) # Michael S. Branicky, Jan 10 2024

A384436 a(n) is the number of distinct ways to represent n in any integer base >= 2 using only square digits.

Original entry on oeis.org

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

Views

Author

Felix Huber, May 29 2025

Keywords

Comments

The representations of n remain the same for bases greater than n, as they all consist solely of the digit n.

Examples

			The a(36) = 11 distinct ways to represent 36 using only square digits are [1,0,0,1,0,0] in base 2, [1,1,0,0] in base 3, [1,0,0] in base 6, [4,4] in base 8, [4,0] in base 9, [1,16] in base 20, [1,9] in base 27, [1,4] in base 32, [1,1] in base 35, [1,0] in base 36 and [36] in bases >= 37.
		

Crossrefs

Programs

  • Maple
    A384436:=proc(n)
        local a,b,c;
        a:=0;
        for b from 2 to n+1 do
            c:=convert(n,'base',b);
            if select(issqr,c)=c then
                a:=a+1
            fi
        od;
        return max(1,a)
    end proc;
    seq(A384436(n),n=0..81);
  • Mathematica
    a[n_] := Sum[Boole[AllTrue[IntegerDigits[n, b], IntegerQ[Sqrt[#]] &]], {b, 2, n+1}]; a[0] = 1; Array[a, 100, 0] (* Amiram Eldar, May 29 2025 *)
  • PARI
    a(n) = sum(b=2, n+1, my(d=digits(n,b)); #select(issquare, d) == #d); \\ Michel Marcus, May 29 2025

Formula

Trivial lower bound for n >= 2: a(n) >= 2 for nonsquares n and a(n) >= 3 for squares n because in base 2 the representations of n consists only of the square digits '0' and '1', in base n the representation of n is [1,0] and in bases > n the representation of n is [n].

A054475 Numbers not divisible by any of their digits when written in base 4.

Original entry on oeis.org

11, 35, 43, 47, 59, 131, 139, 143, 163, 175, 179, 187, 191, 203, 227, 235, 239, 251, 515, 523, 527, 547, 559, 563, 571, 575, 643, 655, 683, 691, 703, 707, 715, 719, 739, 751, 755, 763, 767, 779, 803, 811, 815, 827, 899, 907, 911, 931, 943, 947, 955, 959
Offset: 1

Views

Author

Henry Bottomley, May 12 2000

Keywords

Crossrefs

A054478 Numbers not divisible by any of their digits when written in base 6.

Original entry on oeis.org

17, 22, 23, 29, 34, 77, 89, 101, 107, 113, 130, 131, 137, 142, 143, 149, 161, 166, 167, 173, 174, 178, 179, 197, 202, 203, 209, 214, 437, 449, 461, 467, 509, 521, 527, 533, 539, 557, 563, 569, 581, 593, 599, 611, 617, 629, 641, 647, 653, 670, 671, 677, 682
Offset: 1

Views

Author

Henry Bottomley, May 12 2000

Keywords

Crossrefs

A054484 Numbers not divisible by any of their digits when written in base 7.

Original entry on oeis.org

17, 19, 23, 25, 26, 31, 33, 34, 37, 38, 39, 41, 46, 47, 101, 103, 115, 117, 119, 121, 125, 131, 133, 137, 139, 143, 149, 151, 152, 161, 163, 167, 173, 175, 178, 179, 181, 182, 187, 188, 191, 193, 194, 199, 201, 202, 217, 221, 223, 227, 229, 230, 231, 233, 237
Offset: 1

Views

Author

Henry Bottomley, May 12 2000

Keywords

Crossrefs

A054864 Numbers not divisible by any of their digits when written in base 8.

Original entry on oeis.org

19, 21, 23, 29, 31, 35, 37, 38, 39, 43, 46, 47, 53, 55, 59, 61, 62, 131, 133, 135, 149, 151, 155, 157, 163, 167, 173, 179, 181, 183, 187, 191, 197, 199, 211, 215, 221, 223, 227, 229, 230, 232, 238, 239, 247, 248, 251, 253, 254, 259, 261, 262, 263, 275, 277
Offset: 1

Views

Author

Henry Bottomley, May 12 2000

Keywords

Crossrefs

Showing 1-10 of 11 results. Next