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!)
A235915 a(1) = 1, a(n) = a(n-1) + (digsum(a(n-1)) mod 5) + 1, digsum = A007953. 1

%I #30 Nov 23 2023 17:41:34

%S 1,3,7,10,12,16,19,20,23,24,26,30,34,37,38,40,45,50,51,53,57,60,62,66,

%T 69,70,73,74,76,80,84,87,88,90,95,100,102,106,109,110,113,114,116,120,

%U 124,127,128,130,135,140,141

%N a(1) = 1, a(n) = a(n-1) + (digsum(a(n-1)) mod 5) + 1, digsum = A007953.

%H Harvey P. Dale, <a href="/A235915/b235915.txt">Table of n, a(n) for n = 1..1000</a>

%H Ben Paul Thurston, <a href="http://benpaulthurstonblog.blogspot.com/2014/01/low-kolmorogov-complexity-but-never.html">Low Kolmorogov complexity but never repeating series?</a>

%e 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.

%p a:= proc(n) a(n):= `if`(n=1, 1, a(n-1) +1 +irem(

%p add(i, i=convert(a(n-1), base, 10)), 5)) end:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Feb 15 2014

%t NestList[#+Mod[Total[IntegerDigits[#]],5]+1&,1,50] (* _Harvey P. Dale_, Nov 23 2023 *)

%o (Python)

%o def adddigits(i):

%o s = str(i)

%o t=0

%o for j in s:

%o t = t+int(j)

%o return t

%o n = 1

%o a = [1]

%o for i in range(0, 100):

%o r = adddigits(n)%5+1

%o n = n+r

%o a.append(n)

%o print(a)

%o (PARI) digsum(n)=d=eval(Vec(Str(n))); sum(i=1, #d, d[i])

%o 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

%Y Cf. A007953.

%K nonn,base

%O 1,2

%A _Ben Paul Thurston_, Jan 16 2014

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 April 23 07:56 EDT 2024. Contains 371905 sequences. (Running on oeis4.)