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.

A141022 a(n) = n mod ((sum of digits of n)+1).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 0, 3, 2, 1, 0, 8, 8, 8, 2, 1, 2, 5, 3, 1, 8, 7, 6, 5, 2, 1, 2, 5, 2, 8, 6, 4, 2, 0, 0, 5, 0, 3, 8, 5, 2, 11, 9, 7, 2, 2, 4, 8, 4, 0, 8, 5, 2, 14, 4, 5, 8, 3, 9, 5, 1, 11, 8, 5, 6, 8, 2, 7, 2, 10, 6, 2, 14, 11, 8, 1, 5, 11
Offset: 0

Views

Author

Olivier Bouaziz (olivier.bouaziz(AT)arcelormittal.com), Jul 29 2008

Keywords

Crossrefs

Cf. A007953.

Programs

  • Maple
    P:=proc(n) local i, k, w; for i from 1 by 1 to n do w:=0; k:=i; while k>0 do w:=w+k-trunc(k/10)*10; k:=trunc(k/10); od; print(i mod (w+1)); od; end: P(1000);
  • Mathematica
    a[n_]:=Mod[n,DigitSum[n]+1];Array[a,84,0] (* James C. McMahon, Jul 16 2025 *)
  • PARI
    a(n) = n % (1+sumdigits(n)); \\ Michel Marcus, Jun 04 2014

Extensions

More terms from Michel Marcus, Jun 04 2014