A367740 a(n) = A367727(A367593(n)).
-1, 0, 0, 0, 5, 0, 9, 5, 0, 5, 0, 5, 0, 5, 3, 0, 5, 0, 8, 5, 0, 8, 5, 0, 8, 5, 3, 0, 8, 5, 0, 8, 5, 3, 0, 8, 5, 0, 8, 5, 3, 0, 8, 5
Offset: 1
Programs
-
Python
def A367740List(upto): L = [] for n in range(upto): rev = int(str(n)[::-1]) if (rev - 1) % (n + 1) == 0: L.append((rev - 1) // (n + 1)) return L print(A367740List(10**6)) # Peter Luschny, Dec 01 2023
-
Python
from itertools import product, count, islice def A367740_gen(): # generator of terms yield from (-1,0,0) for l in count(1): m = 10**(l+1) for d in product('0123456789',repeat=l): for a, b, c in ((1, 0, 0), (1, 1, 0), (1, 4, 2), (1, 5, 5), (1, 7, 5)): k = a*m+int(s:=''.join(d))*10+b r = b*m+int(s[::-1])*10+a if c*(k+1)==r-1: yield c a,b = 1,9 k = a*m+int(s:=''.join(d))*10+b r = b*m+int(s[::-1])*10+a p,q = divmod(r-1,k+1) if not q: yield p a,b,c=2,6,3 for d in product('0123456789',repeat=l): k = a*m+int(s:=''.join(d))*10+b r = b*m+int(s[::-1])*10+a if c*(k+1)==r-1: yield c A367740_list = list(islice(A367740_gen(),20)) # Chai Wah Wu, Dec 01 2023
Formula
-1 <= a(n) <= 9.
Extensions
a(30)-a(44) from Chai Wah Wu, Dec 02 2023
Comments