login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A377886
Prime-based Brazilian numbers: numbers k such that there is a prime number p with 1 < p < k-1 such that the representation of k in base p has all equal digits.
1
7, 8, 12, 13, 15, 16, 18, 24, 26, 28, 31, 32, 36, 40, 42, 48, 54, 56, 57, 60, 62, 63, 64, 70, 72, 76, 80, 84, 88, 90, 93, 96, 98, 100, 108, 112, 114, 120, 121, 124, 126, 127, 128, 132, 133, 136, 140, 144, 148, 150, 152, 154, 156, 160, 162, 168, 171, 176, 180, 183, 186, 190, 192, 196, 198, 200, 204, 208, 210, 216, 220, 222, 224, 228, 234, 240, 242, 248, 252
OFFSET
1,1
LINKS
EXAMPLE
a(3) = 12 because 12 in base 5 is 22 where base 5 is a prime base and 5 < 12-1.
MATHEMATICA
fQ[n_] := Module[{b=1}, While[Prime[b]<n-1&&Length[Union[IntegerDigits[n, Prime[b]]]]>1, b++]; Prime[b]<n-1]; Select[Range[4, 300], fQ](* after T. D. Noe in A125134 *)
PROG
(Python)
from sympy import sieve
from sympy.ntheory import digits
def ok(n): return any(len(set(digits(n, p)[1:]))==1 for p in sieve.primerange(2, n-1))
print([k for k in range(253) if ok(k)]) # Michael S. Branicky, Nov 13 2024
CROSSREFS
Cf. A125134.
Sequence in context: A348784 A294483 A105740 * A050796 A106630 A050798
KEYWORD
nonn
AUTHOR
Frank M Jackson, Nov 12 2024
STATUS
approved