[go: up one dir, main page]

login
A367740
a(n) = A367727(A367593(n)).
1
-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,5
COMMENTS
Restricted to integers k where k + 1 divides R(k) - 1 the terms are (R(k) - 1) / (k + 1), where R(k) denotes the digit reversal of k. - Peter Luschny, Dec 01 2023
The 0's correspond to the powers of 10 (cf. A011557), the 5's correspond to the numbers of the form 14*10^h + 7 = 7*A199682(h) for h > 0, and the 8's correspond to the numbers of the form 12345*10^m + 6789 = A367650(m) for m > 3. The only negative term -1 corresponds to A367593(1) = 0. - Stefano Spezia, Dec 01 2023
FORMULA
-1 <= a(n) <= 9.
PROG
(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
CROSSREFS
KEYWORD
sign,base,hard,more
AUTHOR
Stefano Spezia, Nov 29 2023
EXTENSIONS
a(30)-a(44) from Chai Wah Wu, Dec 02 2023
STATUS
approved