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-25 of 25 results.

A118733 Numbers k such that 3^k has even digit sum.

Original entry on oeis.org

6, 7, 8, 12, 15, 19, 23, 24, 28, 29, 33, 37, 38, 40, 42, 43, 44, 46, 47, 49, 50, 54, 55, 56, 57, 58, 64, 67, 70, 71, 72, 75, 77, 82, 83, 84, 85, 88, 90, 93, 94, 95, 96, 97, 102, 104, 106, 107, 109, 110, 111, 112, 116, 120, 122, 125, 126, 129, 132, 135, 136, 138, 139
Offset: 1

Views

Author

Zak Seidov, May 22 2006

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[140], Mod[ Plus @@ IntegerDigits[3^# ], 2] == 0 &] (* Ray Chandler, Jun 10 2006 *)
    Select[Range[150],EvenQ[Total[IntegerDigits[3^#]]]&] (* Harvey P. Dale, Mar 12 2013 *)
  • Python
    from gmpy2 import digits
    def ok(n): return sum(map(int, digits(3**n)))&1 == 0
    print([k for k in range(140) if ok(k)]) # Michael S. Branicky, May 11 2025

A239935 Numbers k such that DigitSum(3^k) > DigitSum(3^(k+1)).

Original entry on oeis.org

11, 14, 15, 18, 20, 27, 29, 31, 34, 38, 41, 43, 47, 48, 50, 53, 54, 58, 59, 63, 64, 65, 67, 69, 71, 72, 75, 77, 79, 83, 88, 90, 94, 98, 99, 102, 103, 107, 109, 112, 114, 118, 119, 123, 125, 131, 132, 134, 136, 139, 141, 142, 146, 150, 154, 159, 161, 164, 167
Offset: 1

Views

Author

Oliver Bel, Mar 29 2014

Keywords

Examples

			For k=11, we have DigitSum(3^11) = 27 > 18 = DigitSum(3^12).
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get the first N terms
    threen:= 3:
    digsum:= 3:
    count:= 0:
    for n from 1 while count < N do
      threen:= 3*threen;
      oldsum:= digsum;
      digsum:= convert(convert(threen,base,10),`+`);
      if oldsum > digsum then
         count:= count+1;
         A239935[count]:= n;
      fi
    od: # Robert Israel, Apr 18 2014
  • Mathematica
    lis = Table[Total[IntegerDigits[3^n, 10]], {n, 1, 100}];
    Flatten[Position[Greater @@@ Partition[lis, 2, 1], True]]
  • PARI
    isok(k) = sumdigits(3^k) > sumdigits(3^(k+1)); \\ Michel Marcus, Jul 03 2021

Extensions

More terms from Jon E. Schoenfield, Mar 29 2014

A358509 Sum of decimal digits of (3^n - 1)/2 (A003462).

Original entry on oeis.org

0, 1, 4, 4, 4, 4, 13, 13, 13, 22, 22, 31, 22, 31, 31, 31, 22, 31, 31, 31, 31, 31, 49, 49, 40, 40, 49, 67, 58, 58, 58, 76, 58, 76, 85, 85, 85, 85, 94, 85, 85, 94, 103, 103, 85, 94, 103, 112, 103, 112, 130, 130, 94, 121, 112, 112, 121, 103, 103, 121, 112, 121, 121, 139, 121, 148, 121, 157, 157, 157, 157, 175, 157, 157
Offset: 0

Views

Author

Paul Curtz, Nov 20 2022

Keywords

Comments

a(n) == 4 (mod 9) for n >= 2. - Robert Israel, Nov 21 2022

Examples

			For n=5, (3^n - 1)/2 = 121 so that a(5) = 1+2+1 = 4.
		

Crossrefs

Cf. A004166 (of 3^n).

Programs

  • Maple
    seq(convert(convert((3^n-1)/2,base,10),`+`),n=0..100); # Robert Israel, Nov 21 2022
  • Mathematica
    a[n_] := Total[IntegerDigits[(3^n - 1)/2]]; Array[a, 100, 0] (* Amiram Eldar, Nov 20 2022 *)
  • PARI
    a(n) = sumdigits((3^n - 1)/2); \\ Michel Marcus, Nov 20 2022
    
  • Python
    def A358509(n): return sum(map(int,str((3**n-1)>>1))) # Chai Wah Wu, Nov 21 2022

Formula

a(n) = A007953(A003462(n)).

A286512 Numbers N for which there is k > 0 such that sum of digits(N^k) = N, but the least such k is larger than the least k for which sum of digits(N^k) > N*11/10.

Original entry on oeis.org

17, 31, 63, 86, 91, 103, 118, 133, 155, 157, 211, 270, 290, 301, 338, 352, 421, 432, 440, 441, 450, 478, 513, 533, 693, 853, 1051, 1237, 1363, 1459, 1526, 1665, 2781
Offset: 1

Views

Author

M. F. Hasler, May 18 2017

Keywords

Comments

The set of these numbers appears to be finite, and probably 2781 is its largest element.
The motivation for this sequence is the study of the behavior of the sum of digits of powers of a given number. Statistically, sumdigits(n^k) ~ 4.5*log_10(n')*k (where n' = n without trailing 0's), but typically fluctuations of some percent persist up to large values of k. (Cf. the graph of sequences n^k cited in the cross-references.)
The ratio of 11/10 is somewhat arbitrary, but larger ratios of the simple form (1 + 1/m) yield quite small subsets of this sequence (for m=2 the only element is 118, for m=3 the set is {31, 86, 118}, for m=1 it is empty), and smaller ratios yield much larger (possibly infinite?) sets. Also, the condition can be written sumdigits(N^k)-N > N/10, and 10 is the base we are using.
To compute the sequence A247889 we would like to have a rule telling us when we can stop the search for an exponent. It appears that sumdigits(N^k) >= 2*N is a limit that works for all N; the present sequence gives counterexamples to the (r.h.s.) limit of 1.1*N. The above comment mentioned the counterexamples {118} resp. {31, 86, 118}) for limits N*3/2 and N*4/3.

Crossrefs

Cf. sum of digits of k^n: A001370 (k=2), A004166 (k=3), A065713 (k=4), A066001 (k=5), A066002 (k=6), A066003 (k=7), A066004 (k=8), A065999 (k=9), A066005 (k=11), A066006 (k=12). (In these sequences, k is fixed and n is the index/exponent; in the present sequence it's the opposite and therefore the names k <-> n are exchanged.)

Programs

  • PARI
    for(n=1,5000,A247889(n)&&!A247889(n,n*11\10)&&print1(n",")) \\ Here, A247889() is a variant of the function computing that sequence which accepts as second optional argument a limit m, stopping the search for the exponent as soon as the digital sum of n^k exceeds m.

A287058 Sum of decimal digits of 118^n.

Original entry on oeis.org

1, 10, 19, 19, 55, 64, 55, 64, 82, 91, 109, 100, 109, 181, 118, 145, 127, 163, 154, 172, 154, 190, 226, 190, 208, 217, 271, 289, 253, 280, 298, 307, 334, 289, 334, 280, 361, 343, 334, 379, 406, 406, 379, 424, 379, 424, 415, 406, 523, 433, 478
Offset: 0

Views

Author

M. F. Hasler, May 18 2017

Keywords

Comments

118 is exceptional in the sense that it appears to be the only number m for which the smallest k such that sumdigits(m^k) = m occurs after the smallest k such that sumdigits(m^k) > m*3/2. If this last limit is decreased to m*4/3, then 31 and 86 also have this property. It appears that no number has this property if the limit is increased to 2m, see also A247889.
It is also remarkable that many values in the sequence are repeated (19, 55, 64, 109, 190, 154, 280, 289, 334 (3 times), 379, 406, 424, ...), while most other numbers never appear.

Crossrefs

Cf. sum of digits of k^n: A001370 (k=2), A004166 (k=3), A065713 (k=4), A066001(k=5), A066002 (k=6), A066003 (k=7), A066004 (k=8), A065999 (k=9), A066005 (k=11), A066006 (k=12).

Programs

  • Mathematica
    Total[IntegerDigits[#]]&/@NestList[118#&,1,50] (* Harvey P. Dale, Feb 24 2022 *)
  • PARI
    a(n)=sumdigits(118^n)
Previous Showing 21-25 of 25 results.