login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A338379 Floor of (digital root of n) divided by (number of digits in n). 1
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 1, 1, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Fernando Villanueva, Table of n, a(n) for n = 0..9999

EXAMPLE

For n = 12345 the length of n is 5 (because 12345 has 5 digits) and its digital root is 6 (1+2+3+4+5=15 then 1+5=6). Then [6/5]=1 (where [x] is the integer part of x). Therefore a(12345)=0.

MATHEMATICA

Array[Floor[If[#1 == 0, 0, (#2 /. 0 -> 9)/IntegerLength[#1]]] & @@ {#, Mod[#, 9]} &, 105, 0] (* Michael De Vlieger, Nov 05 2020 *)

PROG

(Python)

#Defines digital root

def recsum(n):

    nstr = str(n)

    if len(nstr) == 1:

        return int(nstr)

    else:

        nl = sum([int(j) for j in nstr])

        return recsum(nl)

#Prints first 1000 terms

for i in range(1000):

    print(recsum(i)//len(str(i)))

(PARI) a(n) = if (n, (n-1)%9+1, 0) \ #Str(n); \\ Michel Marcus, Nov 05 2020

CROSSREFS

Cf. A010888 (digital root of n), A055642 (length of n).

Sequence in context: A031298 A004428 A004429 * A004426 A262188 A004430

Adjacent sequences:  A338376 A338377 A338378 * A338380 A338381 A338382

KEYWORD

nonn,base

AUTHOR

Fernando Villanueva, Oct 23 2020

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 26 11:10 EDT 2021. Contains 348267 sequences. (Running on oeis4.)