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

A061383 Arithmetic mean of digits is an integer.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 40, 42, 44, 46, 48, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 86, 88, 91, 93, 95, 97, 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129
Offset: 0

Views

Author

Amarnath Murthy, May 03 2001

Keywords

Comments

A004426(a(n)) = A004427(a(n)). - Reinhard Zumkeller, May 27 2010
A175688 is a subsequence; complement of A180157; A180160(a(n))=0. - Reinhard Zumkeller, Aug 15 2010
It seems "obvious" that n log n << a(n) < n log n; is this true? - Charles R Greathouse IV, Feb 06 2013

Examples

			123 is a term as the arithmetic mean is (1+2+3)/3 = 2.
		

Crossrefs

Programs

  • Haskell
    a061383 n = a061383_list !! (n-1)
    a061383_list = filter (\x -> mod (a007953 x) (a055642 x) == 0) [0..]
    -- Reinhard Zumkeller, Jun 18 2013
    
  • Magma
    [0] cat [n: n in [1..130] | IsZero(&+Intseq(n) mod #Intseq(n))];  // Bruno Berselli, Jun 30 2011
    
  • Magma
    [0] cat [n: n in [1..130] | IsIntegral(&+Intseq(n)/#Intseq(n))];   // Bruno Berselli, Feb 09 2016
    
  • Mathematica
    Select[Range[0,129],IntegerQ[Total[x=IntegerDigits[#]]/Length[x]] &] (* Jayanta Basu, May 17 2013 *)
    Select[Range[0,200],IntegerQ[Mean[IntegerDigits[#]]]&] (* Harvey P. Dale, Dec 31 2022 *)
  • PARI
    is(n)=my(v=digits(n));sum(i=1,#v,v[i])%#v==0 \\ Charles R Greathouse IV, Feb 06 2013
    
  • Python
    def ok(n): return n == 0 or sum(d:=list(map(int, str(n))))%len(d) == 0
    print([k for k in range(130) if ok(k)]) # Michael S. Branicky, Apr 23 2025

A180160 (sum of digits) mod (number of digits) of n in decimal representation.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 0, 1, 2
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 15 2010

Keywords

Comments

a(n) = A007953(n) mod A055642(n);
a(A061383(n)) = 0; a(A180157(n)) > 0;
a(repdigits)=0: a(A010785(n))=0: a(A002275(n))=0: a(A002276(n))=0: a(A002277(n))=0: a(A002278(n))=0: a(4(n))=0: a(A002279(n))=0: a(A002280(n))=0: a(A002281(n))=0: a(A002282(n))=0: a(A002283(n))=0;
A123522 gives smallest m such that a(m) = n.

Crossrefs

Programs

  • Mathematica
    A180160[n_] := If[n == 0, 0, Mod[Total[#], Length[#]] & [IntegerDigits[n]]];
    Array[A180160, 100, 0] (* Paolo Xausa, Jun 30 2024 *)
    Join[{0},Table[Mod[Total[IntegerDigits[n]],IntegerLength[n]],{n,110}]] (* Harvey P. Dale, Jul 30 2025 *)
Showing 1-2 of 2 results.