Divyanand Valsan has authored 2 sequences.
A347295
a(n) = 1 + (a(n-1) interpreted as a hexadecimal number); a(1)=1.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 17, 24, 37, 56, 87, 136, 311, 786, 1927, 6440, 25665, 153190, 1388945, 20482374, 541598581, 22571222402, 2359835108355, 621877794997078, 441783186122961017, 1256072821702542102552, 22166920289514371672974675
Offset: 1
a(1)=1;
1_16 = 1_10; 1 + 1 = 2 = a(2);
2_16 = 2_10; 2 + 1 = 3 = a(3);
...
This will continue till a(10)=10, when base differences start to have an effect.
10_16 = 16_10; 16 + 1 = 17 = a(11);
17_16 = 23_10; 23 + 1 = 24 = a(12);
24_16 = 36_10; 36 + 1 = 37 = a(13);
37_16 = 55_10; 55 + 1 = 56 = a(14).
-
NestList[FromDigits[IntegerDigits[#], 16] + 1 &, 1, 30] (* Amiram Eldar, Jan 23 2022 *)
-
#Hex-dec switch
seq=[]
seq.append(1)
print(seq[0])
for i in range(1,50):
dec=int(str(seq[i-1]), 16)
dec=dec+1
seq.append(dec)
print(seq)
A350414
a(1)=1; for n > 1, a(n) = a(n-1) + (sum of odd-indexed digits of a(n-1)) - (sum of even-indexed digits of a(n-1)).
Original entry on oeis.org
1, 2, 4, 8, 16, 21, 20, 18, 25, 28, 34, 35, 37, 41, 38, 43, 42, 40, 36, 39, 45, 46, 48, 52, 49, 54, 53, 51, 47, 50, 45, 46, 48, 52, 49, 54, 53, 51, 47, 50, 45, 46, 48, 52, 49, 54, 53, 51, 47, 50, 45, 46, 48, 52, 49, 54, 53, 51, 47, 50, 45, 46, 48, 52, 49, 54, 53, 51, 47, 50, 45
Offset: 1
If starting with 12, the next number will be 12 + ((-1)*1 + (1)*2) = 13.
Then the next will be 13 + ((-1)*1 + (1)*3) = 15. This will continue as 19, 27, 32, 31, 29, 36, 39, 45, 46, 48, 52, 49, 54, 53, 51, 47, 50, 45.
At this point it will loop.
When the sequence starts with 1, it will be 1, 2, 4, 8, 16, 21, 20, 18, 25, 28, 34, 35, 37, 41, 38, 43, 42, 40, 36, 39, 45, 46, 48, 52, 49, 54, 53, 51, 47, 50, 45, ... Then this will loop. Hence I showed till 45 If you start with some other case, say a 2 digit number 26. Then, it will be 26, 30, 27, 32, 31, 29, 36, 39, 45, ... Since 45 is part of the previous loop, this will also loop. Picking any 3 digit number, say 155, it will be 155, 156, 158, 162, 159, 164, 163, 161, 157, 160, 155, ... Then it will loop. I tried for numbers up to a million and could see all loop. When plotting, then gave interesting plots with respect to the number of terms they loop after.
-
NestList[#1 + Total[#2[[1 ;; -1 ;; 2]]] - Total[#2[[2 ;; -1 ;; 2]]] & @@ {#, Reverse@ IntegerDigits[#]} &, 1, 67] (* Michael De Vlieger, Dec 31 2021 *)
-
def get_next_num(num):
res = [int(x) for x in str(num)[::-1]]
sum=0
for i in range(len(res)):
if(i%2)==0:
sum+=res[i]*1
else:
sum+=res[i]*-1
return num+sum
termlen=[]
for i in range(10000):
starting_num=i
series=[]
current_num=starting_num
c=0
while(current_num not in series):
series.append(current_num)
current_num=get_next_num(current_num)
c+=1
if (c>10000000):
print(i,"doesn't terminate")
break
termlen.append(len(series))
import matplotlib.pyplot as plt
import numpy as np
plt.plot(np.array(termlen))
plt.show()
import pandas as pd
s = pd.Series(termlen)
s.describe()
Comments