The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A338420 Numbers k having exactly one base b which is not a divisor of k+1, and k contains the digit b-1 in base b. 1

%I

%S 2,4,7,8,10,13,15,19,23,25,26,29,31,36,38,40,51,53,55,59,63,71,80,82,

%T 84,86,87,99,101,107,109,119,127,128,129,137,143,151,152,155,161,167,

%U 169,209,215,227,256,259,260,261,265,266,267,269,271

%N Numbers k having exactly one base b which is not a divisor of k+1, and k contains the digit b-1 in base b.

%C All the terms of A337536 are in this sequence except A337536(2)=3.

%C There are only 30 terms which are even up to n=124705.

%t baseCount[n_] := Count[Complement[Range[n + 1], Divisors[n + 1]], _?(MemberQ[ IntegerDigits[n, #], # - 1] &)]; Select[Range[1000], baseCount[#] == 1 &] (* _Amiram Eldar_, Oct 25 2020 *)

%o (Python)

%o def A338420(N):

%o return list(filter(isA338420,range(1,N+1)))

%o def isA338420(n):

%o counter=0

%o if n==2 or n==4:

%o return True

%o if n%2==0:

%o counter=1

%o for b in range(3,(n//2) +1):

%o if (n+1)%b!=0:

%o counter=main_base_check(int(n/b),b)+counter

%o return counter==1

%o def main_base_check(m,b):

%o while m!=0:

%o if m%b == b-1:

%o return 1

%o m = m//b

%o return 0

%o print(A338420(int(input())))

%o (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

%Y Cf. A337536.

%K nonn,base

%O 1,1

%A _Devansh Singh_, Oct 25 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified May 12 13:02 EDT 2021. Contains 343823 sequences. (Running on oeis4.)