login
A390112
Smallest exponent b >= 2 such that the absolute value of the alternating 3-digit block sum of n^b equals n; 0 if none.
2
2, 2, 661, 91, 121, 241, 301, 61, 41, 31, 4, 49, 7, 6, 6, 61, 31, 46, 121, 961, 61, 5, 4, 7, 301, 31, 31, 21, 61, 91, 31, 361, 13, 13, 5, 31, 31, 181, 31, 91, 31, 121, 76, 7, 13, 25, 901, 421, 61, 601, 61, 151, 76, 16, 13, 7, 19, 21, 181, 121, 61, 721, 31
OFFSET
0,1
COMMENTS
Let S_3(x) be the absolute value of the alternating sum of base-1000 digits of x.
Define a(n) as the smallest b >= 2 with S_3(n^b) = n; if no such b exists, set a(n) = 0.
Conjectured to exist for all n that are not powers of 1000, for which S_3(1000^b) = 1 for all b.
FORMULA
a(n) = min_{b >= 2 | S_3(n^b) = n} or 0 if no such b exists, where S_3(x) = abs(Sum_{k>=0} (-1)^k * d_k), where x = Sum_{k>=0} d_k * 1000^k, 0 <= d_k < 1000.
a(1000^k) = 0 for k > 0.
EXAMPLE
a(10) = 4 since 10^4 = 10000 => |10 - 000| = 10.
a(14) = 6 since 14^6 = 7529536 => |7 - 529 + 536| = 14.
a(22) = 4 since 22^4 = 234256 => |234 - 256| = 22.
PROG
(Python)
from itertools import count
from sympy.ntheory import digits
def a(n):
if n > 1 and (s:=str(n)) == '1'+'0'*(len(s)//3*3): return 0
return next(b for b in count(2) if n==abs(sum(-d if i&1 else d for i, d in enumerate(map(int, digits(n**b, 1000)[1:])))))
print([a(n) for n in range(63)]) # Michael S. Branicky, Oct 25 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Pieter Post, Oct 25 2025
STATUS
approved