OFFSET
1,2
COMMENTS
If k written in some base b has b-1 as its least significant digit, then b is a divisor of k+1 (because k = high*b + b-1 means k+1 = b*(high+1)). The present sequence is those k where such divisors are in fact the only bases b where digit b-1 occurs.
In terms of the count of bases in A337496, the divisors give a lower bound A337496(k) >= tau(k+1)-1 (number of divisors except 1). The present sequence is those k at this lower bound.
There are 147 terms to k <= 10^8.
LINKS
EXAMPLE
1 is a term because A000005(1+1)-1 = 1 such that 1 in base 2 (2|2) contains digit 1 and there are no such bases of 1 which are non-divisors of 1+1.
5 is a term because A000005(5+1)-1 = 3 such that 5 in base 2,3,6 (2|6,3|6 and 6|6) contains digit 1,2,5 respectively and there are no such bases of 5 which are non-divisors of 5+1.
MATHEMATICA
baseQ[n_, b_] := MemberQ[IntegerDigits[n, b], b - 1]; q[n_] := Count[Range[2, n + 1], _?(baseQ[n, #] &)] == DivisorSigma[0, n + 1] - 1; Select[Range[1000], q] (* Amiram Eldar, Jan 03 2021 *)
PROG
(Python)
def is_n_with_no_nondivisor_baseb(N):
return list(filter(n_with_no_nondivisor_baseb, range(1, N+1, 2)))
def n_with_no_nondivisor_baseb(n):
main_base_counter=0
for b in range(3, ((n+1)//2) +1):
if (n+1)%b!=0:
main_base_counter=main_base_check(n//b, b)+main_base_counter
if main_base_counter==1:
break
return main_base_counter==0
def main_base_check(m, b):
while m!=0:
if m%b == b-1:
return 1
m = m//b
if m==0:
return 0
print(is_n_with_no_nondivisor_baseb(int(input())))
(PARI) isok(k) = sum(b=2, k+1, (#select(x->(x==(b-1)), digits(k, b)))>0) == numdiv(k+1)-1; \\ Michel Marcus, Jan 03 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Devansh Singh, Jan 03 2021
STATUS
approved