|
|
A235915
|
|
a(1) = 1, a(n) = a(n-1) + (digsum(a(n-1)) mod 5) + 1, digsum = A007953.
|
|
0
|
|
|
1, 3, 7, 10, 12, 16, 19, 20, 23, 24, 26, 30, 34, 37, 38, 40, 45, 50, 51, 53, 57, 60, 62, 66, 69, 70, 73, 74, 76, 80, 84, 87, 88, 90, 95, 100, 102, 106, 109, 110, 113, 114, 116, 120, 124, 127, 128, 130, 135, 140, 141
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
For n = 7, a(6) is 16, where the sum of the digits is 7, of which the remainder when divided by 5 is 2, then plus 1 is 3. Thus a(7) is a(6) + 3 or 19.
|
|
MAPLE
|
a:= proc(n) a(n):= `if`(n=1, 1, a(n-1) +1 +irem(
add(i, i=convert(a(n-1), base, 10)), 5)) end:
|
|
PROG
|
(Python)
def adddigits(i):
s = str(i)
t=0
for j in s:
t = t+int(j)
return t
n = 1
a = [1]
for i in range(0, 100):
r = adddigits(n)%5+1
n = n+r
a.append(n)
print(a)
(PARI) digsum(n)=d=eval(Vec(Str(n))); sum(i=1, #d, d[i])
a=vector(1000); a[1]=1; for(n=2, #a, a[n]=a[n-1]+digsum(a[n-1])%5+1); a \\ Colin Barker, Feb 14 2014
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|