login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A014840 Sum of all the digits of n in every base prime to n from 2 to n-1. 3
2, 2, 7, 2, 15, 10, 15, 8, 34, 12, 45, 22, 31, 32, 73, 28, 90, 40, 57, 50, 135, 46, 118, 74, 117, 70, 198, 58, 222, 120, 139, 122, 192, 92, 296, 152, 216, 136, 372, 112, 408, 202, 235, 208, 497, 176, 442, 224, 338, 260, 607, 202, 454, 276, 416, 330, 755, 194, 776 (list; graph; refs; listen; history; text; internal format)
OFFSET
3,1
LINKS
MATHEMATICA
Table[Sum[If[CoprimeQ[i, n], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}], {n, 3, 61}] (* Stefano Spezia, Sep 06 2022 *)
PROG
(PARI) a(n) = {s = 0; for (i=2, n-1, if (gcd(i, n) == 1, d = digits(n, i); s += sum(j=1, #d, d[j]); ); ); s; } \\ Michel Marcus, May 30 2014
(Python)
from math import gcd
from sympy.ntheory import digits
def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n) if gcd(b, n) == 1)
print([a(n) for n in range(3, 62)]) # Michael S. Branicky, Sep 06 2022
CROSSREFS
Sequence in context: A089588 A325211 A211780 * A218756 A317329 A235709
KEYWORD
nonn,base
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)