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.

Previous Showing 21-22 of 22 results.

A354618 a(n) = (sum of the digits of 5^n) - (sum of the digits of 2^n).

Original entry on oeis.org

0, 3, 3, 0, 6, 6, 9, 12, 12, 18, 33, 24, 9, 3, 12, 18, 33, 42, 45, 30, 30, 36, 42, 33, 45, 48, 39, 54, 42, 42, 54, 57, 48, 27, 42, 33, 45, 48, 57, 63, 69, 87, 99, 93, 93, 54, 42, 60, 72, 93, 75, 72, 51, 42, 45, 75, 111, 135, 141, 114, 117, 120, 102, 81, 78, 78
Offset: 0

Views

Author

Bernard Schott, Jul 08 2022

Keywords

Comments

Wu Wei Chao asked in American Mathematical Monthly for a proof that a(n) >= 0 with a(n) = 0 only if n = 0 or n = 3 (see Richard K. Guy reference).

Examples

			a(6) = sod(5^6) - sod(2^6) = sod(15625) - sod(64) = (1+5+6+2+5) - (6+4) = 19 - 10 = 9.
		

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section F24, Some decimal digital problems, p. 398.

Crossrefs

Programs

  • Mathematica
    a[n_] := Subtract @@ (Plus @@ IntegerDigits[#] & /@ {5^n, 2^n}); Array[a, 100, 0] (* Amiram Eldar, Jul 09 2022 *)
  • PARI
    a(n) = sumdigits(5^n) - sumdigits(2^n); \\ Michel Marcus, Jul 09 2022
    
  • Python
    def a(n): return sum(map(int, str(5**n))) - sum(map(int, str(2**n)))
    print([a(n) for n in range(66)]) # Michael S. Branicky, Jul 09 2022

Formula

a(n) = A066001(n) - A001370(n).

A359281 Numbers k such that the digit sum of 5^k is a power of 5.

Original entry on oeis.org

0, 1, 8, 208, 977, 1007, 4938, 24709, 24733, 24853, 124274, 3105928
Offset: 1

Views

Author

David Radcliffe, Dec 23 2022

Keywords

Comments

The number of digits in the decimal expansion of 5^k is 1 + floor(log_10(5^k)). If the average digit value is approximately (0 + 9)/2 = 9/2, then for large values of k, the digit sum will be approximately (9/2)*log_10(5^k) = (9/2)*k*log_10(5). The digit sum will then tend to be in the vicinity of a power of 5 when log_5((9/2)*k*log_10(5)) is near an integer, i.e., when log_5((9/2)*log_10(5)) + log_5(k) = 0.7120063... + log_5(k) is near an integer, which happens when k is near 5^(j - 0.7120063...) for integers j, i.e., around k = 1.59, 7.95, 39.7, 199, 993, 4968, 24838, 124191, 620953, etc. - Jon E. Schoenfield, Dec 24 2022

Examples

			5^8 = 390625 and 3+9+0+6+2+5 = 5^2, so 8 is a term.
		

Crossrefs

Cf. A000351, A066001 (sum of digits of 5^n), A067502.

Programs

  • Maple
    filter:= proc(n) local x;
     x:= convert(convert(5^n,base,10),`+`);
       x = 5^padic:-ordp(x,5)
    end proc:
    select(filter, [$0..10^5]); # Robert Israel, Jan 18 2023
  • Mathematica
    Do[If[IntegerQ[Log[5, Plus @@ IntegerDigits[5^n]]], Print[n]], {n, 0, 150000}];
  • PARI
    isok5(k) = (k==1) || (k==5) || (ispower(k,,&p) && (p==5));
    isok(k) = isok5(sumdigits(5^k)); \\ Michel Marcus, Dec 24 2022

Formula

A067502(n) = 5^a(n).

Extensions

a(11) from Michal Paulovic, Jan 18 2023
Previous Showing 21-22 of 22 results.