A340287 Numbers k for which there are A000005(k+1)-1 bases b such that k in base b contains digit b-1.
1, 3, 5, 9, 11, 17, 27, 35, 37, 39, 41, 65, 81, 83, 85, 89, 131, 149, 179, 203, 255, 257, 263, 407, 419, 455, 539, 739, 811, 899, 1031, 1109, 1385, 1619, 1631, 1883, 2819, 3299, 3527, 4133, 4139, 4151, 4919, 5669, 5939, 6299, 7055, 7307, 8303, 9829, 9839, 10661
Offset: 1
Examples
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.
Links
- Kevin Ryde, C code searching for terms
Programs
-
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 *)
-
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
-
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())))
Comments