login
Row sums of irregular tables A005940, A163511, and A332977.
10

%I #23 Jan 03 2022 11:13:05

%S 1,2,7,28,130,702,4384,31516,260068,2445372,25796360,299286550,

%T 3751803964,50211590696,712746859372,10697637496288,169490803535680,

%U 2830925427778810,49785906936838240,921273098388684878,17944637546960083042,368472898102440537484,7993616254370783660414,183539682466936703629744

%N Row sums of irregular tables A005940, A163511, and A332977.

%H Alois P. Heinz, <a href="/A252737/b252737.txt">Table of n, a(n) for n = 0..450</a>

%F a(0) = 1; for n>1: a(n) = Sum_{k = A000079(n-1) .. A000225(n)} A163511(k) = Sum_{k = 2^(n-1) .. (2^n)-1} A163511(k).

%p b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-`if`(

%p i=0, j, 1), j)*ithprime(j), j=1..`if`(i=0, n, i)))

%p end:

%p a:= n-> b(n, 0):

%p seq(a(n), n=0..23); # _Alois P. Heinz_, Mar 04 2020

%t b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[b[n - If[i == 0, j, 1], j]* Prime[j], {j, 1, If[i == 0, n, i]}]];

%t a[n_] := b[n, 0];

%t Table[a[n], {n, 0, 23}] (* _Jean-François Alcover_, Jan 03 2022, after _Alois P. Heinz_ *)

%o (PARI)

%o allocatemem(234567890);

%o A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of _Michel Marcus_

%o A252737print(up_to_n) = { my(s, i=0, n=0); for(n=0, up_to_n, if(0 == n, s = 1, if(1 == n, s = 2; lev = vector(1); lev[1] = 2, oldlev = lev; lev = vector(2*length(oldlev)); s = 0; for(i = 0, (2^(n-1))-1, lev[i+1] = if((i%2),A003961(oldlev[(i\2)+1]),2*oldlev[(i\2)+1]); s += lev[i+1]))); write("b252737.txt", n, " ", s)); };

%o A252737print(23); \\ Terms a(0) .. a(23) were computed with this program.

%o (Scheme, two alternative versions)

%o (define (A252737 n) (if (zero? n) 1 (add A163511 (A000079 (- n 1)) (A000225 n))))

%o (define (A252737 n) (if (zero? n) 1 (add (COMPOSE A005940 1+) (A000079 (- n 1)) (A000225 n))))

%o (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (+ 1 i) (+ res (intfun i)))))))

%o (define (COMPOSE . funlist) (cond ((null? funlist) (lambda (x) x)) (else (lambda (x) ((car funlist) ((apply COMPOSE (cdr funlist)) x))))))

%Y Row sums of tables A005940, A163511, and A332977.

%Y Cf. A252738 (row products).

%Y Cf. A000079, A000225, A252745, A252746.

%K nonn

%O 0,2

%A _Antti Karttunen_, Dec 21 2014