OFFSET
0,3
FORMULA
From Peter Bala, Dec 24 2017: (Start)
a(n) = Sum_{k = 0..floor((n-1)/2)} (n-2*k)!*binomial(n-k-1,k).
O.g.f.: Sum_{n >= 1} n!*x^n/(1 - x^2)^n = x + 2*x^2 + 7*x^3 + 28*x^4 + ....
MAPLE
A276080 := proc (n) add((n-2*k)*factorial(n-k-1)/factorial(k), k = 0..floor((1/2)*n-1/2)) end proc:
seq(A276080(n), n = 0..25); # Peter Bala, Dec 24 2017
MATHEMATICA
Map[If[# == 1, 0, Total[FactorInteger[#] /. {p_, e_} /; p > 1 :> e PrimePi[p]!]] &, Nest[Append[#, (Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ #[[-1]]) #[[-2]]] &, {1, 2}, 24]] (* Michael De Vlieger, Dec 24 2017 *)
PROG
(Scheme)
;; A more practical standalone program, that uses memoization-macro definec:
(define (A276080 n) (sum_factorials_times_elements_in (A206296as_index_lists n)))
(definec (A206296as_index_lists n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) (else (map + (cons 0 (A206296as_index_lists (- n 1))) (append (A206296as_index_lists (- n 2)) (list 0 0))))))
(define (sum_factorials_times_elements_in nums) (let loop ((s 0) (nums nums) (i 2) (f 1)) (cond ((null? nums) s) (else (loop (+ s (* (car nums) f)) (cdr nums) (+ 1 i) (* i f))))))
(Python)
from sympy import factorint, factorial as f, prime, primepi
from operator import mul
from functools import reduce
def a003961(n):
F=factorint(n)
return 1 if n==1 else reduce(mul, [prime(primepi(i) + 1)**F[i] for i in F])
def a276075(n):
F=factorint(n)
return 0 if n==1 else sum([F[i]*f(primepi(i)) for i in F])
l=[1, 2]
L=[0, 1]
for n in range(2, 11):
l.append(a003961(l[n - 1])*l[n - 2])
L.append(a276075(l[n]))
print(L) # Indranil Ghosh, Jun 21 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 18 2016
STATUS
approved