login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A080221 n is Harshad (divisible by the sum of its digits) in a(n) bases from 1 to n. 9
1, 2, 2, 4, 2, 6, 2, 7, 5, 7, 2, 11, 2, 5, 8, 11, 2, 13, 2, 13, 10, 5, 2, 19, 7, 6, 10, 14, 2, 18, 2, 16, 9, 6, 11, 23, 2, 5, 8, 23, 2, 20, 2, 11, 19, 5, 2, 30, 7, 16, 9, 14, 2, 21, 10, 21, 9, 5, 2, 34, 2, 5, 19, 23, 13, 23, 2, 12, 9, 22, 2, 39, 2, 5, 20, 13, 13, 21, 2, 34, 18, 7, 2, 37, 12, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
For noncomposite integers, a(n)=d(n) (cf. A000005); for composite integers, a(n)> d(n). a(n) < n for all n > 6.
It appears that a(n) never takes on the value 3. Is there a proof of this? See A100263 for the sequence of values of n for which a(n)=5. It appears that, except for n=9, all values of n such that a(n) is 5 or 6 are twice a prime. - John W. Layman, Nov 10 2004
a(n) is never 3. As noted, 1 or any prime has a(n) = d(n) < 3. The only composites with d(n) <= 3 are squares of primes, for which d(n) = 3. But p^2 has the representation (p-1)(1) in base (p+1), so a(p^2) >= 4. Any product of two distinct odd numbers n = ab with 1<a<b can be written as a,0 in base b; 1,(a-1) in base ab-a+1; 1,(b-1) in base ab-b+1; 2,a-2 in base a(b-1)/2+1; and 2,b-2 in base (a-1)b/2+1; plus 1 and n work for any n, so a(n)>6. If n = a^2, with a>3, we have 1,0 in base a; (a-1)1 in base a+1; 1,(a-1) in base a^2-a+1; 2,(a-2) in base a(a-1)/2+1; and (a-1)/2,(a+1)/2 in base 2a+1; together with 1 and n this means a(n)>6 for this form, too. Similar considerations eliminate other forms, leaving only 2p as possible values to have a(n) = 5 or 6. - Franklin T. Adams-Watters, Aug 03 2006
It is easy to prove that only 1, 2, 4 and 6 are all-Harshad numbers (numbers that are divisible by the sum of their digits in every base). - Adam Kertesz, Feb 04 2008
REFERENCES
Eric W. Weisstein, CRC Concise Encyclopedia of Mathematics, Second ed., Chapman & Hall/CRC, 2003, p. 1310.
LINKS
EXAMPLE
6 is represented by the numeral 111111 in unary, 110 in binary, 20 in base 3, 12 in base 4, 11 in base 5 and 10 in base 6. The sums of the digits are 6, 2, 2, 3, 2 and 1 respectively, all divisors of 6; therefore a(6)=6.
MATHEMATICA
nivenQ[n_, b_] := Divisible[n, Total @ IntegerDigits[n, b]]; a[n_] := 1 + Sum[Boole @ nivenQ[n, b], {b, 2, n}]; Array[a, 100] (* Amiram Eldar, Jan 01 2020 *)
PROG
(Python)
from sympy.ntheory.factor_ import digits
def A080221(n): return n-sum(1 for b in range(2, n) if n%sum(digits(n, b)[1:])) # Chai Wah Wu, Oct 19 2022
CROSSREFS
See A005349 for numbers that are Harshad in base 10.
Cf. A100263.
Sequence in context: A096216 A121599 A360593 * A137849 A316440 A118982
KEYWORD
nonn,base
AUTHOR
Matthew Vandermast, Mar 16 2003
EXTENSIONS
More terms from John W. Layman, Nov 10 2004
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 20 20:53 EDT 2024. Contains 373532 sequences. (Running on oeis4.)