cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A080221 n is Harshad (divisible by the sum of its digits) in a(n) bases from 1 to n.

Original entry on oeis.org

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
Offset: 1

Views

Author

Matthew Vandermast, Mar 16 2003

Keywords

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 16. 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

Examples

			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.
		

References

  • Eric W. Weisstein, CRC Concise Encyclopedia of Mathematics, Second ed., Chapman & Hall/CRC, 2003, p. 1310.

Crossrefs

See A005349 for numbers that are Harshad in base 10.
Cf. A100263.

Programs

  • 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 *)
  • 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

Extensions

More terms from John W. Layman, Nov 10 2004

A271311 Values of n such that A080221(n)=6; i.e., values of n such that n is divisible by the sum of digits of n when expressed in exactly 6 of the bases b=1...n.

Original entry on oeis.org

6, 26, 34, 122, 226, 362, 514, 842, 1226, 1522, 2026, 2602, 3482, 3722, 4226, 4762, 5042, 6242, 7226, 9026, 10202, 17162, 19322, 19882, 21026, 25282, 27226, 29242, 30626, 32762, 38026, 39602, 40402, 42026, 43682, 47962, 48842, 53362, 60026, 68122, 73442, 75626
Offset: 1

Views

Author

Daniel Mondot, Apr 03 2016

Keywords

Comments

Besides base 1, and bases b>=n (bases greater than or equal to the number itself), for which any number can be a Harshad number, these numbers are Harshad numbers in 4 other bases (where b=2...n-1): b1, b2, b3, and b4, where:
They can be separated in 2 distinct groups:
* Most numbers are Harshad numbers in 4 bases that follow pattern A:
- b1 is sqrt(n-1) (n-1 being a square)
- b2 is n/2
- b3 is n/2 + 1
- b4 is n-1
* Some numbers are Harshad numbers in 4 bases that follow pattern B:
- b1 is 2 (n-1 is not a square)
- b2 is n/2
- b3 is n/2 + 1
- b4 is n-1
This is true for n = 6, 34, 514, 131074, etc...

Examples

			6 is a Harshad number in bases 2, 3, 4 and 5:              Pattern B
26 is a Harshad number in bases 5, 13, 14 and 25:          Pattern A
34 is a Harshad number in bases 2, 17, 18 and 33:          Pattern B
122 is a Harshad number in bases 11, 61, 62 and 121:       Pattern A
226 is a Harshad number in bases 15, 113, 114 and 225:     Pattern A
362 is a Harshad number in bases 19, 181, 182 and 361:     Pattern A
514 is a Harshad number in bases 2, 257, 258 and 513:      Pattern B
842 is a Harshad number in bases 29, 421, 422 and 841:     Pattern A
1226 is a Harshad number in bases 35, 613, 614 and 1225:   Pattern A
1522 is a Harshad number in bases 39, 761, 762 and 1521:   Pattern A
2026 is a Harshad number in bases 45, 1013, 1014 and 2025: Pattern A
Pattern A: 45=sqrt(2026-1), 1013=2026/2, 1014=2026/2+1, 2025=2026-1
Pattern B: 2=2, 257=514/2, 258=514/2+1, 513=514-1.
		

Crossrefs

Programs

  • PARI
    isok(n) = {nb = 1; for (b=2, n, if ((n % (vecsum(digits(n, b)))) == 0, nb++);); nb == 6;} \\ Michel Marcus, Apr 03 2016

A271313 Values of n such that A080221(n)=7; i.e., values of n such that n is divisible by the sum of digits of n when expressed in exactly 7 of the bases b=1...n.

Original entry on oeis.org

8, 10, 25, 49, 82, 121, 141, 159, 177, 213, 219, 237, 267, 303, 309, 411, 417, 447, 453, 471, 501, 519, 529, 537, 543, 573, 591, 597, 626, 633, 669, 681, 699, 717, 753, 771, 789, 807, 831, 849, 879, 921, 933, 939, 951, 1047, 1077, 1119, 1137, 1149, 1167, 1203
Offset: 1

Views

Author

Daniel Mondot, Apr 03 2016

Keywords

Comments

Besides base 1, and bases b>=n (bases greater than or equal to the number itself), for which any number can be a Harshad number, these numbers are Harshad numbers in 5 other bases (where b=2...n-1): b1, b2, b3, b4, and b5, where:
They can be separated in 4 distinct groups.
* The first 3 entries (n=8, 10 and 25) are Harshad numbers in bases that do not follow other patterns.
* Most numbers are Harshad numbers in 5 bases that follow pattern A:
- b1 = n/3
- b2 = n/3+1
- b3 = (n-1)/2
- b4 = 2*n/3+1
- b5 = n-2
* Some numbers are Harshad numbers in 5 bases that follow pattern B:
- b1 = sqrt(sqrt(n-1))
- b2 = sqrt(n-1)
- b3 = n/2
- b4 = (n/2)+1
- b5 = n-1
* Some numbers are Harshad numbers in 5 bases that follow pattern C:
- b1 = sqrt(n)
- b2 = sqrt(n)+1
- b3 = 2*sqrt(n)+1
- b4 = (n+2-sqrt(n))/2
- b5 = (n+1-sqrt(n))

Examples

			8 is a Harshad number in bases 2, 3, 4, 5 and 7:            no pattern
10 is a Harshad number in bases 2, 3, 5, 6 and 9:           no pattern
25 is a Harshad number in bases 3, 5, 6, 11 and 21:         no pattern
49 is a Harshad number in bases 7, 8, 15, 22 and 43:        pattern C
82 is a Harshad number in bases 3, 9, 41, 42 and 81:        pattern B
121 is a Harshad number in bases 11, 12, 23, 56 and 111:    pattern C
141 is a Harshad number in bases 47, 48, 70, 95 and 139:    pattern A
159 is a Harshad number in bases 53, 54, 79, 107 and 157:   pattern A
177 is a Harshad number in bases 59, 60, 88, 119 and 175:   pattern A
213 is a Harshad number in bases 71, 72, 106, 143 and 211:  pattern A
219 is a Harshad number in bases 73, 74, 109, 147 and 217:  pattern A
237 is a Harshad number in bases 79, 80, 118, 159 and 235:  pattern A
267 is a Harshad number in bases 89, 90, 133, 179 and 265:  pattern A
Pattern A: 47=141/3, 48=141/3+1, 70=(141-1)/2, 95=(2*141/3)+1, 139=141-2
Pattern B: 3=sqrt(sqrt(82-1)), 9=sqrt(82-1), 41=82/2, 42=82/2+1, 81=82-1
Pattern C: 7=sqrt(49), 8=sqrt(49)+1, 15=2*sqrt(49)+1, 22=(49+2-sqrt(49))/2, 43=49+1-sqrt(49)
List of n that follow pattern B: 82, 626, 2402, 14642, 28562, 83522, etc...
List of n that follow pattern C: 49, 121, 529, 2209, 3481, 6889, 11449, 27889, 32041, 51529, 69169, 120409, 128881, etc...
List of n that follow pattern A: all others not already mentioned above.
		

Crossrefs

Programs

  • PARI
    isok(n) = {nb = 1; for (b=2, n, if ((n % (vecsum(digits(n, b)))) == 0, nb++);); nb == 7;} \\ Michel Marcus, Apr 03 2016
Showing 1-3 of 3 results.