OFFSET
0,3
COMMENTS
From Rick L. Shepherd, Jun 25 2009: (Start)
Nonnegative integers with no decimal digit > 4.
Thus nonnegative integers in base 10 whose doubling by normal addition or multiplication requires no carry operation. (End)
It appears that this sequence corresponds to the numbers n for which twice the sum of digits of n is the sum of digits of 2*n. - Rémy Sigrist, Nov 22 2009
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 0..10000
R. G. Wilson, V, Letter to N. J. A. Sloane, Sep. 1992
FORMULA
a(0)=0 a(n)=10*a(n/5) if n==0 (mod 5) a(n)=a(n-1)+1 otherwise. - Benoit Cloitre, Dec 22 2002
a(n) = n + 1/2*Sum_{k >= 1} 10^k*floor(n/5^k). Cf. A037454, A037462 and A102491. - Peter Bala, Dec 01 2016
MAPLE
A007091 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n, base, 5): return op(convert(l, base, 10, 10^nops(l))): end: seq(A007091(n), n=0..58); # Nathaniel Johnston, May 06 2011
MATHEMATICA
Table[ FromDigits[ IntegerDigits[n, 5]], {n, 0, 60}]
PROG
(PARI) a(n)=if(n<1, 0, if(n%5, a(n-1)+1, 10*a(n/5)))
(PARI) apply( A007091(n)=fromdigits(digits(n, 5)), [0..66]) \\ M. F. Hasler, Nov 18 2019
(Python)
from gmpy2 import digits
def A007091(n): return int(digits(n, 5)) # Chai Wah Wu, Dec 26 2021
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
STATUS
approved