# # Maple program, R. J. Mathar, Mar 06 2010 # f := proc(n,i,x) # option remember ; # if n = 0 then # x; # elif type(n,'even') then # procname(n/2,i+1,x) ; # else # procname((n-1)/2,i,x*ithprime(i)) ; # end if; # end proc: # h := proc(n,m) # option remember; # if n = 0 then # m; # else # procname( floor(n/2), 2*m+(n mod 2)) ; # end if; # end proc: # g := proc(n,i,x) # option remember; # if n = 1 then # x; # elif n mod ithprime(i) = 0 then # procname(n/ithprime(i),i,2*x+1) ; # else # procname(n,i+1,2*x) ; # end if; # end proc: # A005940 := proc(n) # f(n-1,1,1) ; # end proc: # # A005941 := proc(n) # ( h(g(n,1,1),0)+1 )/2; # end proc: # k := 1 : # for n from 1 do # if A005941(n) = A005940(n) then # printf("%d %d\n",k,n); # k := k+1 : # end if ; # end do: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 12 12 14 13 16 14 18 15 20 16 24 17 28 18 32 19 36 20 40 21 48 22 56 23 64 24 72 25 80 26 96 27 112 28 128 29 144 30 160 31 192 32 224 33 256 34 288 35 320 36 384 37 448 38 512 39 576 40 640 41 768 42 896 43 1024 44 1152 45 1280 46 1536 47 1792 48 2048 49 2304 50 2560 51 3072 52 3584 53 4096 54 4608 55 5120 56 6144 57 7168 58 8192 59 9216 60 10240