login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A239705 Number of bases b for which the base-b alternate digital sum of n is -b. 5
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1

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.

The altDigitSum_b(n) is > -b for bases b that satisfy b > b0 := floor((n - floor(n^(1/3))*(floor(n^(1/3))-1))^(1/3)), and thus a(n) <= b0.

If n is the sum of a cube m^3 and an oblong number m*(m-1) (see A002378), then, with b := m, b^3 + b(b-1) = n and b = b0. This implies altDigitSum_b(n) = 0 - (b-1) + 0 - 1 = -b and shows that there are infinitely many n with a base b > 1 such that altDigitSum_b(n) = -b. Consequently, a(n) >= 1 infinitely often (for those n > 1 that are the sum of a cube and an oblong number, i.e., n = 10, 33, 76, 145, 246, ...).

Moreover, a(n) >= 1 is also true for n == b(b(b+1)-1) (mod (b+1)b^4), b>1.

  Example 1: altDigitSum_2(n) = -2 for n == 10 (mod 48).

  Example 2: altDigitSum_3(n) = -3 for n == 33 (mod 324).

  Example 3: altDigitSum_4(n) = -4 for n == 76 (mod 1280).

If b is a base such that the base-b alternate digital sum of n is -b, then b + 1 is a divisor of n - 1. Thus, the number of such bases is also limited by the number of divisors of n - 1 (see formula section).

If b + 1 is a divisor of n - 1, then b is not necessarily a base such that base-b alternate digital sum of n is -b. Example: 2, 4, 8 and 16 are divisors of 32 and altDigitSum_3(33) = -3, but altDigitSum_1(33) = 1, altDigitSum_7(33) = 1, altDigitSum_15(33) = 1.

a(b*n) > 0 for all b > 1 that satisfy altDigitSum_b(n) = b.

  Example 4: altDigitSum_2(5) = 2, hence a(2*5) > 0.

  Example 5: altDigitSum_3(11) = 3, hence a(3*11) > 0.

The first n with a(n) = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ... are n = 10, 136, 385, 2241, 24781, 26797, 175561, 182401, 374221, 475021, ... .

LINKS

Hieronymus Fischer, Table of n, a(n) for n = 1..10000

FORMULA

a(n^3 + A002378(n-1)) = a(n^3 + n^2 - n) >= 1, n > 1.

a(n) = 0, if n - 1 is a prime.

A239703(n) = 0 ==> a(n) = 0.

a(A187813(n) = 0.

a(n) <= floor(sigma_0(n-1)/2).

EXAMPLE

a(1) = 0, 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(3) = 0, since altDigitSum_1(3) = 1 (because of 3 = 111_1), and altDigitSum_2(3) = 0 (because of 3 = 11_2), and altDigitSum_3(3) = -1 (because of 3 = 10_3), and altDigitSum_b(3) = 3 > -b for all b > 3.

a(10) = 1, since altDigitSum_1(10) = 0, and altDigitSum_2(10) = -2 (because of 10 = 1010_2), and altDigitSum_3(10) = 2 (because of 10 = 101_3), and altDigitSum_4(10) = 0 (because of 10 = 22_4), and altDigitSum_5(10) = -2 (because of 10 = 20_5), ..., and altDigitSum_b(10) = 10 > -b for all b > 10.

PROG

(Smalltalk)

"> Version 1: simple calculation for small numbers.

Answer the number of bases b for which the alternate digital sum of n in base b is -b.

Valid for bases b > 0.

Using altDigitalSumRight from A055017.

Usage: n numOfBasesWithAltDigitalSumEQ0

Answer: a(n)"

numOfBasesWithAltDigitalSumEQNegBase

     | b q numBases |

     self < 10 ifTrue: [^0].

     numBases := 0.

     q := self cubeRootTruncated.

     b := 1.

     [b < q] whileTrue:[

          (self altDigitalSumRight: b) = 0

          ifTrue: [numBases := numBases + 1].

          b := b + 1].

     ^numBases

[by Hieronymus Fischer, May 08 2014]

-----------

(Smalltalk)

"> Version 2: accelerated calculation for large numbers.

   Answer the number of bases b for which the alternate

   digital sum of n in base b is -b.

   Valid for bases b > 0.

   Using altDigitalSumRight from A055017.

   Usage: n numOfBasesWithAltDigitalSumEQ0

   Answer: a(n)"

numOfBasesWithAltDigitalSumEQNegBase

   | numBases div b bsize  |

   self < 10 ifTrue: [^0].

   div := (self - 1) divisors.

   numBases := 0.

   bsize := div size // 2 + 1.

   2 to: bsize do: [ :i | b := (div at: i) - 1.

          (self altDigitalSumRight: b) = (b negated)

           ifTrue: [numBases := numBases + 1]].

   ^numBases

[by Hieronymus Fischer, May 08 2014]

CROSSREFS

Cf. A055017, A225693, A187813.

Cf. A239703, A239704, A239706, A239707.

Cf. A002378, A008864, A000040, A000005.

Sequence in context: A037807 A037817 A297039 * A025468 A025465 A323514

Adjacent sequences:  A239702 A239703 A239704 * A239706 A239707 A239708

KEYWORD

nonn

AUTHOR

Hieronymus Fischer, May 08 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 10 00:25 EDT 2020. Contains 335570 sequences. (Running on oeis4.)