login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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

%I #33 Nov 13 2024 16:32:51

%S 7,8,12,13,15,16,18,24,26,28,31,32,36,40,42,48,54,56,57,60,62,63,64,

%T 70,72,76,80,84,88,90,93,96,98,100,108,112,114,120,121,124,126,127,

%U 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

%N 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.

%H Michael S. Branicky, <a href="/A377886/b377886.txt">Table of n, a(n) for n = 1..10000</a>

%e a(3) = 12 because 12 in base 5 is 22 where base 5 is a prime base and 5 < 12-1.

%t 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 *)

%o (Python)

%o from sympy import sieve

%o from sympy.ntheory import digits

%o def ok(n): return any(len(set(digits(n, p)[1:]))==1 for p in sieve.primerange(2, n-1))

%o print([k for k in range(253) if ok(k)]) # _Michael S. Branicky_, Nov 13 2024

%Y Cf. A125134.

%K nonn

%O 1,1

%A _Frank M Jackson_, Nov 12 2024