login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A239706
Number of bases b for which the absolute value of the base-b alternate digital sum of n is b.
4
1, 0, 1, 0, 2, 0, 1, 0, 1, 1, 2, 0, 1, 0, 1, 0, 2, 0, 3, 1, 1, 0, 3, 0, 1, 0, 1, 0, 3, 0, 1, 0, 2, 2, 1, 0, 1, 0, 2, 1, 2, 0, 2, 0, 1, 1, 2, 0, 2, 0, 1, 0, 3, 1, 2, 0, 2, 1, 3, 0, 2, 0, 1, 0, 2, 0, 1, 1, 2, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 1, 1, 0, 5, 0, 1, 1, 1, 0, 4, 0, 2, 1, 1, 0, 3, 0, 1, 0, 3, 0
OFFSET
1,5
COMMENTS
For the definition of the alternate digital sum, see A055017 or A225693.
For reference: we write altDigitSum_b(x) for the base-b alternate digital sum of x according to A055017.
The number of counted bases includes the special base 1. The base-1 expansion of a natural number is defined as 1=1_1, 2=11_1, 3=111_1 and so on. As a result, the base-1 alternate digital sum is 0 if n is even, and is 1 if n is odd.
For odd n we have altDigitSum_1(n) = 1, and thus a(n) >= 1.
We have |altDigitSum_b(n)| < b for bases b that satisfy b > b0 := floor((sqrt(4n+5) - 1)/2), and thus a(n) <= b0.
It follows from A239704 and A239705 that there are infinitely many n that satisfy |altDigitSum_b(n)| = b for a base b > 1. Consequently, a(n) >= 2 for n = 5, 11, 19, 29, 41, ... (oblong numbers minus 1 starting with the third such number) and a(n) >= 1 for n = 10, 33, 76, 145, 246, ... (sums of cubes and oblong numbers, starting with 2^3 + the second oblong number, see A002378).
If b is a base such that the absolute value of the base-b alternate digital sum of n is b, then b + 1 is a divisor of n + 1 or of n - 1.
a(b*n) > (b*n) mod 2 for all b > 1 which satisfy altDigitSum_b(n) = -b.
a(b*n) > 0 for all b > 1 which satisfy altDigitSum_b(n) = b.
The first n with a(n) = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ... are n = 1, 5, 19, 89, 83, 359, 419, 629, 839, 3359, ... .
a(n) = 0, if n is in the middle of a twin prime pair i.e., if n - 1 and n + 1 are primes.
LINKS
FORMULA
a(n) = A239704(n) + A239705(n).
a(n) > max(A239704(n), A239705(n)) for n = 9*2^k - 3, k = 2, 3, 4, ... .
a(A002378(n)-1) >= 2, n > 1.
a(n) > max(A239704(n), A239705(n)) for n = 9*2^k - 3, k = 2, 3, 4, ... .
a(n) < floor(sigma_0(n-1)/2) + floor(sigma_0(n+1)/2).
EXAMPLE
a(1) = 1, since |altDigitSum_1(1)| = 1 and |altDigitSum_b(1)| = 1 <> b for all b > 1.
a(2) = 0, since |altDigitSum_1(2)| = 0 (because of 2 = 11_1), and |altDigitSum_2(2)| = 1 (because of 2 = 10_2), and |altDigitSum_b(2)| = 2 <> b for all b > 2.
a(33) = 3, since |altDigitSum_1(33)| = 1, and |altDigitSum_2(33)| = 0 (because of 33 = 100001_2), and |altDigitSum_3(33)| = 3 (because of 33 = 1020_3), and |altDigitSum_b(33)| <> b for all other b > 3.
PROG
(Smalltalk)
"Answer the number of bases b for which the absolute value of
the alternate digital sum of n in base b is b.
Valid for bases b > 0.
Using methods which are defined in A239704 and A239705.
Usage: n A239706
Answer: a(n)"
^self numOfBasesWithAltDigitalSumEQBase +
self numOfBasesWithAltDigitalSumEQNegBase
[by Hieronymus Fischer, May 08 2014]
KEYWORD
nonn
AUTHOR
Hieronymus Fischer, May 08 2014
STATUS
approved