A362843 Numbers that are equal to the sum of their digits raised to consecutive odd numbered powers (1,3,5,7,...).
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 463, 3943, 371915027434113
Offset: 1
Examples
1 = 1^1; 463 = 4^1 + 6^3 + 3^5; 3943 = 3^1 + 9^3 + 4^5 + 3^7.
Programs
-
Mathematica
kmax=10^6; a={}; For[k=0, k<=kmax, k++,If[Sum[Part[IntegerDigits[k],i]^(2i-1),{i,IntegerLength[k]}]==k, AppendTo[a,k]]]; a (* Stefano Spezia, May 06 2023 *)
-
PARI
isok(k) = my(d=digits(k)); sum(i=1, #d, d[i]^(2*i-1)) == k; \\ Michel Marcus, May 06 2023
-
Python
from itertools import count, islice def A362843_gen(startvalue=0): # generator of terms >= startvalue return filter(lambda n:n==sum(int(d)**((i<<1)+1) for i,d in enumerate(str(n))),count(max(startvalue,0))) A362843_list = list(islice(A362843_gen(),12)) # Chai Wah Wu, Jun 26 2023
Extensions
a(13) from Martin Ehrenstein, Jul 07 2023
Comments