OFFSET
1,1
COMMENTS
MATHEMATICA
baseCount[n_] := Count[Complement[Range[n + 1], Divisors[n + 1]], _?(MemberQ[ IntegerDigits[n, #], # - 1] &)]; Select[Range[1000], baseCount[#] == 1 &] (* Amiram Eldar, Oct 25 2020 *)
PROG
(Python)
def A338420(N):
return list(filter(isA338420, range(1, N+1)))
def isA338420(n):
counter=0
if n==2 or n==4:
return True
if n%2==0:
counter=1
for b in range(3, (n//2) +1):
if (n+1)%b!=0:
counter=main_base_check(int(n/b), b)+counter
return counter==1
def main_base_check(m, b):
while m!=0:
if m%b == b-1:
return 1
m = m//b
return 0
print(A338420(int(input())))
(PARI) isok(k) = sum(b=2, k+1, ((k+1) % b) && #select(x->(x==b-1), digits(k, b))) == 1; \\ Michel Marcus, Oct 30 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Devansh Singh, Oct 25 2020
STATUS
approved